LearnGates

The NAND gate, the universal gate

The NAND gate is an AND gate followed by a NOT: “not and”. It gives 0 only when all of its inputs are 1, and 1 in every other case. Its symbol is the AND shape with the small inverting circle on the output.

Formula Y = (A · B)‾

Truth table

Truth table of NAND
ABY
001
011
101
110

Try it Click the inputs to change them.

Y1

Why it is called universal

With NAND gates alone you can build every other gate, and so any digital circuit at all: NOT, AND, OR and XOR. The lessons in “Everything from NAND” walk you through each one.

This is not just a curiosity. NAND gates are small and fast to make with transistors, and flash memory, the kind in USB sticks and phones, is even called NAND flash after the way its cells are wired.