Karnaugh maps also help teach about Boolean functions and minimization.
Consider the following function:
This function has this truth table:
A B C D f 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1.
The input variables can be combined in 16 different ways, therefore our Karnaugh map has to have 16 positions. The most convenient way to arrange this is in a 4x4 Karnaugh map.
The binary digits in the map represents the functions output at any given combination of inputs. We write down 0 in the upper leftmost corner of the map because f = 0 when A = 0, B = 0, C = 1, D = 0. Similarly we mark the bottom right corner as 1 because A = 1, B = 0, C = 0, D = 0 gives f = 1.
After the Karnaugh map has been constructed our next task is to find the minimal terms to use in the final expression. These terms are found by encircling the the 1's in the map. The encirclings can only encompass 2^{n} fields, where n is an integer ≥ 0 (1, 2, 4, 8...). They should be as large as possible. The optimal encirclings in this map is marked by the green, red and blue encirclings.
For each of these encirclings we find those variables that has the same state in each of the fields in the encircling. For the first encircling (the red one) we find that:
The first term becomes AC.
For the green encircling we see that A and B maintains the same state, C and D changes. But B is 0 and has to be negated before it can be included.
The second term becomes AB'.
By working the blue encircling the same way we find the term BC'D' and our final expression for the function is ready: AC + AB' + BC'D'.
The inverse of a function is solved in the same way by encircling the 0's instead.
Worth mentioning is that the number of product terms for an encircling P is:
where n is the number of variables in the Karnaugh map and x the number of fields encircled.
Search Encyclopedia

Featured Article
