Professional Documents
Culture Documents
3 KARNAUGH MAPS
1
Logic Minimization with Karnaugh Maps (KMaps)
Boolean algebra can be used to find minimal SOP (POS) logic equations, but it
is hard to automate and not very systematic.
For small logic functions (<=5 inputs), we can use Karnaugh Map (KMap).
KMaps allow us to minimize functions graphically.
A KMap contains all the same information as a truth table, but in a different
form:
– While a truth table is “tabular”, the KMap is arranged as a grid of squares.
– The “coordinates” of a square depend on values of the inputs;
– The contents of any square is 0 or 1 and is the function’s output for the
corresponding input.
– In labeling the rows and columns of a KMap, it is important that only 1
variable changes between adjacent rows and columns (i.e., the rows and
columns are labeled with grey code counting).
We will use examples to both illustrate KMaps and to see how they help us
minimize logic equations.
• Consider presenting the information in the truth table via a 2-D matrix such that all the
same information is presented!
• Notice: in the first column (where x1 = 0), the function must output a logical 1. Further,
note that the value of x2 does not matter (it can be 0 or 1).
• Similar situation for the second row (where x2 = 1 and the value of x1 does not matter).
• Each of these rectangles represents a product term for the logic function f. We need to
“cover” all of the “1”s of the function so we can write a SOP using product terms.
• Example 2:
• Enclosing larger squares are better, as it implies fewer literals and product
terms.
x1x2
x1x2 x1x2
x3x4 00 01 11 10
x3x4 00 01 11 10 x3x4 00 01 11 10
00
x5=0
00 1 0 0 1 00 1 0 0 1 01
m0 m8 m24 m16 m1 m9 m25 m17
11
x1x2
01 0 1 1 0 01 0 1 1 0
m2 m10 m26 m18 m3 m11 m27 m19 10 x3x4 00 01 11 10
11 0 1 1 0 11 0 1 1 1 00
m6 m14 m30 m22 m7 m15 m31 m23 x5=1
01
10 0 1 0 0 10 0 1 0 1
m4 m12 m28 m20 m5 m13 m29 m21 11
10
x5=0 x5=1
• A different way to think of enclosing the “0”s is that you are finding an SOP for !f, and
then taking the complement for get a POS expression for f.