3.1.14 · D3Boolean Algebra & Logic Gates

Worked examples — Universal gates (NAND - NOR completeness)

2,146 words10 min readBack to topic

Before anything, one picture to anchor the only symbols we use. A gate is a little box: signals go in on the left, one signal comes out on the right. A signal is either (off, low) or (on, high). The small bubble on a gate's output means "invert" — flip .

Figure — Universal gates (NAND - NOR completeness)

We write (NAND, "not-and") and (NOR, "not-or"). The bar means NOT. The dot (often dropped) means AND; the plus means OR. That is the entire alphabet.


The scenario matrix

Every buildable-from-a-single-gate problem falls into one of these cells. The examples below are labelled with the cell they cover.

Cell Case class Covered by
C1 Degenerate input: NOT (self-tie) Ex 1
C2 Basic 2-input rebuild: AND, OR Ex 2, Ex 3
C3 Zero / constant inputs (feed a or ) Ex 4
C4 Multi-variable expression (3+ inputs) Ex 5
C5 The dual gate (NOR side) Ex 6
C6 Non-monotonic target (XOR / XNOR) Ex 7
C7 Real-world word problem Ex 8
C8 Exam twist: minimise gate count / spot the trap Ex 9

Worked examples

Figure — Universal gates (NAND - NOR completeness)
Figure — Universal gates (NAND - NOR completeness)

Scenario coverage check

Recall Did we hit every cell?

C1 degenerate/self-tie ::: Ex 1 (NOT) C2 basic AND & OR rebuild ::: Ex 2, Ex 3 C3 constant/zero inputs ::: Ex 4 C4 multi-variable (3 inputs) ::: Ex 5 C5 dual NOR side ::: Ex 6 C6 non-monotonic XOR ::: Ex 7 C7 word problem ::: Ex 8 C8 exam trap & min-count ::: Ex 9


Connections

  • Boolean Algebra & Logic Gates
  • De Morgan's Laws — the engine behind every OR/AND swap above
  • Truth Tables — how each "Verify" line was checked
  • Logic Gate Symbols — the boxes and bubbles in the figures
  • Combinational Circuits — where these builds get assembled
  • CMOS Transistors — why NAND/NOR are the cheapest physical primitives
  • Duality Principle — the NAND↔NOR mirror used in Ex 6

Build map

self tie

then invert

invert inputs then NAND

then invert

chain

share signal

NAND gate

NOT 1 gate

AND 2 gates

OR 3 gates

NOR 4 gates

ABC 4 gates

XOR 4 gates

Any Boolean function