Karnaugh Map — Definition & Example
A Karnaugh map (K-map) is a grid that shows a Boolean function's truth table. You simplify the function by circling blocks of neighboring 1s.
For a Boolean function of variables, a Karnaugh map is a grid of cells. Its rows and columns are labeled in Gray-code order, so any two cells that share an edge differ in exactly one variable. This includes cells that touch by wrapping around the grid's opposite edges. A rectangular group of adjacent 1-cells stands for one product term with fewer variables, because . Covering every 1 with the fewest, largest groups gives a minimal sum-of-products expression.
Worked Example
Problem: Simplify , meaning exactly when is or .
Step 1: With 3 variables, the map has cells. Use for the rows and for the columns. Put the columns in Gray-code order (00, 01, 11, 10), not binary order. Then place a 1 in each listed minterm's cell.
Step 2: Circle the 2-by-2 block in columns 01 and 11. Across that block, and both change, but stays fixed. A group of 4 cells removes variables, so the block reduces to . Next, circle the pair in row , columns 11 and 10. Only changes there, so the pair gives . Cell 111 sits in both groups. Overlapping groups are allowed.
Step 3: Write one product term for each group, then OR the terms together.
Answer: . This needs one AND gate and one OR gate, while the original expression needs five 3-input AND terms.
Why It Matters
In a digital logic or computer architecture course, you use K-maps to design circuits with fewer gates. Fewer gates make a circuit cheaper, faster, and less power-hungry. K-maps work well for up to about 4 variables. Larger problems are handled by software, using exact methods such as Quine–McCluskey or faster heuristics such as Espresso.
Common Mistakes
Mistake: Labeling the columns in binary order (00, 01, 10, 11).
Correction: In binary order, the cells for 01 and 10 sit next to each other but differ in two variables, so a group across them is invalid. Use Gray-code order (00, 01, 11, 10). Then neighboring cells, including those that wrap around the edges, differ in exactly one variable.
