Module 1: Foundations of Digital Logic · 1.3 Logic Gates & Truth Tables

Universal Logic Gates: NAND and NOR Implementations

A logic gate family is functionally complete (universal) if it can implement all possible Boolean functions without using other gate types.

This article proves that NAND and NOR are universal gates, demonstrates two-level circuit conversions, and explains their importance in CMOS synthesis.

Functional Completeness

In Boolean algebra, the set ${ \text{NOT}, \text{AND}, \text{OR} }$ is functionally complete. Any truth table can be expressed in canonical Sum of Products (SOP) or Product of Sums (POS) form using these three operations.

Therefore, if a single gate type can implement NOT, AND, and OR operations, that gate type is universal. In digital electronics, the NAND gate and the NOR gate are both universal gates.

In contrast, AND, OR, and XOR gates are not universal. An AND gate cannot generate an inverted logic state.

Constructing NOT, AND, and OR Using NAND Gates

Figure 1 illustrates how NAND gates implement the three fundamental logic operations:

NOT, AND and OR from NAND
Figure 1: Implementation of NOT, AND, and OR functions using only NAND gates

  1. NOT Operation: Connect both inputs of a 2-input NAND gate to input variable $A$: $$\text{NAND}(A, A) = \overline{A \cdot A} = \overline{A} = A’$$
  2. AND Operation: Follow a 2-input NAND gate with a NAND inverter: $$\text{NAND}(\text{NAND}(A, B), \text{NAND}(A, B)) = \overline{\overline{AB}} = AB$$
  3. OR Operation: Invert inputs $A$ and $B$, then connect the inverted signals to a NAND gate (De Morgan’s law): $$\text{NAND}(A’, B’) = \overline{A’ \cdot B’} = (A’)’ + (B’)’ = A + B$$
Function NAND Implementation Gate Count
NOT($A$) $\text{NAND}(A, A)$ 1
AND($A, B$) $\text{NAND}(\text{NAND}(A,B), \text{NAND}(A,B))$ 2
OR($A, B$) $\text{NAND}(\text{NAND}(A,A), \text{NAND}(B,B))$ 3

Because NAND implements NOT, AND, and OR, NAND is a universal logic gate.

Constructing NOT, OR, and AND Using NOR Gates

NOR gates follow a dual construction using De Morgan’s laws:

NOT, OR and AND from NOR
Figure 2: Implementation of NOT, OR, and AND functions using only NOR gates

  1. NOT Operation: Connect both inputs of a 2-input NOR gate to input variable $A$: $$\text{NOR}(A, A) = \overline{A + A} = A’$$
  2. OR Operation: Follow a 2-input NOR gate with a NOR inverter: $$\text{NOR}(\text{NOR}(A, B), \text{NOR}(A, B)) = \overline{\overline{A + B}} = A + B$$
  3. AND Operation: Invert inputs $A$ and $B$, then connect the inverted signals to a NOR gate: $$\text{NOR}(A’, B’) = \overline{A’ + B’} = (A’)’ \cdot (B’)’ = A \cdot B$$

Because NOR implements NOT, OR, and AND, NOR is a universal logic gate.

Application in Logic Synthesis and CMOS

In CMOS technology, inverting gates are smaller and faster than non-inverting gates:

  • A 2-input NAND cell requires 4 transistors.
  • A 2-input AND cell requires a NAND cell followed by an inverter (6 transistors).
  • A 2-input NOR cell requires 4 transistors.
  • A 2-input OR cell requires a NOR cell followed by an inverter (6 transistors).

Synthesis tools map Boolean logic into interconnected NAND or NOR networks (such as And-Inverter Graphs). This avoids redundant intermediate inverters, which saves silicon area and reduces propagation delay.

Historic hardware implementations applied this universality principle. The Apollo Guidance Computer (1966) used several thousand identical 3-input NOR integrated circuits to implement its entire processing unit.

Two-Level NAND-NAND Conversion

You can convert any Sum of Products (SOP) expression directly into a two-level NAND network by applying double negation.

Example: Convert expression $F = AB + CD + E$:

$$F = \overline{\overline{AB + CD + E}} = \overline{\overline{AB} \cdot \overline{CD} \cdot \overline{E}}$$

Figure 3 compares the AND-OR schematic with the equivalent NAND-NAND schematic:

AND-OR and NAND-NAND
Figure 3: Equivalence between two-level AND-OR logic and two-level NAND-NAND logic

  • Level 1: NAND gates evaluate each product term ($\overline{AB}$ and $\overline{CD}$). Single literal $E$ passes through a NAND inverter to produce $\overline{E}$.
  • Level 2: An output NAND gate combines the inverted product terms. By De Morgan’s laws, the output NAND gate inverts the inputs and executes the OR function.

Similarly, any Product of Sums (POS) expression converts directly into a two-level NOR-NOR circuit:

$$F = (A + B)(C + D) = \overline{\overline{(A + B)} + \overline{(C + D)}}$$

Practice Exercise

Convert expression $F = A’B + AB’C$ to an implementation that uses only NAND gates.

View Solution

Expression $F$ is a Sum of Products with two terms: $A’B$ and $AB’C$.

Apply double negation:

$$F = \overline{\overline{A’B + AB’C}} = \overline{\overline{A’B} \cdot \overline{AB’C}}$$

Implementation steps:

  1. Generate complemented inputs $A’$ and $B’$ using 2-input NAND inverters.
  2. Feed $A’$ and $B$ to a 2-input NAND gate to generate $\overline{A’B}$.
  3. Feed $A$, $B’$, and $C$ to a 3-input NAND gate to generate $\overline{AB’C}$.
  4. Connect both intermediate outputs to a 2-input output NAND gate.

Figure 4 illustrates the complete five-gate NAND circuit:

All-NAND solution
Figure 4: Complete NAND-only implementation of F = A'B + AB'C

If complemented inputs $A’$ and $B’$ are available directly from registers, the circuit requires only three NAND gates.

← Multi-Input Gates, Compound Cells, Tri-State, and Transmission Gates CMOS Transistor Operation and Power Dissipation →