Resources | Subject Notes | Computer Science
Construct the truth table for each of the logic gates.
The AND gate outputs a 1 (true) only if both inputs are 1 (true). Otherwise, it outputs a 0 (false).
Input A | Input B | Output |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Symbol: $\land$
The OR gate outputs a 1 (true) if at least one of the inputs is 1 (true). It outputs a 0 (false) only if both inputs are 0 (false).
Input A | Input B | Output |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Symbol: $\lor$
The NOT gate inverts the input. If the input is 1 (true), the output is 0 (false), and vice versa.
Input | Output |
---|---|
0 | 1 |
1 | 0 |
Symbol: $\neg$ or $\overline{}$
The NAND gate is the inverse of the AND gate. It outputs a 0 (false) only if both inputs are 1 (true). Otherwise, it outputs a 1 (true).
Input A | Input B | Output |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Symbol: $\overline{\land}$
The NOR gate is the inverse of the OR gate. It outputs a 1 (true) only if both inputs are 0 (false). Otherwise, it outputs a 0 (false).
Input A | Input B | Output |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Symbol: $\overline{\lor}$
The XOR gate outputs a 1 (true) if the inputs are different. It outputs a 0 (false) if the inputs are the same.
Input A | Input B | Output |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Symbol: $\oplus$
The XNOR gate is the inverse of the XOR gate. It outputs a 1 (true) if the inputs are the same. It outputs a 0 (false) if the inputs are different.
Input A | Input B | Output |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Symbol: $\bigoplus$