Skip to content

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.

Engine name: AND as NANDFR: AND en NANDDE: AND als NAND

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 AND B = NAND(NAND(A, B), NAND(A, B))
#ABlhsrhs
0FALSEFALSEFALSEFALSE
1FALSETRUEFALSEFALSE
2TRUEFALSEFALSEFALSE
3TRUETRUETRUETRUE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 4 rows

The same law in four notations

WordsA AND B
ProgrammingA && B
MathematicalA ∧ B
AlgebraA·B
LaTeXA \cdot B
WordsNAND(NAND(A, B), NAND(A, B))
ProgrammingNAND(NAND(A, B), NAND(A, B))
MathematicalNAND(NAND(A, B), NAND(A, B))
AlgebraNAND(NAND(A, B), NAND(A, B))
LaTeX\overline{\overline{A \cdot B} \cdot \overline{A \cdot B}}
A AND B = NAND(NAND(A, B), NAND(A, B)) A AND B = NAND(NAND(A, B), NAND(A, B)) A B lhsPRIMARY rhs AND NAND NAND NAND
A AND B = NAND(NAND(A, B), NAND(A, B)) A AND B = NAND(NAND(A, B), NAND(A, B)) A B lhsPRIMARY rhs AND NAND NAND NAND

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

Practice

See also

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.