16.1

Boolean Algebra & Logic

Explore truth tables, Karnaugh maps, and boolean expression minimization. Build boolean functions interactively, watch optimal groupings form, and see step-by-step simplification using algebraic laws.

Math Foundations for CS
Scenarios:
Variables:
Karnaugh Map3-variable
BC
0
1
A
00
01
11
10
Variables3
Minterms5
Groups0/2
Steps0
Truth Table3 variables, 8 rows
#ABCF
m0000
m1001
m2010
m3011
m4100
m5101
m6110
m7111
Expressions
Sum of Products (SOP)
F = A'B'C + A'BC + AB'C + ABC' + ABC
Boolean Laws
IdentityA + 0 = A, A . 1 = A
NullA + 1 = 1, A . 0 = 0
ComplementA + A' = 1, A . A' = 0
IdempotentA + A = A, A . A = A
AbsorptionA + AB = A
De Morgan(AB)' = A'+B'
ConsensusAB + A'C + BC = AB + A'C
K-Map Grouping Rules
  • Groups must be powers of 2 (1, 2, 4, 8)
  • Groups must be rectangular
  • Groups can wrap around edges
  • Larger groups = simpler terms
  • Every 1-cell must be in at least one group
  • Overlapping groups are allowed
InteractiveClick any output cell in the truth table or K-map to toggle between 0 and 1. The boolean expression and K-map groupings will update automatically.
1.0x
Understanding Boolean Algebra

Why Boolean Minimization Matters

Every digital circuit implements a boolean function. Minimizing the boolean expression directly reduces the number of logic gates needed, resulting in smaller, faster, and more power-efficient circuits. This optimization is fundamental to chip design, from simple microcontrollers to modern CPUs.

Approaches to Minimization

AlgebraicApply boolean algebra laws step by step. Good for learning, but can miss optimal solutions.
Karnaugh MapsVisual method for up to 4-6 variables. Group adjacent 1-cells to find minimal product terms.
Quine-McCluskeyAlgorithmic method for any number of variables. Guaranteed optimal but computationally expensive.
Key InsightIn a Karnaugh map, adjacent cells differ by exactly one variable (Gray code ordering). When two adjacent cells are both 1, the differing variable can be eliminated from the product term. This is why larger groups yield simpler expressions: a group of 4 cells in a 3-variable K-map eliminates 2 variables, leaving just 1 variable in the term. This visual insight is exactly what the algebraic Consensus theorem captures formally.

Key Concepts

ConceptDescriptionExample
MintermProduct term where all variables appearABC' (m5)
MaxtermSum term where all variables appearA+B+C' (M2)
SOPSum of Products canonical formAB + A'C + BC
POSProduct of Sums canonical form(A+B)(A'+C)
Don't CareOutput undefined for some inputsX in truth table
Prime ImplicantLargest possible group in K-mapGroup of 4 cells