Skip to content
BetterDL

NAND-NAND logic

Also called: NAND-NAND, NAND-NAND circuit, NAND-NAND implementation, two-level NAND logic

A two-level circuit made only of NAND gates that implements a sum of products. It is an AND-OR circuit with every gate replaced by a NAND.

NAND-NAND logic is a way to build any sum of products expression using only NAND gates, in two levels.

The recipe:

  1. Draw the AND-OR circuit: one AND per product term, all feeding one OR.
  2. Replace every gate, AND and OR alike, with a NAND. Keep the wiring.

Why it works, by bubble pushing: put a pair of bubbles on each wire between the ANDs and the OR. The pair cancels, so nothing changes. Now each AND has an output bubble, making it a NAND. The OR has bubbled inputs, and an OR with bubbled inputs is a NAND too.

In algebra, for , drawn above:

= by De Morgan's law.

Why designers like it: NAND is a universal gate and the cheapest gate in CMOS, so a whole design can use one cell type. The circuit has the same two-level speed as AND-OR.

One detail to watch: a product term that is a single literal has no AND gate. It goes straight into the output NAND, so it must enter inverted. For , the output NAND's inputs are and C.

ABCDY

Worked example

Example

Y = A'B + AC with NANDs only

Build using only 2-input NANDs.

ABCY
  1. 1.

    is needed, so gate 1 is a NAND with both inputs tied to A.

  2. 2.

    Gate 2: NAND(, B) gives .

  3. 3.

    Gate 3: NAND(A, C) gives .

  4. 4.

    Gate 4: NAND of gates 2 and 3 gives = .

  5. 5.

    Check A = 0, B = 1, C = 0: gate 1 = 1, gate 2 = 0, gate 3 = 1, gate 4 = NAND(0, 1) = 1. And = 1 + 0 = 1. ✓

Common mistakes

  • Reading the output NAND as an AND and writing a product of the terms. By De Morgan it acts as an OR of the terms.

  • Feeding a single-literal term into the output NAND uninverted. It must arrive complemented.

  • Expecting NAND-NAND to give a product of sums. That is NOR-NOR's job.

Practice NAND-NAND logic

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

NAND-NAND logic is taught in Logic Gates and Boolean Simplification.