EE122 Digtial Logic Desgin
TOPICS: : K-MAPS - SIMPLIFICATION OF EXPRESSIONS
WEEK: 6
LECTURE: 1 OVERALL LECTURE NO. 11
LEVEL: 2 ND SEMESTER
PROGRAM: BE ELECTRICAL ENGINEERING
COURSE TEACHER: DR. JAVED IQBAL ( javed.ee@suit.edu.pk )
ACCESS AT: portal.suit.edu.pk
Electrical Engineering Department, SUIT Peshawar
Slide 1
Today’s Lecture
Simplification of SOP expressions using K-map
Mapping directly from truth tables or table functions
Don’t care conditions
Slide 3 3
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
Slide 4 4
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
Notice the “wrap around” 4-cell group that includes the top row and the bottom row of 1s. The
remaining 1 is absorbed in an overlapping group of two cells. The group of four 1s produces a
single variable term, B*. This is determined by observing that within the group, B* is the only
variable that does not change from cell to cell. The group of two 1s produces a 2-variable term
A*C. This is determined by observing that within the group, A* and C do not change from one cell
to the next. The product term for each group is shown. The resulting minimum SOP expression is
B *+ A*C
Keep in mind that this minimum expression is equivalent to the original standard expression.
Simplification of SOP expressions using K-
map
B .C A .C B .C
0 1
AB\C
A\BC 00 01 11 10
00 0 1
0 0 1 1 1
01 1 0
1 1 0 0 0
11 1 1
10 0 1 A .B .C A .C A .B
Slide 5 5
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider the 3-variable column based K-map in which the SOP expression has been mapped.
•The SOP expression has 5 minterms marked by 1s in the K-map.
•Three groups of two cells each are formed.
•The first group of 1s comprising of cells 2 and 6 forms the product term BC*
•The second group of 1s comprising of cells 5 and 7 forms the product term AC
•The third group of 1s comprising of cells 1 and 5 forms the product term B*C
•The five term SOP expression simplifies to a 3 term SOP expression
•Consider the 3-variable row based K-map in which the SOP expression has been mapped.
•The SOP expression has 4 minterms marked as 1s in the K-map.
•Two groups of 2 cells each and a third group of single cell are formed.
•The single cell group comprising of cell 4 forms the product term AB*C*
•The second group of 1s comprising of cells 1 and 3 forms the product term A*C
•The third group of 1s comprising of cells 2 and 3 forms the product term A*B
•The four term SOP simplifies to a 3 term SOP expression
Simplification of SOP expressions using K-
map
B A .C
0 1
AB\C
A\BC 00 01 11 10
00 0 0
0 0 0 1 1
01 1 1
1 1 1 1 0
11 1 1
10 0 1 A .B B .C A .B
Slide 6 6
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider the 3-variable column based K-map
•Two groups of four cells and two cells each are formed respectively.
•The first group of 1s comprising of cells 2, 3, 6 and 7 forms the product term B
•The second group of 1s comprising of cells 5 and 7 forms the product term AC
•Consider the 3-variable row based K-map.
•Three groups of 2 cells each are formed.
•The first group of 1s comprising of cell 4 and 5 forms the product term AB*
•The second group of 1s comprising of cells 3 and 7 forms the product term BC
•The third group of 1s comprising of cells 2 and 3 forms the product term A*B
Simplification of SOP expressions using K-
map
A .C B .D B .C
AB\CD 00 01 11 10
00 0 1 1 0
01 0 0 1 1
11 1 1 1 1
10 1 1 1 0
Slide 7 7
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider a 12 term SOP expression mapped on a 4-variable K-map.
•Three groups of four cells are formed.
•The first group of 1s comprising of cells 8, 9, 12 and 13 forms the product term AC*
•The second group of 1s comprising of cells 1, 3, 9 and 11 forms the product term B*D
•The third group of 1s comprising of cells 6, 7, 14 and 15 forms the product term BC
•The SOP expression has simplified to a 3 term expression.
Simplification of SOP expressions using K-
map
A .C .D C .D B .C
AB\CD 00 01 11 10
00 0 0 1 0
01 0 0 1 1
11 1 0 1 1
10 1 0 1 0
Slide 8
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK 8
•Consider a 8 term SOP expression mapped to a 4 variable K-map.
•One group of two cells and two groups of four cells are formed.
•The first group of 1s comprising of cells 8 and 12 forms the product term AC*D*
•The second group of 1s comprising of cells 3, 7, 11 and 15 forms the product term CD
•The third group of 1s comprising of cells 6, 7, 14 and 15 forms the product term BC
•The SOP expression has simplified to a 3 term SOP expression.
Simplification of SOP expressions using K-
map
B .D B .C A .B .D A .C .D
AB\CD 00 01 11 10
00 1 0 1 1
01 0 0 0 1
11 0 1 1 0
10 1 0 1 1
Slide 9 9
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider the 9 term SOP expression mapped to a 4-variable K-map.
•Two group of two cells and two groups of four cells are formed.
•The first group of 1s comprising of corner cells 0, 2, 8 and 10 forms the product term B*D*
•The second group of 1s comprising of cells 2, 3, 10 and 11 forms the product term B*C
•The third group of 1s comprising of cells 13 and 15 forms the product term ABD
•The fourth group of 1s comprising of cells 2 and 6 forms the product term A*CD*
•The SOP expression has simplified to a 4 term SOP expression.
Mapping Directly from Function Table
Function of a logic circuit
defined by function table
Function can be directly
mapped to K-map
Slide 10 10
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
You have seen how to map a Boolean expression; now you will learn how to go directly from a
truth table to a Karnaugh map. Recall that a truth table gives the output of a Boolean expression
for all possible input variable combinations. An example of a Boolean expression and its truth
table representation is shown in Figure. Notice in the truth table that the output X is 1 for four
different input variable combinations. The 1s in the output column of the truth table are mapped
directly onto a Karnaugh map into the cells corresponding to the values of the associated input
variable combinations, as shown in Figure. In the figure you can see that the Boolean expression,
the truth table, and the K-map are simply different ways to represent a logic function.
Mapping Directly from Function Table
Inputs Output Inputs Output
A B C D F A B C D F
0 0 0 0 0 1 0 0 0 0
0 0 0 1 1 1 0 0 1 0
0 0 1 0 0 1 0 1 0 0
0 0 1 1 1 1 0 1 1 1
0 1 0 0 0 1 1 0 0 0
0 1 0 1 1 1 1 0 1 1
0 1 1 0 0 1 1 1 0 0
0 1 1 1 1 1 1 1 1 0
Slide 11 11
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider a logical circuit that accepts 4-bit binary numbers representing decimal numbers 0 to
15.
•The circuit checks the four bit binary equivalent of the decimal number.
•If the number is odd and it is a prime number the function outputs a one.
•Before designing the logic circuit a function table is implemented with all the input output
combinations.
•The function table for the odd prime number checker is shown.
•The output is a 1 for inputs 1, 3, 5, 7, 11 and 13.
Mapping Directly from Function Table
A .D B .C .D B .C .D
AB\CD 00 01 11 10
00 0 1 1 0
01 0 1 1 0
11 0 1 0 0
10 0 0 1 0
Slide 12 12
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•The 4-variable function table is directly mapped to a 4-variable K-map’
•Each of the 16 minterm values in the function table are mapped to the corresponding minterm
cells of the K-map.
•Simplifying using the K-map gives 3 product terms which can be directly implemented using
logic gates to form a odd prime number checker circuit.
Don’t care Conditions
Some input combinations never occur
Outputs are assumed to be don’t care
Don’t care outputs used as 0 or 1 during simplification.
Results in simpler and shorter expressions
Slide 13 13
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
“Don’t Care” Conditions
Sometimes a situation arises in which some input variable combinations are not allowed.
For example, recall that in the BCD code, there are six invalid combinations: 1010, 1011, 1100,
1101, 1110, and 1111. Since these unallowed states will never occur in an application involving
the BCD code, they can be treated as “don’tcare” terms with respect to their effect on the output.
That is, for these “don’t care” terms either a 1 or a 0 may be assigned to the output; it really does
not matter since they will never occur.
The “don’t care” terms can be used to advantage on the Karnaugh map. For each “don’t care”
term, an X is placed in the cell. When grouping the 1s, the
Xs can be treated as 1s to make a larger grouping or as 0s if they cannot be used to advantage.
The larger a group, the simpler the resulting term will be.
Don’t Care Conditions
Inputs Output Inputs Output
A B C D F A B C D F
0 0 0 0 0 1 0 0 0 0
0 0 0 1 1 1 0 0 1 0
0 0 1 0 0 1 0 1 0 X
0 0 1 1 1 1 0 1 1 X
0 1 0 0 0 1 1 0 0 X
0 1 0 1 1 1 1 0 1 X
0 1 1 0 0 1 1 1 0 X
0 1 1 1 1 1 1 1 1 X
Slide 14 14
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Consider the number checker circuit that only checks for the odd prime numbers between 0
and 9
•To modify the operation of the number checker circuit the function table is modified to show
don’t care output states for the inputs 10 to 15.
Don’t Care Conditions
A .D
AB\CD 00 01 11 10
00 0 1 1 0
01 0 1 1 0
11 x x x x
10 0 0 x x
Slide 15 15
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•The 4-variable function table is directly mapped to a 4-variable K-map’
•Each of the 16 minterm values in the function table are mapped to the corresponding minterm
cells of the K-map, including the don’t care states.
•In this particular case all the don’t care states are assumed to be 0s. The K-map simplification
leads to the expression A*D.
•Assuming that the circuit checks for odd prime numbers for the first 9 numbers ranging from 0
to 8, the remaining combinations never occur.
•The function table is modified to include a don’t care state for the input combination 1001.
•Mapping the function table to a 4-variable K-map leads to 7 cells having don’t care state.
•The cells
•Simplifying using the K-map gives 3 product terms which can be directly implemented using logic
gates to form a odd prime number checker circuit.
Don’t Care Conditions
D
AB\CD 00 01 11 10
00 0 1 1 0
01 0 1 1 0
11 x x x x
10 0 x x x
Slide 16 16
DR. JAVED IQBAL (SUIT PESHAWAR) JAVED.EE@SUIT.EDU.PK
•Assuming that the circuit checks for odd prime numbers for the first 9 numbers ranging from 0
to 8, the remaining combinations never occur.
•The function table is modified to include a don’t care state for the input combination 1001.
•Mapping the function table to a 4-variable K-map leads to 7 cells having don’t care state.
•The 4 cells 9, 11, 13 and 15 marked with x indicate the don’t care state are assumed to be 1s.
•Forming a group of 8 adjacent cells comprising cells 1, 3, 5, 7, 9, 11, 13 and 15 result in the
simplest expression D
END OF LECTURE