Logic gates, in an abstract sense, perform a Boolean function on one or more binary inputs. They take in binary data, decide if that data equals a 0 or 1, and then outputs that binary result.

In a physical sense, they can be transistors, diodes, or any number of physical objects with an “on” and “off” state. The “on” state is the binary 1, and an “off” state is the binary 0.

So let us start with a simple logic gate as an example. We will use the “AND” logic gate, which is a common and foundational piece of logic in general.

Assuming we have two binary bits of data coming into the **“AND” gate**, the gate will output a 1 if both inputs are 1 as well; otherwise, it will output a 0. Here is the truth table that represents these possible results:

Input A = 0 | Input B = 0 | Output Q = 0

Input A = 0 | Input B = 1 | Output Q = 0

Input A = 1 | Input B = 0 | Output Q = 0

Input A = 1 | Input B = 1 | Output Q = **1**

Only in the final row, where both input 1 and input 2 are 1, does the “AND” gate output a 1 as well. Remember this.

Now, we can check if one or the other input is a 1 using the **“OR” gate**. Only if both inputs are 0 does the output equal 0. Here is the truth table for these results:

Input A = 0 | Input B = 0 | Output Q = 0

Input A = 0 | Input B = 1 | Output Q = **1**

Input A = 1 | Input B = 0 | Output Q = **1**

Input A = 1 | Input B = 1 | Output Q = **1**

Notice the contrast with the “AND” table. Now, even if one of the inputs is a 0, the result can still be 1 if the other input is a 1 as well.

Finally, let’s talk the **“NOT” gate**, also known as the **inverter**. This is because this gate inverts a binary input. If the input is 0, then the output is 1, and vice versa. Here is a truth table to demonstrate that:

Input A = 0 | Output Q = **1**

Input A = 1 | Output Q = 0

That covers the basics of logic gates. There are more logic gates, such as “**NOR**” and “**XOR**” and even “**NAND**” which provide clever twists on the basic logic gates presented here. Check these logic gates out in Logic Gates, Level II.

## 2 Replies to “Logic Gates, Level I”