A 4-variable K-map has 2⁴ = 16 cells in a 4×4 grid. Rows are AB and columns are CD, both in gray code order:
- AB = 00:
m0m1m3m2 - AB = 01:
m4m5m7m6 - AB = 11:
m12m13m15m14 - AB = 10:
m8m9m11m10
Compared with counting order, the last two rows and the last two columns are swapped. To place a minterm, write it as 4 bits: the first two pick the row and the last two pick the column. m10 = 1010 is in the bottom row (AB = 10) and the last column (CD = 10).
The map wraps both ways: left touches right, and top touches bottom. So every cell has exactly four neighbors, one for each variable you could flip.
Group sizes and term lengths:
- 1 cell → 4 literals
- 2 cells → 3 literals
- 4 cells → 2 literals
- 8 cells → 1 literal
- 16 cells → the constant 1
This is the largest map most courses ask you to solve by hand, and it holds every trick: wraps, the four-corner group, overlaps and don't-cares.
| AB\CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0m0 | 0m1 | 0m3 | 1m2 |
| 01 | 0m4 | 1m5 | 0m7 | 1m6 |
| 11 | 0m12 | 1m13 | 0m15 | 1m14 |
| 10 | 0m8 | 0m9 | 0m11 | 1m10 |