Study Web

Digital Logic Foundations

Truth Tables and De Morgan's Laws

Truth tables are systematic tools for evaluating Boolean expressions. De Morgan's Laws allow transformation between AND/OR forms, essential for circuit simplification.

Truth Tables

A truth table lists all possible input combinations and their corresponding output for a Boolean expression. For n input variables, there are 2n rows.

Truth Table for A·B + C·D

This circuit has 4 inputs → 24 = 16 rows. The table evaluates the intermediate steps A·B and C·D, then combines them with OR.

ABCDA·BC·DA·B+C·D
0000000
0001000
0010000
0011011
0100000
0111011
1011011
1100101
1111111

De Morgan's Laws

De Morgan's Laws are the most important identities in Boolean Algebra. They allow you to swap between AND and OR by distributing or factoring the NOT operator.

Law 1: NOT of AND = OR of NOTs

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

A·B = Ā + B̄

Gate equivalence: A NAND gate equals an OR gate with inverted inputs.

Law 2: NOT of OR = AND of NOTs

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

A+B = Ā · B̄

Gate equivalence: A NOR gate equals an AND gate with inverted inputs.

Key Insight: De Morgan's Laws let you move a NOT bar inside an expression by flipping AND↔OR. This is the basis for simplifying NAND/NOR gate networks without adding extra inverters.

Applying De Morgan — XNOR Example

Starting from XNOR: X = A⊕B

Expanded: X = AB + ĀB̄ (output is 1 when inputs are equal)

Applying De Morgan twice gives an alternative form:

X = (A + B)·(Ā + B̄)

Both expressions produce the same truth table — they are logically equivalent.

Boolean Identities Summary

IdentityAND formOR form
IdentityA · 1 = AA + 0 = A
NullA · 0 = 0A + 1 = 1
IdempotentA · A = AA + A = A
ComplementA · Ā = 0A + Ā = 1
Double NegationNOT(NOT A) = A
De Morgan 1NOT(A·B) = Ā + B̄
De Morgan 2NOT(A+B) = Ā · B̄

Using De Morgan in Gate Design

When designing circuits, De Morgan allows you to shift inverter bubbles from outputs to inputs (or vice versa), enabling you to merge gate layers and reduce component count. For example:

NAND(A,B) = A·B = Ā + B̄ = OR(Ā, B̄)

So a NAND gate can be replaced by an OR gate with both inputs inverted — same function, different physical implementation.