NAND gate truth table
The NAND gate outputs 0 only when both inputs are 1, and 1 otherwise. It is the inverse of AND. Here is its full truth table, the boolean expression, and how it is actually built.
| 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.
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 the full lesson on how this gate is designed. You can also generate the table for any expression with the truth table generator.
Other gates:
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 and course.
Open the gate simulator →Frequently asked
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 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 about 4 transistors. In digiwleea you build it from those transistors and the simulator verifies it against this exact truth table.