Skip to content
BetterDL

Filling a K-map

Also called: plotting a K-map, K-map plotting, filling in a K-map, mapping a function onto a K-map

Putting a function's 1s, 0s and don't-cares into the right K-map cells, from a truth table, a minterm list or a Boolean expression.

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\CD00011110
00
0m0
0m1
0m3
1m2
01
1m4
1m5
1m7
1m6
11
0m12
0m13
0m15
1m14
10
0m8
0m9
0m11
1m10

Worked examples

Example

Filling from an expression

Fill a 4-variable map for F = , as shown above.

  1. 1.

    : A = 0 and B = 1, with C and D free. That is the whole row AB = 01: m4, m5, m7, m6.

  2. 2.

    : C = 1 and D = 0, with A and B free. That is the whole column CD = 10: m2, m6, m14, m10.

  3. 3.

    m6 is covered by both terms. It is still a single 1.

  4. 4.

    F = Σm(2, 4, 5, 6, 7, 10, 14): seven 1s.

Example

Filling from a maxterm list

Fill a 3-variable map for F = ΠM(0, 3, 5).

A\BC00011110
0
0m0
1m1
0m3
1m2
1
1m4
0m5
1m7
1m6
  1. 1.

    The listed numbers are where F = 0: m0, m3, m5.

  2. 2.

    Every other cell is 1: m1, m2, m4, m6, m7.

  3. 3.

    So F = Σm(1, 2, 4, 6, 7). Five 1s and three 0s make 8 cells. ✓

Common mistakes

  • Finding cells by counting along the grid instead of using each minterm's binary code.

  • Treating a ΠM list as the 1s. Maxterm numbers mark the 0s.

  • Marking only one cell for a product term that is missing a variable. A term with k missing variables covers 2ᵏ cells.

Practice Filling a K-map

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Filling a K-map is taught in Karnaugh Maps.