AND from NAND gates only — AND gate

exam standarduniversal-gate construction

Answer

2 NAND gates realising A · B

Why this example is worth doing

Building AND from NANDs takes two gates: one NAND to compute the complement, one more with its inputs tied to invert it back. The page shows the algebra alongside — ((A·B)′)′ = A·B by involution — and makes the economic point that this is why real libraries do not bother: since NAND is the cheap primitive, a design that wants AND usually restructures to absorb the inversion elsewhere rather than paying for a second gate.

Try your own input in the AND gate. Truth table, symbol and algebraic form for A·B, with a live two-input toggle.

How the answer is reached

Gate list

Gate list — columns Node, Gate, Inputs
NodeGateInputs
g1nandA, B
g2nandg1, g1

NAND-only realisation

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

Truth table

Truth table — columns #, A, B, A ↑ B ↑ (A ↑ B)
#ABA ↑ B ↑ (A ↑ B)
0000
1010
2100
3111

Compare with

Open the AND 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