De Morgan's Laws Explained: Simplifying Complex Circuits

Denny Denny
4 min read

Digital Logic 101

📅 January 2026 • ⏱️ 14 min read • 🎓 Beginner-Intermediate

De Morgan's Laws are among the most powerful tools in Boolean algebra. They let you transform complex expressions into simpler, more efficient forms—and understand why NAND and NOR gates are universal. Master these two laws, and you'll unlock a new level of circuit design skill.

The Two Laws

Augustus De Morgan, a 19th-century mathematician, discovered two fundamental relationships between AND, OR, and NOT operations:

De Morgan's First Law

NOT(A AND B) = NOT(A) OR NOT(B)

"The complement of a product equals the sum of the complements"

De Morgan's Second Law

NOT(A OR B) = NOT(A) AND NOT(B)

"The complement of a sum equals the product of the complements"

De Morgan's First Law demonstration

De Morgan's First Law: NAND = OR with inverted inputs. Both circuits produce identical outputs!

Proving De Morgan's First Law

Let's verify with a truth table that NOT(A AND B) = NOT(A) OR NOT(B):

ABA AND BNOT(A AND B)NOT(A)NOT(B)NOT(A) OR NOT(B)Match?
0001111
0101101
1001011
1110000

Every row matches! The expressions are logically equivalent.

De Morgan's Second Law demonstration

De Morgan's Second Law: NOR = AND with inverted inputs. Again, identical outputs for all inputs!

Understanding the Pattern

De Morgan's Laws follow a simple pattern for transformation:

The Transformation Rules

  1. Break the bar (distribute NOT across the expression)
  2. Change the operation (AND ↔ OR)
  3. Invert each term

Example: Transform NOT(A AND B AND C)

Step 1: Break the bar → NOT(A) ? NOT(B) ? NOT(C)
Step 2: Change AND to OR → NOT(A) OR NOT(B) OR NOT(C)

Result: NOT(A AND B AND C) = NOT(A) OR NOT(B) OR NOT(C)

Key Insight: The "Break and Flip" Pattern

When you move a NOT bar across an expression, you "break" the bar across each term AND flip the operator (AND becomes OR, OR becomes AND). This works for any number of terms!

Why De Morgan's Laws Matter

1. NAND and NOR Universality

De Morgan's Laws explain why NAND and NOR gates are universal. A NAND gate is NOT(A AND B), which equals NOT(A) OR NOT(B). With this equivalence, you can build OR gates from NAND gates—and that's how NAND can implement any function!

NAND Gate Universal Logic

Using De Morgan's Law to build OR from NAND: NOT(A) NAND NOT(B) = A OR B

2. Circuit Simplification

Sometimes a circuit requires fewer gates when expressed differently. De Morgan's Laws let you convert between equivalent forms to find the most efficient implementation.

Example: Simplifying NOT(NOT(A) AND NOT(B))

Apply De Morgan's:
NOT(NOT(A) AND NOT(B)) = NOT(NOT(A)) OR NOT(NOT(B))
= A OR B

Result: We reduced the expression to a simple OR!

3. Converting Between Gate Types

If you only have AND and NOT gates available, you can still create OR behavior:

A OR B = NOT(NOT(A OR B))
       = NOT(NOT(A) AND NOT(B))   [by De Morgan]

Implementation: Invert A, invert B, AND them, invert the result!

Practical Applications

🔌 Gate Substitution

If your IC only has NAND gates, use De Morgan's to implement AND, OR, and NOT functions without needing additional chip types.

⚡ Delay Optimization

Converting to NAND-only or NOR-only implementations can reduce propagation delay since signals pass through uniform gate types.

📐 Boolean Expression Simplification

Complex expressions with multiple NOTs often simplify dramatically using De Morgan's Laws.

Extended Examples

Example 1: Three-Input NAND

NOT(A AND B AND C) = NOT(A) OR NOT(B) OR NOT(C)

Example 2: Nested Expression

NOT((A AND B) OR C)
= NOT(A AND B) AND NOT(C)   [De Morgan on OR]
= (NOT(A) OR NOT(B)) AND NOT(C)   [De Morgan on AND]

Example 3: Double Negation

NOT(NOT(A) OR NOT(B))
= NOT(NOT(A)) AND NOT(NOT(B))   [De Morgan]
= A AND B   [Double negation cancels]

Common Mistakes to Avoid

  • Don't forget to flip the operator! NOT(A AND B) ≠ NOT(A) AND NOT(B)
  • Apply to the entire expression: The NOT must cover all terms before transformation
  • Watch for multiple levels: Apply De Morgan's step by step, one level at a time

Try It Yourself!

  1. Verify Law 2: Build NOT(A OR B) and NOT(A) AND NOT(B) and compare outputs
  2. Build OR from NAND: Use De Morgan's to implement OR using only NAND gates
  3. Simplify: Transform NOT(NOT(X) AND NOT(Y) AND NOT(Z)) to its simplest form
  4. 3-input NOR: What does NOT(A OR B OR C) simplify to?

© 2026 DigiSim.io — The Interactive Digital Logic Simulator

digisim.io • Blog • Lessons