Principles of Karnaugh Maps
A Karnaugh map (K-map) is a graphical method used to minimize Boolean logic functions. Invented by Maurice Karnaugh in 1953, the technique organizes truth table minterms on a two-dimensional grid to identify adjacent terms visually.
This article explains the theoretical foundations of Karnaugh maps, Gray code labeling, toroidal boundary wrap-around, and group reduction rules.
The Minimization Problem
Manual algebraic minimization has three fundamental limitations:
- It requires heuristics to determine the sequence of algebraic transformations.
- It does not scale effectively for functions with more than four variables.
- It does not guarantee that the resulting expression is minimal.
Karnaugh maps resolve these limitations by converting Boolean adjacency into physical geometric adjacency on a structured grid.
Adjacency and Term Combination
Boolean minimization relies on the fundamental adjacency theorem:
$$AB’ + AB = A(B’ + B) = A \cdot 1 = A$$
Two product terms that differ in only one variable combine into a single product term that omits that variable.
A Karnaugh map arranges minterms such that any two adjacent grid cells differ in exactly one binary variable.
Gray Code Coordinate Labeling
Standard binary counting sequences do not preserve single-bit adjacency between successive values. For example, binary values 01 ($1_{10}$) and 10 ($2_{10}$) differ in two bit positions simultaneously.
To maintain single-variable adjacency across all grid cells, Karnaugh maps use Gray code sequences to label rows and columns:
$$00 \to 01 \to 11 \to 10$$
In this sequence, exactly one bit toggles between adjacent coordinates:
- $00 \to 01$: Second bit changes
- $01 \to 11$: First bit changes
- $11 \to 10$: Second bit changes
- $10 \to 00$: First bit changes (wraps around)
Because coordinates follow Gray code order, any two cells sharing a common physical boundary differ in exactly one variable.
Toroidal Boundary Wrap-Around
The final coordinate 10 differs from the initial coordinate 00 in only one bit. Therefore, opposite grid boundaries maintain geometric adjacency:
- The leftmost column is adjacent to the rightmost column.
- The top row is adjacent to the bottom row.
- The four outer corner cells form an adjacent group of four.
The map topology forms a torus. Figure 1 shows the 4-variable minterm layout and boundary wrap-around adjacencies:
Two-Variable K-Map Example
A 2-variable function contains four minterms in a $2 \times 2$ grid. Consider function $F = \sum m(1, 3)$:
The cells at minterm 1 ($A = 0, B = 1$) and minterm 3 ($A = 1, B = 1$) occupy the right column. They form an adjacent group of two cells.
In this group:
- Variable $B$ remains constant at 1.
- Variable $A$ changes from 0 to 1 and drops out.
The group evaluates to the single literal $B$. Therefore, $F = B$.
Algebraic confirmation:
$$F = A’B + AB = B(A’ + A) = B(1) = B$$
Grouping Dimensions and Literal Reduction
Every valid group in a Karnaugh map must form a rectangle containing $2^k$ cells (1, 2, 4, 8, or 16 cells). Each doubling of group size eliminates one variable from the resulting product term.
| Group Size ($2^k$) | Variables Eliminated ($k$) | Resulting Literals per Term ($n - k$) |
|---|---|---|
| 1 | 0 | $n$ literals (Minterm) |
| 2 | 1 | $n - 1$ literals |
| 4 | 2 | $n - 2$ literals |
| 8 | 3 | $n - 3$ literals |
| $2^n$ | $n$ | 0 literals (Function equals constant 1) |
Design Rule: To minimize gate count and input connections, always form the largest possible groups of $2^k$ cells that cover all logic 1 entries.
Systematic Minimization Procedure
Follow this systematic procedure to minimize logic functions using a Karnaugh map:
- Plot logic 1 in each grid cell corresponding to an active minterm from the truth table.
- Identify all valid groups of $2^k$ adjacent cells.
- Select the minimum set of prime implicant groups that covers every logic 1.
- Extract the constant variables for each selected group to form product terms.
- Combine the extracted product terms using logical OR to form the minimal Sum of Products (SOP) expression.
Practice Exercise
Plot the 2-variable Karnaugh map for $F(A,B) = \sum m(0, 1, 2)$, extract the groups, and derive the minimal SOP equation.
View Solution
Figure 3 illustrates the groups on the 2-variable grid:
- Group 1 (Horizontal row covering minterms 0 and 1): Variable $A$ remains constant at 0. Yields term $A’$.
- Group 2 (Vertical column covering minterms 0 and 2): Variable $B$ remains constant at 0. Yields term $B’$.
- Minterm 0 is included in both groups to maximize group dimensions.
Minimal SOP equation:
$$F = A’ + B’$$
Applying De Morgan’s law, this function implements a NAND gate ($\overline{AB}$).