Home / Electrical Engineering / Digital Electronics / De Morgan's Theorem

Formula & Calculator

De Morgan's Theorem

De Morgan's theorem gives you a handy way to simplify logic expressions that have a NOT bar over a group. It says that the inverse of (A AND B) is the same as (NOT A) OR (NOT B), and the inverse of (A OR B) is the same as (NOT A) AND (NOT B). In plain words: you can push the NOT inside the brackets if you also flip AND to OR and vice versa. This is extremely useful for reducing the number of gates needed in a circuit.

Digital Electronics Boolean Algebra

De Morgan's Theorem Calculator

De Morgan's laws say that the complement of an AND is the OR of the complements, and the complement of an OR is the AND of the complements. Flip the inputs to see both laws agree on every row, view the gate equivalents, or type your own Boolean expression and push its negations down to the variables.

(A · B)' = A' + B'(A + B)' = A' · B'
Number of variables
Input values (tap to toggle)
Law 1: complement of AND (NAND)
=
Law 2: complement of OR (NOR)
=

Step-by-step

Summary

Gate equivalents (using A and B)

A small circle means inversion. A NAND gate equals an OR gate with inverted inputs, and a NOR gate equals an AND gate with inverted inputs. Teal wires carry 1, grey wires carry 0.

Truth table

Columns (A·B…)' and A'+B'… are identical on every row, as are (A+B…)' and A'·B'… Your current row is highlighted.

Try your own expression

Expression F
F with negations pushed to the variables
Complement F' pushed to the variables
Verification

Use variables A to D. Write AND as · or * or & (or just put letters together), OR as +, and NOT as a prime (A') or ! before the variable. Parentheses group terms. Constants 0 and 1 are allowed.

Related identities and uses

RuleExpressionWhy it matters
De Morgan 1(A·B)' = A' + B'NAND = OR of inverted inputs
De Morgan 2(A+B)' = A'·B'NOR = AND of inverted inputs
Double negation(A')' = ATwo inversions cancel
AND from NORA·B = (A'+B')'NOR is a universal gate
OR from NANDA+B = (A'·B')'NAND is a universal gate
NOT from NANDA' = (A·A)'One gate type builds everything
In code!(a && b) == (!a || !b)Rewrite conditions more clearly

FAQ

What does De Morgan's theorem say?

Negating an AND gives an OR of the negated inputs, and negating an OR gives an AND of the negated inputs: (A·B)' = A' + B' and (A+B)' = A'·B'. It extends to any number of variables: (A·B·C)' = A' + B' + C'.

How does it help in circuit design?

It lets you convert between gate types, for example building a design only from NAND gates, and it underlies "bubble pushing" in schematics. It also helps simplify expressions with long negation bars.

How do I apply it to a bigger expression?

Break the bar over a group, swap AND for OR (or OR for AND), and put a bar on each part. Repeat until only single variables are negated. The expression tool above does this automatically and shows each step.

Is this the same as distribution?

No. Distribution rewrites A·(B+C) as A·B + A·C. De Morgan's laws instead move a negation across a group while swapping its operator.

Educational tool only. This models ideal two-state logic. The expression tool supports variables A to D and the operators shown. Real gates also have delay and voltage thresholds that a Boolean model ignores.

Variables

Symbol Quantity Unit
A Input A dimensionless
B Input B dimensionless
Y Output (A·B)' dimensionless
Z Output A' + B' dimensionless

What it means

De Morgan’s theorem provides rules for simplifying Boolean expressions. It states that the complement of an AND is the OR of complements: (A·B)' = A' + B', and the complement of an OR is the AND of complements: (A+B)' = A' · B'. These transformations are essential for converting between positive and negative logic, and for simplifying complex logic circuits. They allow the use of different gate types (NAND vs NOR) and are heavily used in digital logic design. De Morgan’s theorem also helps in minimising logic functions using Boolean algebra. Example: To implement a function F = (A·B)' using only NOR gates, De Morgan gives F = A' + B', which can be built with two inverters and a NOR gate, or directly with a NAND gate. This theorem is fundamental for digital electronics.

Worked example

De Morgan's Theorem – Practical Example

Real‑World
Scenario: You need to simplify the expression for a circuit that activates an alarm when both inputs are NOT true: (A·B)'. Apply De Morgan's theorem.
ParameterValue
InputsA, B
Original(A·B)'
Theorem(A·B)' = A' + B'
1Apply De Morgan: (A·B)' = A' + B'
2This means the alarm triggers if A is 0 OR B is 0.
Final Design Y = A' + B' ✓ Simplified
Why: De Morgan's theorem transforms NAND to OR with inverted inputs – useful for gate‑level design.

Common mistakes

Watch unit consistency and the assumptions behind the formula; misapplying it outside its valid conditions is the most frequent error.

Applications

De Morgan's theorem states that the complement of an AND is the OR of complements, and vice versa: (A·B)' = A' + B' and (A+B)' = A'·B'. This theorem is widely used to simplify Boolean expressions and to convert between gate types. Engineers use it to reduce the number of gates, to minimise circuit area, and to improve speed. By applying De Morgan's laws, they can transform complex logic into more implementable forms. This is a core tool in digital logic design and is essential for combinational logic optimisation.

  • Logic simplification and gate‑level minimisation
  • Conversion between NAND/NOR and AND/OR implementations
  • Design of efficient digital circuits
  • Boolean algebra and Karnaugh maps
  • Educational foundation of digital logic design

Suggest an improvement

Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.

Page details

2,026

Views
  • Published July 10, 2026
  • Last updated August 26, 2026