Before you can group anything, the map has to hold the function. Filling a K-map means marking each cell 1, 0 or X.
From a truth table or Σm list. Each row where F = 1 is a minterm. Write its number in binary, use the leading bits for the row and the rest for the column, and put a 1 there. Every other cell is 0.
From a ΠM list. The numbers listed are the maxterms, the rows where F = 0. Put 0s in those cells and 1s everywhere else. See product of maxterms.
From an expression. Each product term covers a whole block of cells: every cell where its literals hold, whatever the missing variables are. fixes A = 1 and C = 0 and leaves B free, so in a 3-variable map it marks m4 and m6. Mark every term's block; a cell covered twice is still just 1.
Don't-cares. Mark the cells listed in d(…) with X. See dont care condition.
A quick check when you finish: the number of 1s on the map should match the number of minterms in the list, or the number of 1-rows in the truth table.
| AB\CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0m0 | 0m1 | 0m3 | 1m2 |
| 01 | 1m4 | 1m5 | 1m7 | 1m6 |
| 11 | 0m12 | 0m13 | 0m15 | 1m14 |
| 10 | 0m8 | 0m9 | 0m11 | 1m10 |