Logic Gates
Digital Logic 101 · 10 min read
The seven canonical gates
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| A | Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
A combinational logic gate is a small Boolean function: pure inputs to pure output, no internal state. AND/OR/NOT form a complete set — every Boolean function can be written in those three.
The other four (NAND, NOR, XOR, XNOR) are convenience gates. NAND and NOR are cheaper in CMOS than AND and OR; XOR and XNOR detect inequality and equality respectively, and show up everywhere in adders and comparators.
IEEE vs IEC symbols
Most US schematics and textbooks use IEEE distinctive shapes; European and ISO drawings tend to use IEC rectangles. The truth tables are identical — only the drawing convention differs.
The inversion bubble
A small circle on a pin always means invert. NAND is literally an AND followed by a NOT, drawn compactly as one symbol. The convention saves a gate body and makes DeMorgan rewrites easy to read at a glance.
NAND is universal
One transistor pattern, one mask, one gate: that's why standard-cell libraries are built around NAND (and NOR). Designers compile arbitrary logic onto a sea of identical NAND cells before mapping to silicon.
NOR is universal too
NOR-only logic was the foundation of early TTL families and is still common in CMOS standard cells. Either NAND-only or NOR-only is enough — the choice is process- and layout-driven, not theoretical.