De Morgan's Laws and Bubble Pushing
De Morgan’s laws provide mathematical equations to invert complex Boolean expressions. In digital circuit schematics, engineers apply these laws through an analysis technique called bubble pushing.
This article proves De Morgan’s laws, demonstrates schematic transformation techniques, and explains why CMOS circuits prioritize inverting gates.
Mathematical Formulation
De Morgan’s laws define two algebraic identities:
$$\text{Law 1: } (A \cdot B)’ = A’ + B’$$
$$\text{Law 2: } (A + B)’ = A’ \cdot B’$$
These laws state that the complement of a product of variables equals the sum of the complemented variables. Conversely, the complement of a sum of variables equals the product of the complemented variables.
Truth Table Verification
Verification of Law 1: $(A \cdot B)’ = A’ + B'$
| $A$ | $B$ | $A \cdot B$ | $(A \cdot B)'$ | $A'$ | $B'$ | $A’ + B'$ |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Columns $(A \cdot B)’$ and $A’ + B’$ are identical across all rows.
Verification of Law 2: $(A + B)’ = A’ \cdot B'$
| $A$ | $B$ | $A + B$ | $(A + B)'$ | $A'$ | $B'$ | $A’ \cdot B'$ |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Columns $(A + B)’$ and $A’ \cdot B’$ are identical across all rows.
Schematic Transformations: Bubble Pushing
In digital logic schematics, a small circle (bubble) indicates an inversion operation.
De Morgan’s laws show that an active-low or inverting gate symbol has an equivalent dual representation:
- A NAND gate ($(A \cdot B)’$) equals an OR gate with inverted inputs ($A’ + B’$).
- A NOR gate ($(A + B)’$) equals an AND gate with inverted inputs ($A’ \cdot B’$).
Bubble pushing redraws logic gates using De Morgan equivalents to simplify schematic reading:
- Move an inversion bubble from a gate output to its inputs by changing the gate function (AND changes to OR; OR changes to AND).
- Move inversion bubbles from gate inputs to the output by changing the gate function.
- Eliminate adjacent pairs of inversion bubbles that share the same conductor line (involution law).
Figure 2 demonstrates bubble pushing in a two-stage NAND circuit:
Algebraic derivation:
$$F = ((AB)’ \cdot C)’ = ((AB)’)’ + C’ = AB + C’$$
Pushing the output bubble of gate G2 back to its inputs transforms G2 into an OR gate. The upper input bubble on G2 cancels the output bubble of G1. The resulting circuit implements $AB + C’$.
Multi-Variable Extension
De Morgan’s laws apply across any number of input variables:
$$(A \cdot B \cdot C)’ = A’ + B’ + C’$$ $$(A + B + C)’ = A’ \cdot B’ \cdot C’$$
General mathematical formula for $n$ variables:
$$\left(\prod_{i=1}^{n} A_i\right)’ = \sum_{i=1}^{n} A_i’ \qquad \left(\sum_{i=1}^{n} A_i\right)’ = \prod_{i=1}^{n} A_i’$$
In Verilog RTL, bitwise reduction operators implement these identities:
// Equivalent 3-input NAND representations
assign F = ~(A & B & C);
assign F = ~A | ~B | ~C;
// Equivalent 3-input NOR representations
assign G = ~(A | B | C);
assign G = ~A & ~B & ~C;
Worked Examples
Example 1: Simplify $(AB’ + C)'$
Apply Law 2 to distribute the outer complement:
$$(AB’ + C)’ = (AB’)’ \cdot C’$$
Apply Law 1 to term $(AB’)’$:
$$(AB’)’ = A’ + (B’)’ = A’ + B$$
Substitute the expression and expand terms:
$$F = (A’ + B) \cdot C’ = A’C’ + BC’$$
Example 2: Two-Level NAND Network
Figure 3 illustrates two NAND gates driving a third NAND gate:
$$P = (AB)’ \qquad Q = (CD)’ \qquad F = (P \cdot Q)’ = ((AB)’ \cdot (CD)’)’$$
Apply De Morgan’s Law 1 to the output gate:
$$F = ((AB)’)’ + ((CD)’)’ = AB + CD$$
A two-level NAND-NAND circuit implements an AND-OR (Sum-of-Products) expression. Conversely, a two-level NOR-NOR circuit implements an OR-AND (Product-of-Sums) expression.
CMOS Circuit Implementation
CMOS circuits use complementary pairs of NMOS and PMOS transistors:
- An NMOS transistor conducts when its gate voltage is high (logic 1). The NMOS network connects the output to ground (pull-down).
- A PMOS transistor conducts when its gate voltage is low (logic 0). The PMOS network connects the output to supply voltage $V_{DD}$ (pull-up).
In a CMOS NAND gate, the NMOS transistors connect in series, and the PMOS transistors connect in parallel. The output pulls low only when both inputs are high. This circuit requires four transistors in a single inverting stage.
A non-inverting AND gate requires a NAND gate followed by an inverter (six transistors across two stages). The added stage increases propagation delay, silicon area, and power dissipation. Because CMOS logic is inverting, synthesis tools use De Morgan’s laws to map designs into NAND and NOR networks.
Practice Exercises
Exercise 1: Simplify expression $(A + B’C)’$.
View Solution
$$(A + B’C)’ = A’ \cdot (B’C)’ = A’ \cdot (B + C’) = A’B + A’C’$$
Exercise 2: Prove that $(A \oplus B)’ = AB + A’B’$ using De Morgan’s laws. Recall that $A \oplus B = AB’ + A’B$.
View Solution
$$(AB’ + A’B)’ = (AB’)’ \cdot (A’B)’ = (A’ + B)(A + B’)$$
Expand the product terms:
$$A’A + A’B’ + AB + BB’ = 0 + A’B’ + AB + 0 = AB + A’B’$$
The complement of the XOR function is the XNOR function.
Exercise 3: Transform expression $(A’B + C)’$ using bubble pushing to an equivalent expression using only AND, OR, and input inverters.
View Solution
$$(A’B + C)’ = (A’B)’ \cdot C’ = (A + B’) \cdot C’$$
The circuit requires one OR gate, one AND gate, and two input inverters (on inputs B and C).