NAND Bricks

Build every logic gate from NAND gates

NAND is a universal gate: with enough of them you can build any logic circuit, all the way up to a computer. These guides start from a single NAND and build up, one gate at a time, to a working 4-bit adder.

Each guide shows the circuit, explains why it works, and gives the truth table and the number of NAND gates it takes. Click the inputs on any diagram to watch the signals change, or open the circuit in NAND Bricks to rebuild it yourself.

Why NAND?

A NAND gate outputs 0 only when both of its inputs are 1. Feed it the same signal twice and it becomes NOT. Follow it with NOT and it becomes AND. Put NOTs in front and, by De Morgan's law, it becomes OR. Once you have NOT, AND and OR, you can write any truth table as a circuit. That makes NAND a natural place to start, and it is why courses like Nand to Tetris begin with it.

How to use these guides

Work through them in order. Each one reuses the ones before it, which is exactly how NAND Bricks works: build a circuit, save it as a brick, and place that brick inside the next one. By the 4-bit adder you will have 32 NAND gates working together, and you can still see every one of them.

Open NAND BricksFree, in your browser, nothing to install.