NAND: the Gate Everything Is Built From

Before level 2 the game offers a short interactive intro: you flip through all four rows of the NAND table by hand and discover yourself how a single gate makes a NOT. This page tells the same story in text.

Experiment: the other way round

Here is a NAND gate: two switches A and B and lamp Q. Try all 4 combinations and notice: the lamp goes dark in exactly one case — when both are on. In the other three it is lit. The table below is the gate's whole "manual": four rows, and everything is in them.

ABQ
001
011
101
110

Predict: one signal into both inputs

What happens if you feed the same signal into both inputs? Only two rows of the table remain: 00→1 and 11→0. The output is always the opposite of the input — that is a NOT inverter. The signal does not "pass straight through" (otherwise 0 would give 0) and it is not "averaged": a lamp has two states, and it simply shows the flipped input.

One brick instead of many

Everything can be built from a single NAND. Tie the inputs together — and you get the NOT you will build on level 2. Next: NAND plus NOT make AND (level 3), and NOT plus AND make OR (level 4). In real chips NAND is the cheapest and fastest gate, so circuits are built almost entirely out of NANDs: fewer distinct parts — simpler production.

Where it is used

On level 2 you will build an inverter from one NAND: two wires from the input into both gate inputs. This is the first example of the key idea of circuit design — the operation you need can be made not from new parts but from the right wiring of the parts you already have.

Take the intro in the game · Level 2 guide · All intros