Functional completeness: NOT, AND, OR from NAND — NAND gate

corewhy one gate type suffices

Answer

3 NAND gates realising B + A

Why this example is worth doing

The proof that NAND alone can build everything: tie the inputs for NOT, invert the NAND for AND, and invert both inputs for OR. Since every Boolean function has a sum-of-products form built from those three, NAND is functionally complete. The page gives the gate counts, which are what actually matter in a design exercise, and links to the universal gates page for the full conversion table including XOR.

Try your own input in the NAND gate. Truth table, symbol and algebraic form for (A·B)′, the universal gate.

How the answer is reached

Gate list

Gate list — columns Node, Gate, Inputs
NodeGateInputs
g1nandA, A
g2nandB, B
g3nandg1, g2

NAND-only realisation

A ↑ A ↑ (B ↑ B)B + A3 NAND gates, verified by reading the network back out.

Truth table

Truth table — columns #, A, B, A ↑ A ↑ (B ↑ B)
#ABA ↑ A ↑ (B ↑ B)
0000
1011
2101
3111

Compare with

Open the NAND gate

This input is entered in the tool itself — it is too rich for a link to carry.

Note:

Notation this page assumes

  • Symbols: · is AND, + is OR, ⊕ is XOR, a prime or an overline is NOT. The field also takes ∧ ∨ ¬ ~ ! & | and the words.
  • Operator precedence, tightest first: NOT, then AND (including juxtaposition), then XOR/XNOR, then NAND/NOR, then OR, then IMPLIES, then IFF.
  • Gate symbols follow whichever standard the header toggle is set to: ANSI/IEEE Std 91-1984 distinctive shapes, or IEC 60617-12 rectangles.

Sources

  • ANSI/IEEE Std 91-1984, Graphic Symbols for Logic Functions
  • IEC 60617-12, Graphical Symbols for Diagrams — Binary Logic Elements
  • Sheffer, “A Set of Five Independent Postulates for Boolean Algebras” (1913)