A Karnaugh map (K-map) is a truth table redrawn as a grid so that simplification becomes a visual search for rectangles.
Each cell is one input combination, one minterm. You write 1 in the cells where the function is 1. The trick is the ordering: rows and columns are labeled in gray code (00, 01, 11, 10), so any two cells that touch differ in exactly one variable.
Why that helps: two terms that differ in one variable combine, as in = . This is the combining rule. In a truth table such pairs can be far apart. On a K-map they sit side by side, and you can see them.
The method in brief:
- Fill the map with the function's 1s (and any don't-care X's).
- Circle groups: rectangles of 1, 2, 4, 8 or 16 cells containing only 1s and X's. Edges wrap around.
- Choose the fewest, largest groups that cover every 1, starting with the essential prime implicants.
- Read each group as one product term and OR them together.
The result is a minimal sum of products. Grouping the 0s instead gives a minimal product of sums.
K-maps work best for 2 to 4 variables. Five or six variables need stacked maps, and beyond that, software takes over using the same ideas.
| A\BC | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0m0 | 0m1 | 1m3 | 0m2 |
| 1 | 1m4 | 1m5 | 1m7 | 0m6 |