K Maps
K Maps
The number of inputs defines how the empty Karnaugh map should be
drawn. For two variables, A and B, there are four possible states. A two-
variable Karnaugh map therefore has four cells as shown in Fig. 23.22. These
four cells are the equivalent of a truth table (Table 23.7), where the input
0 1
0
2 3
1
variables of the function are given on the outside of the table (A and B for
this case), and the result of the function is given in the appropriate cell of the
Karnaugh map. The small numbers in the top left corner of each cell show
the binary code for that cell. Sometimes you will be given inputs in terms
of the binary code. The input on the left (in this case B) is used as the most
significant bit when calculating the binary code. Where binary numbers have
A as the least significant bit and B, C and D rising powers of 2 it is easier to
enter variables into a Karnaugh map if they are set up as shown here with D,
C, B and A going from left to right. However, if you prefer to use A, B, C and
D from left to right you will still get the correct answers; both approaches
are correct and it is a matter of personal preference. It is useful to have the
binary code numbers there as a convenient way of referring to each cell. Each
of the cells corresponds to one state from the function’s truth table. Each of
the cells corresponds to one minterm – a minterm is the ANDing of one
combination of all of the inputs of a function.
The appropriate output of the function to be simplified can then be entered
in each cell. Karnaugh maps for three (Fig. 23.23) and four (Fig. 23.24) varia-
bles have 8 and 16 cells respectively. For five or six variables, three-dimensional
maps or map-entered variables have to be used.
0 1
00
2 3
01
6 7
11
10 4 5
BA
C 00 01 11 10
0 1 3 2
0
4 5 7 6
1
chapter 23 Digital Systems 545
0 1 3 2
00
4 5 7 6
01
12 13 15 14
11
8 9 11 10
10
Each cell of the Karnaugh map is filled with a 1 or a 0 signifying the output
for that cell. The information supplied enabling you to fill in the 1s and 0s
for the output in the Karnaugh map could be supplied in various formats.
For example:
• by specifying the binary numbers that correspond to an output of 1;
• from a logic expression;
• from a truth table;
• squares containing logic 0 terms may be left blank.
The output information may be supplied by giving the binary cell numbers
for an output of 1 and stating what the input variables are.
Example 23.6 Fill out the Karnaugh map given G = 1, 2, 3 with input variables BA.
First look at what the question tells us. G is the name for the output in
this case. We are told that there are two inputs, B and A. This specifies the
form of the Karnaugh map, shown in Fig. 23.22. The binary cell numbers
have been shown. Make sure you understand how to get these numbers; they
come from the input variables A and B in this case.
The numbers in the statement G = 1, 2, 3 tell us where in the Karnaugh
map logical 1s occur. If we fill in 1s in the specified cells (corresponding to
the numbers 012, 102, 112) and 0s in the other cells we get the Karnaugh map
shown in Fig. 23.25. You may have noticed that this is the Karnaugh map for
the OR function.
546 section 2 ELECTRONIC ENGINEERING
2 3
1 1 1
Example 23.7 Fill out the Karnaugh map given F = 0, 5, 6, 8, 12, 13 with input
variables DCBA.
What is this problem specification? F is the name for the output in this
case. We are told that there are four inputs, D, C, B and A. This specifies the
form of the Karnaugh map, shown in Fig. 23.24. The binary cell numbers
have been shown. Again, make sure you understand how to get these numbers.
The numbers in the statement F = 0, 5, 6, 8, 12, 13 tell us where in the
Karnaugh map logical 1s occur (by converting the numbers to their binary
form). If we fill in 1s in the specified cells and 0s in the other cells we get the
Karnaugh map shown in Fig. 23.26.
4 5 7 6
01 0 1 0 1
12 13 15 14
11 1 1 0 0
8 9 11 10
10 1 0 0 0
Sometimes the information required to fill out the Karnaugh map will be
given in terms of a logic expression, where the idea of using the Karnaugh
map would be to find a simpler logic expression. When you are given a logic
expression (for instance, F = A # B + A # B + A # B), the expression tells
us what inputs give an output of 1.
When a line is present over an input this means the input is 0; with no
line the input is 1.
chapter 23 Digital Systems 547
Example 23.8 Given the following logic expression create and fill out a Karnaugh
map:
Example 23.9 Given the following logic expression create and fill out a Karnaugh
map:
4 5 7 6
01 1 1 1 1
12 13 15 14
11 0 0 0 1
8 9 11 10
10 1 0 0 1
548 section 2 ELECTRONIC ENGINEERING
Plotting a Karnaugh map from a truth table for a function involves plot-
ting a ‘1’ in the map if a particular minterm is included in the truth table, i.e.
a ‘1’ is plotted for each map square where X = 1.
Example 23.10 Given the truth table for the function G in Table 23.8, fill in the cells
of the Karnaugh map.
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 1
1 1 1 1 0
Considering the inputs in the order DCBA, the truth table is shown again
in Table 23.9 with binary code so that the cells can be matched with the
resulting Karnaugh map shown in Fig. 23.27.
0 0 0 0 0 0
0 0 0 1 1 8
0 0 1 0 1 4
0 0 1 1 0 12
0 1 0 0 0 2
0 1 0 1 1 10
0 1 1 0 1 6
0 1 1 1 1 14
1 0 0 0 1 1
1 0 0 1 0 9
1 0 1 0 1 5
1 0 1 1 0 13
1 1 0 0 1 3
1 1 0 1 0 11
1 1 1 0 1 7
1 1 1 1 0 15
chapter 23 Digital Systems 549
Each cell of a Karnaugh map must have the appropriate output, for the
function being represented, entered into it. When all the values are entered
all of the 1s present must be grouped together according to the following
rules:
• Groups must contain 2n adjacent cells, each containing a 1.
• The groups should be made as large as possible, while remaining integer
powers of 2.
• The groups have to be square or rectangular.
• The larger the groups chosen, the simpler the function, as with each
increase of power of 2 in the size of the group, the group becomes depend-
ent on one less variable. So the minimal form is obtained with the largest
possible groups that are integer power of 2.
• All cells containing a 1 must be included in at least one group.
• The groups may overlap, so one cell may be included in several groups,
but any group that has all its elements included in other groups is not
required.
• There may be several correct minimal forms for a given logic function,
dependent upon the particular groupings that are chosen.
The edges of a Karnaugh map are adjacent to each other because of the
binary code used for labelling the cells. This means that groups can join from
the left side to the right side and from the top to the bottom.
Using these rules the minimal form of a logic expression can be formed.
The inverse of a function can be found using the same method, but grouping
the 0s instead of the 1s.
Example 23.11 Consider the Karnaugh map shown in Fig. 23.17. Illustrate a possible
set of loops.
A typical set of loops can be seen in Fig. 23.28.
4 5 7 6
01 1 1 1 1
12 13 15 14
11 0 0 0 1
8 9 11 10
10 1 0 0 1
550 section 2 ELECTRONIC ENGINEERING
Once the loops have been assigned a logic expression can be created. This is
done one loop at a time. For each loop write down the inputs that describe
that specific loop.
Example 23.12 Consider the loops shown in Fig. 23.28. We will look at generating the
expression.
Consider the four loops one at a time, as shown in Fig. 23.29, and calcu-
late the logic expression for each loop.
4 5 7 6
01 1 1 1 1 Loop 2
12 13 15 14 Loop 3
11 0 0 0 1
8 9 11 10
10 1 0 0 1
Loop 4
23.15 Combinational
and sequential In the previous sections the logic circuits have had the outputs as a function
logic circuits only of the inputs; these are termed combinational logic circuits. If the input
state of a combinational circuit is known, then the output is also wholly
determined.
A sequential logic circuit differs from a combinational logic circuit in that
the outputs depend not only upon the inputs applied to the circuit, but also
on the previous state of the circuit.
For sequential circuits some means is required for defining when the cir-
cuit moves from one state to the next. This is termed timing and is usually
provided by a signal input called a clock. A clock input is usually a square,
rectangular or pulse waveform which provides a regular timing signal to
control when changes occur. Additionally, a sequential logic circuit must
provide some means for storing the previous state of the circuit. This stor-
age element is called a memory or register. Basic memory elements can be
constructed from the basic combinational logic elements already covered
connected together using positive feedback. These sequential logic circuits
are also termed state machines, because they progress from one state to the
next as timed by the clock input.
23.16 Synchronous
and An important distinction is made between synchronous and asynchronous
asynchronous sequential circuits.
sequential circuits A synchronous logic circuit is one in which all the outputs change at the
same time, in step with each other (i.e. they are synchronized). This timing
is usually provided by one edge of the clock signal.