Source
Adapted from my own handwritten and hand-typed notes from Year 1 to Year 3 of my EEE degree
Idea
A Karnaugh map (K-map) is a grid of squares where each square is one minterm of the function. The rows and columns are labelled in Gray code order (00, 01, 11, 10), so any two neighbouring squares differ in exactly one variable. Neighbouring 1s then share a common factor and that variable drops out:
Layouts
| Variables | Squares | Row / column labels |
|---|---|---|
| 2 () | 4 | = 0,1 by = 0,1 |
| 3 () | 8 | = 00,01,11,10 by = 0,1 |
| 4 () | 16 | = 00,01,11,10 by = 00,01,11,10 |
4-variable minterm positions (columns , rows ):
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | ||||
| 01 | ||||
| 11 | ||||
| 10 |
The map can be filled straight from a truth table: one square per row, 1 where , 0 (or blank) otherwise.
Grouping Rules
Rules to cover a map:
- cover all 1 squares with the minimum number of groups
- group only adjacent squares in blocks of (1, 2, 4, 8 or 16), never 3, 5, 6 or 7
- make each group as large as possible, which gives a prime implicant
- edges wrap around, so the first and last columns (and first and last rows) are adjacent, and the four corners of a 4-variable map form one group
Reading a group: keep only the variables that stay constant across the whole group. A group of squares removes variables.
Worked Example
:
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 |
- : , , changes, giving
- : , , changes, giving
4-variable example, where the four corners combine into :

Product of Sums From a K-Map
Grouping the 0 squares gives in SOP form, and DeMorgan turns it into a POS for . Directly: for each group of 0s write a sum term where a variable that is 0 in the group appears uncomplemented and a variable that is 1 appears complemented.
Example: 0s at give , so .

XOR, XNOR and Odd/Even Functions
XOR and XNOR give a checkerboard pattern with no adjacent 1s, so they cannot be simplified on a K-map:
Odd and even functions:
- is 1 when an odd number of inputs are 1, so XOR is the odd function
- XNOR is 1 when an even number of inputs are 1, so it is the even function
Choosing which groups are really needed is covered in Prime and Essential Prime Implicants.