Logic gates: symbols and truth tables
The seven basic logic gates, with the symbol, the truth table, how to write each one as a Boolean expression, and the 74-series package that holds it.
Logic gates
The seven gates every tool uses, with the symbol, how to type it, its truth table and the 74-series packages that hold it.
AND
Out is 1 only when every input is 1.
Type AB · reads as A · B
74LS08 quad 2-input · 74LS11 triple 3-input · 74LS21 dual 4-input
| A | B | F |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | F |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT
One input, turned over: 1 becomes 0 and 0 becomes 1.
Type A' · reads as A′
| A | F |
|---|---|
| 0 | 1 |
| 1 | 0 |
NAND
AND, then NOT: 0 only when every input is 1. Universal — any function can be built from NANDs alone.
Type (AB)' · reads as (A · B)′
74LS00 quad 2-input · 74LS10 triple 3 · 74LS20 dual 4 · 74LS30 8-input
| A | B | F |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOR
OR, then NOT: 1 only when every input is 0. Universal, like NAND.
Type (A + B)' · reads as (A + B)′
| A | B | F |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR
Out is 1 when the inputs differ — an odd number of 1s, for more than two.
Type A ^ B · reads as A ⊕ B
74LS86 quad 2-input
| A | B | F |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XNOR
XOR, then NOT: 1 when the inputs are equal.
Type (A ^ B)' · reads as (A ⊕ B)′
No XNOR package in Breadboard Simulator's library: a 74LS86 into a 74LS04 does it
| A | B | F |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |