COMPUTER ORGANIZATION & ARCHITECTURE / 2. BOOLEAN ALGEBRA
Boolean Algebra & Logic Simplification
The math behind digital logic — minimizing circuits saves transistors
EXPLANATION
Boolean Algebra is the mathematical framework for working with binary values (0 and 1, True and False). It was invented by George Boole in 1854 — nearly 100 years before computers. Claude Shannon proved in 1937 that Boolean algebra could describe electrical circuits. This is the mathematical foundation of all digital logic. Boolean Algebra Laws — these let you simplify logic expressions, reducing the number of gates needed (fewer gates = smaller chip = less power = faster): Identity Laws: - A + 0 = A (OR with 0 changes nothing) - A · 1 = A (AND with 1 changes nothing) Null Laws: - A + 1 = 1 (OR with 1 is always 1) - A · 0 = 0 (AND with 0 is always 0) Idempotent Laws: - A + A = A - A · A = A Complement Laws: - A + A' = 1 (something OR its opposite is always true) - A · A' = 0 (something AND its opposite is always false) Commutative: A + B = B + A, A · B = B · A Associative: (A+B)+C = A+(B+C) Distributive: A·(B+C) = A·B + A·C De Morgan's Theorems — the most important laws for circuit design: - (A · B)' = A' + B' → NAND equals NOT-A OR NOT-B - (A + B)' = A' · B' → NOR equals NOT-A AND NOT-B These let you convert between AND/OR forms, and explain why NAND and NOR are universal. Karnaugh Maps (K-Maps): A visual tool for minimizing Boolean expressions. Group adjacent 1s in powers of 2 (1, 2, 4, 8). Each group eliminates one variable. The result is the minimal Sum of Products (SOP) expression — the fewest gates possible. Canonical forms: - Sum of Products (SOP): F = AB + AC' + BC — ORing together AND terms - Product of Sums (POS): F = (A+B)(A+C') — ANDing together OR terms Both are equivalent. SOP maps to AND-OR circuit, POS maps to OR-AND circuit. Minterms and Maxterms: every Boolean function can be expressed as a sum of minterms (one per row where output=1) or product of maxterms (one per row where output=0).
DIAGRAM
K-MAP EXAMPLE (3 variables: A, B, C):
Truth table: K-Map (Gray code order!):
A B C | F BC
──────┼── A │ 00 01 11 10
0 0 0 │ 1 ───┼────────────────
0 0 1 │ 1 0 │ 1 1 0 0
0 1 0 │ 0 │
0 1 1 │ 0 1 │ 1 0 0 1
1 0 0 │ 1
1 0 1 │ 0 Groups:
1 1 0 │ 0 ┌──────────┐ A=0, B=0 → B'
1 1 1 │ 1 │ 1 1 │ eliminates C
└──────────┘ → term: A'B'
┌──┐ ┌──┐
│1 │ │ 1│ A=0,C=0 + A=1,C=0
└──┘ └──┘ → term: C' ... etc
Simplified: F = A'B' + A'C' + AB C (fewer gates than SOP from truth table!)
DE MORGAN'S — the most useful identity:
(AB)' = A' + B' ← NAND = OR of NOTs
(A+B)' = A' · B' ← NOR = AND of NOTsCODE