A truth table lists every input combination, but it does not show at a glance how an expression can be shortened. A Karnaugh map, called a K-map, rearranges the same information in a grid so that neighbouring cells differ in only one variable. Groups of adjacent 1s then reveal a shorter expression directly.

Minterms and the Map Layout

A minterm is a product term that contains every variable once, either complemented or not, and equals 1 for exactly one input combination. For three variables the minterm for A = 1, B = 0, C = 1 is A·B'·C, numbered m5 from the binary value 101. A function can be written as a sum of minterms, for example F = Σm(1, 3, 5).

Definition: Karnaugh map. A two-dimensional arrangement of the truth table of a function in which adjacent cells differ in exactly one variable, used to simplify the function.

Two, Three and Four Variable Maps

A two-variable map has four cells. A three-variable map has eight cells arranged in two rows and four columns. A four-variable map has sixteen cells in a four by four grid. The row and column labels follow the Gray code order 00, 01, 11, 10, so that only one bit changes between neighbours. The first and last columns, and the first and last rows, are also neighbours.

From a Truth Table to a K-Map

Each row of the truth table is copied into the map cell with the same minterm number. A 1 in the output column becomes a 1 in that cell and the remaining cells hold 0. Table 1.5 gives the number of cells for each size.

Table 1.5: Size of a K-map

Variables Cells Minterm numbers
2 4 0 to 3
3 8 0 to 7
4 16 0 to 15

Example 1.4: Plotting a function on a K-map

Problem: A function F(A, B, C) is 1 for the input combinations 001, 011, 100, 101 and 111. Plot it on a K-map.

Solution:

  1. Convert the combinations to minterm numbers: 1, 3, 4, 5 and 7.
  2. Mark 1 in cells m1, m3, m4, m5 and m7 of the three-variable map and 0 in m0, m2 and m6.
  3. The map reads: row A = 0 has 0, 1, 1, 0 in the columns 00, 01, 11, 10; row A = 1 has 1, 1, 1, 0.

Result: F = Σm(1, 3, 4, 5, 7).

Common mistakes

  • Labelling the columns 00, 01, 10, 11. The order must be 00, 01, 11, 10.
  • Forgetting that the first and last columns are adjacent.
  • Placing minterms in the wrong cell by reading the binary number backwards.

Key takeaways

  • A minterm equals 1 for exactly one input combination.
  • K-map labels follow the order 00, 01, 11, 10.
  • Cells at opposite edges of the map are neighbours.
  • A map of n variables has 2 to the power n cells.

Practice questions

  1. How many cells does a four-variable K-map have?
  2. Why are the labels written in the order 00, 01, 11, 10?
  3. Which minterm number belongs to A = 1, B = 1, C = 0?

Answers to the practice questions

  1. Sixteen.
  2. So that only one bit changes between adjacent cells.
  3. m6, because 110 in binary is 6.

Sources

  • Official BCA syllabus Computer Architecture, course code 25BCA401DS02, Unit I