How to build a NOT gate from a NAND gate
A NOT gate takes one NAND gate: wire the same signal into both of its inputs. A NAND only outputs 0 when both inputs are 1, so feeding it A twice gives 0 when A is 1 and 1 when A is 0, which is exactly an inverter.
- 1NAND gates
- Yesfewest possible
- 1input
- 1output
The formula
Q = NAND(A, A)
How it works
A NAND gate answers one question: are both of my inputs 1? If yes it outputs 0, otherwise it outputs 1. When both inputs are the same wire, that question becomes is A 1?, and the answer comes out flipped.
There is a second way to do it: hold one input at 1 and send A into the other. NAND(A, 1) is also NOT A. In NAND Bricks, an unwired input shows a small 0 beside it; click it to make it a 1 and try this version.
NOT matters more than it looks. Almost every other gate on this site is "some NAND gates, then flip the answer", so you will reuse this one constantly. Save it as a brick once and you never have to wire it again.
Gate by gate
- Takes A on both inputs. Outputs 0 when A is 1, and 1 when A is 0.
Truth table
| A | Q |
|---|---|
| 0 | 1 |
| 1 | 0 |
Why 1 NAND gate?
One NAND gate is the minimum, since you cannot do it with zero gates. It is also the only gate on this site that needs just one.
Where it's used
Inverters show up everywhere: turning an AND into a NAND and back, making the "not selected" signal in a multiplexer, and building the active-low enable lines common in real chips.