NAND gate: truth table and symbol
A NAND gate is a logic gate that outputs 0 only when both inputs are 1, and 1 otherwise. It is the inverse of AND. Here are its symbol, its full truth table, the boolean expression, and how it is actually built.
NAND gate truth table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Boolean expression: Y = (A · B)̅. A 1 in the table means a high voltage (logic true) and a 0 means low (false). Read each row as: for these inputs, the output Y is this value.
Try the NAND gate live
3-input NAND gate truth table
| A | B | C | Y |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
A 3-input NAND gate outputs 0 only when all three inputs are 1, and 1 in the other seven rows.
4-input NAND gate truth table
| A | B | C | D | Y |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 |
A 4-input NAND gate outputs 0 only when all four inputs are 1 (the 1111 row), and 1 in the other 15 rows.
What the NAND gate does
NAND is the universal gate: every other gate (NOT, AND, OR, XOR, even a full CPU) can be built from NAND gates alone. That, plus the fact that it is one of the most efficient gates to make in CMOS (just four transistors), is why it is the foundation digiwleea builds the whole course on.
Build it yourself
Reading a table is one thing; watching the signals flow is another. Open the logic gate simulator and wire a NAND gate up from transistors, or read how the NAND gate works in CMOS. You can also generate the table for any expression with the truth table generator.
On a breadboard, four NAND gates come in one chip, the 7400 (74LS00, 74HC00): see its pinout and try every gate live. For more inputs there are the 7410 (three 3-input NANDs) and the 7420 (two 4-input NANDs), and the CMOS CD4011 runs from 3 V to 18 V.
Other gates (or all seven symbols and truth tables on one page):
The NAND gate is one small step toward a working CPU. Build every gate from CMOS transistors and work up to an 8-bit processor in the free digiwleea lab, with the free theory reference alongside.
Open the gate simulator →Frequently asked
What is a NAND gate?
A NAND gate is a logic gate that outputs 0 only when both inputs are 1, and 1 otherwise. It is the inverse of AND.
What is the truth table of a NAND gate?
The NAND gate outputs 0 only when both inputs are 1, and 1 otherwise. It is the inverse of AND. For inputs (A,B) the outputs are 0,0→1 0,1→1 1,0→1 1,1→0.
What does the NAND gate symbol look like?
It is drawn as the AND gate's D shape with a small circle (the inversion bubble) at the output.
What is the truth table of a 3-input NAND gate?
A 3-input NAND gate outputs 0 only when all three inputs are 1, and 1 in the other seven rows.
What is the truth table of a 4-input NAND gate?
A 4-input NAND gate outputs 0 only when all four inputs are 1 (the 1111 row), and 1 in the other 15 rows.
What is the boolean expression for NAND?
The NAND gate is written Y = NOT (A AND B) (symbolically Y = (A · B)).
How many transistors does a NAND gate take?
A standard CMOS NAND gate uses 4 transistors. In digiwleea you build it from transistors and the simulator verifies it against this exact truth table.
Which IC is a NAND gate?
The 7400 (74LS00, 74HC00) chip holds four NAND gates in one 14-pin package; its pinout runs live on the 7400 page.
Why is the NAND gate called a universal gate?
Because NAND gates alone can build NOT, AND and OR, and from those any logic function, so a whole circuit can be made from NAND gates only. A NAND with its inputs tied together is already a NOT gate.
Which is better, NAND or NOR?
Both are universal. In CMOS, NAND is usually preferred: its two series transistors are the faster NMOS type, while a NOR stacks the slower PMOS transistors in series.
How do you make NOT, AND, OR and NOR from NAND gates?
NOT takes one NAND with its inputs tied together; AND is a NAND followed by that NOT (2 gates); OR inverts both inputs first, NAND(A', B') (3 gates); NOR is that OR followed by a NOT (4 gates). Each runs live: NOT, AND, OR and NOR from NAND.