Tie a NAND's inputs together and it quietly becomes an inverter. A ready-made basics circuit you can open in the TorchAnvil simulator.
NAND is sometimes called a universal gate — meaning you can build any logic circuit you want using nothing but NANDs. That's a big claim, and the proof starts with the tiniest possible trick: take a NAND and wire its two inputs together.
A NAND computes !(A & B). What happens when A and B are the same
signal?
NAND(0, 0) = !(0 & 0) = !0 = 1NAND(1, 1) = !(1 & 1) = !1 = 0So NAND(A, A) = !A. The gate flips the bit. It's a NOT gate wearing a
NAND hat.
| A | NAND(A, A) |
|---|---|
| 0 | 1 |
| 1 | 0 |
If you can build NOT out of NAND, and you can build AND out of NAND (next sample), and you can build OR out of NAND (the one after that) — then you can build anything out of NAND. Entire chips have been manufactured using only NAND cells for exactly this reason: one fabrication process, one gate, infinite logic.