Lab 6 Simplification Using Karnaugh Map
Lab 6 Simplification Using Karnaugh Map
Engineering Faculty
Department of Computer Engineering
Fall 2017
ECOM 2013
Khaleel I. Shaheen
Laboratory Manual
Experiment #6
Theoretical Background
Using K-Maps
The K-map method is a visual technique for simplifying Boolean equations. The K-map itself is
just another way of representing the truth table, and like the truth table, it is also a 2-
dimensional table. The main difference is in the labeling of the columns and rows. The columns
and rows in a K-map are labeled with the input variable names and their two possible constant
values. Since each variable can have either a 0 or a 1, therefore, two columns or two rows are
needed for each variable. The figures below show the setup of a K-map for two, three and four
variables. For the two-variable K-map in Figure (a), we have placed the variable x in the two
rows and the variable y in the two columns. The intersection of each row and column gives us
the unique value for these two variables hence there are the four intersection boxes that
represent the unique combination of the two input variables xy having the values 00, 01, 10
and 11.
a b c
2
Regardless of how many variables the equation has, the K-map for it is still going to be a 2-
dimensional table. Hence, for a three-variable K-map, we need to double up two of the variables
as shown in Figure (b) for the two variables y and z. (It does not matter whether you put it in
the columns or the rows.) Now, each column will have two unique values for yz–00, 01, 10 and
11. Notice, however, that we reversed the label ordering for the third and fourth columns. The
reason is that in order for the K-map to work, the values for every adjacent column or row
must differ in only one bit. So, with this new ordering, 00, 01, 11 and 10, this condition is satisfied.
Notice that this condition is also satisfied between the first and last columns, 00 and 10. Hence,
you need to visualize that the first and last.
For a four-variable K-map, we will have two variables with four combinations for both the
columns and rows as shown in Figure (c). Again, the value labeling for both the third and fourth
columns and rows are reversed.
Examples:
Ex1: Simplify the following equation using K-map.
f = x' y + x y
What we put into the intersection boxes in a K-map are the 1 output values in the equation or
truth table. For example, when we want to minimize the equation in Figure (a), the
corresponding truth table and K-map for this equation are shown in (b) and (c).
Having set up the K-map and added all of the 1 outputs from the truth table into the K-map,
we are ready to minimize the equation using the K-map by forming subcubes. We form subcubes
3
by circling adjacent boxes with 1’s in them. The following rules must be observed when forming
the subcubes.
1. All of the 1-boxes must be physically adjacent to each other except for the two ends.
For the two end boxes (such as those in a three- and four-variable K-maps), visualize
them as also being adjacent to each other because they also differ in only one bit (from
00 to 10).
2. The size of the subcube (i.e., the number of 1-boxes inside the subcube) must be a power
of two. So, you can only have 1, 2, 4, 8, etc. number of 1-boxes inside a subcube.
3. The shape of a subcube must be a rectangle either horizontally or vertically.
4. All of the 1-boxes in a K-map must be inside a subcube, but the same 1-box can be
inside one or more subcubes.
5. The size of each subcube should be made as large as possible.
Forming subcubes is like trying to figure out a puzzle where you want to have as few subcubes
as possible, and each subcube to be as large as possible.
4
The figure below shows some invalid subcubes.
Having formed the subcubes for covering all of the 1’s in the K-map, the final step is to write
up the reduced equation. Each subcube becomes one AND term in the equation, and all of the
AND terms will be ORed together to produce the final simplified equation. For each subcube,
write down the variable(s) having the same value for all of the 1-boxes in that subcube. If the
value is a 0 then negate the variable, and if the value is a 1 then just leave the variable as is.
All of the variables obtained from the same subcube are ANDed together to form one AND
term.
The figure below shows the simplified equations as obtained from the K-maps.
5
Ex2: Simplify the following truth table to get the minimum sum-of-products.
A B C F
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
F = A'B + AC'
6
Ex3: Simplify the following Boolean expression to minimum number of terms.
YZ 00 01 11 10
WX
00 0 1 1 1
01 0 1 1 0
11 0 1 1 0
10 0 1 1 1
F = Z + X' Y
1. From the specifications of the circuit, determine the required number of inputs and
outputs and assign a symbol to each.
2. Derive the truth table that defines the required relationship between inputs and outputs.
3. Use K-map to obtain the simplified Boolean functions for each output as a function of
the input variables.
4. Draw the logic diagram and verify the correctness of the design.
Examples:
Ex1: Design a combinational circuit with 3 inputs and 1 output. The output is 1 when the binary
value is less than 3.
7
Ex2: Design a combinational circuit that converts from BCD to 7-Segment.
8
Lab Work
Equipment’s required:
Implementation
9
Exercises
Good Luck
10