NAND as OR

Invert both inputs, NAND them, and De Morgan hands you an OR. A ready-made basics circuit you can open in the TorchAnvil simulator.

Three NANDs, one OR

You've seen NAND turn into NOT and into AND. Now for the third corner of the trick: three NANDs, wired just right, become an OR. The magic ingredient is De Morgan's law.

How it works

De Morgan says !(!A & !B) = A | B. Read that right to left: if you want A OR B, you can instead invert both inputs, AND them, and invert the result.

The circuit does exactly that, using only NANDs:

  1. NAND #1 with both inputs tied to A → produces !A.
  2. NAND #2 with both inputs tied to B → produces !B.
  3. NAND #3 takes !A and !B and produces !(!A & !B) — which by De Morgan is A | B.
A B !A !B Lamp (A OR B)
0 0 1 1 0
0 1 1 0 1
1 0 0 1 1
1 1 0 0 1

Why it matters

This closes the universality proof. NAND alone can build NOT, AND, and OR — and from those three you can build every logic function, every adder, every memory cell, every CPU. One gate type is enough for the entire digital world. That's why NAND is often called "the universal gate" in textbooks.

Try this