Sometimes the best way to understand new concepts is to break them down into the smallest parts possible and then build them back up again. The basic elements for all of our digital electronics are logic gates. Any digital electronic device is specified by chaining individual logic elements together and with a billion of them in the correct order we create a computer.
Almost all of these gates take two digital input signals, either a True or a False and output a single signal as a result. The resulting signal is based on the relationship between the input signals and the output behavior characterizes the type of logic gate. For these gates we denote a True signal as the number ‘1’ and a False signal as the number ‘0’. The common way of representing the behavior of the logic gate is a Truth Table, showing all outputs for all possible input signals. In schematics the logic gates are represented by distinct symbols.
AND
The AND logic gate takes two inputs and outputs a True if and only if both inputs are True.
A | B | A AND B |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |
1 | 0 | 0 |
NOT
The NOT logic gate is commonly known as an Inverter because it outputs the opposite of the signal that it was given.
A | NOT A |
0 | 1 |
1 | 0 |
NAND
The NAND logic gate takes two inputs and outputs a True in all cases except the one where both inputs are True. This behavior can also be achieved by adding a NOT gate to the end of the AND gate, hence the name NAND is an abbreviation of NOT AND.
A | B | A NAND B |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
1 | 0 | 1 |
OR
The OR gate outputs True if any of the input signals are also True. Therefore the only time the OR gate has a False output is when both of the inputs are False.
A | B | A OR B |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 1 | 1 |
1 | 0 | 1 |
NOR
The NOR Logic Gate outputs a True value if and only if the two inputs are False. This behavior is the opposite of the OR gate and therefore is represented by a NOT gate attached to the output of an OR gate, hence the name NOR.
A | B | A NOR B |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 1 | 0 |
1 | 0 | 0 |
XOR
The XOR gate only outputs a true result if the two inputs are different. This behavior is known as an Exclusive OR operation.
A | B | A XOR B |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 1 | 0 |
1 | 0 | 1 |
XNOR
The XNOR logic gate outputs a True if both of the inputs are the same value. This is the opposite of the XOR gate behavior, hence the name Exlusive NOT OR.
A | B | A XNOR B |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 1 | 1 |
1 | 0 | 0 |
Further Exploration
We use these basic logic building blocks to create all types of digital circuits. In further posts we will examine the special patterns and methods that connect these logic blocks to create a computer.