AND from NAND gates: A AND B = NAND(NAND(A, B), NAND(A, B))
AND from NAND gates: A AND B = NAND(NAND(A, B), NAND(A, B)), a NAND followed by a NAND inverter.
AND is built as the negation (a NAND with tied inputs) of a NAND.
A NAND is an AND with its output inverted, so inverting it again gives the AND back. The inverter is the tied NAND from the previous law, which is why the inner NAND appears twice: once as the gate and once more as the input to the inverter. Two gates in total.
In a real circuit the inner NAND is built once and its output fans out to both inputs of the second gate; the textual form repeats it because text cannot express sharing. The engine's NAND-only converter counts gates on the construction and says so, and the worked example of the majority function shows a hand-optimised NAND circuit beside the mechanical one, both proved equivalent.
The four-row proof is below.
Statement
A AND B = NAND(NAND(A, B), NAND(A, B)) Proof by truth table: A AND B = NAND(NAND(A, B), NAND(A, B))
| # | A | B | lhs | rhs |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | FALSE | FALSE |
| 2 | TRUE | FALSE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE | TRUE |
The same law in four notations
A AND BA && BA ∧ BA·BA \cdot BNAND(NAND(A, B), NAND(A, B))NAND(NAND(A, B), NAND(A, B))NAND(NAND(A, B), NAND(A, B))NAND(NAND(A, B), NAND(A, B))\overline{\overline{A \cdot B} \cdot \overline{A \cdot B}}The common slip
Stopping at one NAND. NAND(A, B) alone is the negation of the AND; the second gate is what restores the AND.
Questions
Could I use NAND(A, TRUE) style inverters here?
Yes: NAND(NAND(A, B), TRUE) is also A AND B. The engine chooses between the self-fed and the constant inverter by size, and the equivalence check covers either.
Related
Lesson that teaches this
Tools
- Boolean algebra calculator and simplifier with steps (every law named and verified)
- Logical equivalence checker: two expressions, exact verdict, counterexample
Practice
See also
- NOT from NAND: NOT A = NAND(A, A)
- OR from NAND gates: A OR B = NAND(NAND(A, A), NAND(B, B))
- Majority of three with NAND gates only
- NAND-only and NOR-only converter with equivalence proof
Laws
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.