De Morgan's Laws Explained: Simplifying Complex Circuits
De Morgan’s Laws are two rules that tell you how to push a NOT operation through an AND or an OR. They are among the most frequently used identities in Boolean algebra, and understanding them is essential before tackling circuit optimization, NAND/NOR universality, or any serious digital design work.
This article focuses on building a clear conceptual understanding of what the laws say, why they work, and how to apply them mechanically. For advanced applications — FPGA synthesis, CMOS gate optimization, and NAND-only implementations — see our companion article on applying De Morgan’s Laws in practice.
The Two Laws
Augustus De Morgan, a 19th-century mathematician, discovered two fundamental relationships between AND, OR, and NOT:
De Morgan’s First Law (NAND Equivalence)
In words: “The complement of a product equals the sum of the complements.” A NAND gate produces the same output as an OR gate whose inputs have been individually inverted.
De Morgan’s Second Law (NOR Equivalence)
In words: “The complement of a sum equals the product of the complements.” A NOR gate produces the same output as an AND gate whose inputs have been individually inverted.

De Morgan’s First Law: NAND = OR with inverted inputs. Both circuits produce identical outputs for every input combination.
Proving Both Laws with Truth Tables
A truth table is the definitive proof of logical equivalence. If two expressions produce the same output for every possible input, they are identical.
Proof of the First Law:
| A | B | Match? | |||||
|---|---|---|---|---|---|---|---|
| 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 | ✓ |
Proof of the Second Law:
| A | B | Match? | |||||
|---|---|---|---|---|---|---|---|
| 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 | ✓ |
Both laws are proven: every row matches.

De Morgan’s Second Law: NOR = AND with inverted inputs.
The “Break the Bar, Change the Sign” Method
Rather than memorizing the formulas, learn this mechanical three-step process. It works for any number of variables and any level of nesting.
The Three Steps
- Break the bar — Split the single negation bar so that each variable gets its own individual bar.
- Change the sign — Swap every AND () for OR (), and every OR () for AND ().
- Cancel double negations — Wherever you see , replace it with .
Worked Example 1: Two Variables
Transform :
- Break the bar: ???
- Change the sign (OR becomes AND):
- No double negations to cancel.
- Result:
Worked Example 2: Three Variables
Transform :
- Break the bar: ??? ???
- Change the sign (AND becomes OR):
- Result:
This generalizes to any number of inputs:
Worked Example 3: Nested Expression (Multi-Level)
Transform :
Apply De Morgan’s to the outer bar first (treat as a single term ):
- Break: ???
- Change sign (OR becomes AND):
Now apply De Morgan’s again to :
Substitute back:
Key rule for nested expressions: Always work from the outermost negation bar inward, one level at a time.
Worked Example 4: Double Negation Cleanup
Transform :
- Break: ???
- Change sign (OR becomes AND):
- Cancel double negations:
- Result:
Circuit-Level Meaning
De Morgan’s Laws are not just algebraic curiosities. Each law has a direct circuit interpretation:
| Algebraic Form | Circuit Equivalence |
|---|---|
| A NAND gate = OR gate with inverted inputs (“bubbled OR”) | |
| A NOR gate = AND gate with inverted inputs (“bubbled AND”) |
This means you can always substitute one gate type for another by moving the inversion bubbles. If you need an OR gate but only have NANDs, invert each input before the NAND:
Implementation: NOT A, NOT B, then NAND the results.

Using De Morgan’s Law to build OR from NAND: invert both inputs, then NAND.
Common Mistakes to Avoid
Mistake 1: Forgetting to Change the Sign
The most frequent error is inverting each term but keeping the same operator:
- Wrong:
- Correct:
If you do not change AND to OR (or vice versa), you have not applied De Morgan’s Law — you have simply distributed the NOT incorrectly.
Mistake 2: Applying to an Incomplete Bar
The negation bar must cover the entire expression being transformed. If the bar only covers part of the expression, De Morgan’s Law only applies to that part.
- is NOT the same as applying De Morgan’s to . The bar only covers here.
Mistake 3: Skipping Levels in Nested Expressions
With nested bars, you must work one level at a time, from the outside in. Trying to “break” all bars simultaneously leads to errors.
Verify It Yourself on digisim.io
Build both sides of De Morgan’s First Law and prove they produce identical outputs:
- Circuit A (NAND): Connect inputs A and B to an AND gate, then feed the AND output through a NOT gate.
- Circuit B (Bubbled OR): Pass A through a NOT gate and B through another NOT gate, then feed both inverted signals into an OR gate.
- Connect both outputs to separate OUTPUT_LIGHT components.
- Toggle A and B through all four combinations. Both lights will always match.
For a more detailed analysis, connect both outputs to an OSCILLOSCOPE_8CH and observe that the waveforms are identical.
Open the NAND Universal Logic Template
Try It Yourself
- Prove Law 2: Build and side by side on digisim.io and verify they match for all inputs.
- Three-input NOR: Apply “Break the Bar, Change the Sign” to simplify . (Answer: )
- Nested challenge: Simplify to its simplest form. (Answer: )
- Build OR from NAND: Using only NAND gates, implement . Verify with an oscilloscope.