You are on page 1of 29

Optimization of Digital

Systems using
Karnaugh-Maps
Karnaugh Maps (K-Maps)
 A Karnaugh map is a graphical representation of the logic
system.
 It can be drawn directly from either minterm (sum-of-
products) or maxterm (product-of-sums) Boolean
expressions.
 Drawing a K-map from the truth table involves an additional
step of writing the minterm or maxterm expression
depending upon whether it is desired to have a minimized
sum-of-products or a minimized product of sums
expression.
Karnaugh Maps (K-Maps)

 An n-variable K-map has 2n squares, and each possible


input is allotted a square.
 In the case of a minterm, ‘1’ is placed in all those
squares for which the output is ‘1’, and ‘0’ is placed in all
those squares for which the output is ‘0’.
 0s are omitted for simplicity.

 An ‘X’ is placed in squares corresponding to “don’t care”


conditions.
K-Maps
Y 0 1 YZ 00
X 0 1 X 01 11 10
0 1 3 2
0 0
2 3 4 5 7 6
1 1
2 Variable K-map 3 Variable K-map
YZ
wx 00 01 11 10
00 0 1 3 2

01 4 5 7 6
4 Variable K-map
12 13 15 14
11
8 9 11 10
10
Representation of Sum of Minterms in K-Maps
Y 0 1 YZ 00 01 11 10
X 0 1 X 0 1 3 2
0 X’Y’ X’Y 0 X’Y’Z’ X’Y’Z X’YZ X’YZ’
2 3 4 5 7 6

1 XY’ XY 1 XY’Z’ XY’Z XYZ XYZ’

YZ
wx 00
0
01
1
11
3 2
10
00 W’X’Y’Z’W’X’Y’Z W’X’YZ W’X’YZ’
4
01 W’XY’Z’ 5
W’XY’Z
7
W’XYZ W’XYZ’
6

12 13 15 14
11 WXY’Z’ WXY’Z WXYZ WXYZ’
8 9 11 10
10 WX’Y’Z’ WX’Y’Z WX’YZ WX’YZ’
Representation of Product of Maxterms in K-
Maps
Y 0 1 YZ 00 01 11 10
X 0 1 X 0 1 3 2
0 X+Y X+Y’ 0 X+Y+Z X+Y+Z’ X+Y’+Z’ X+Y’+Z

2 3 4 5 7 6

1 X’+Y X’+Y’ 1 X’+Y+Z X’+Y+Z’ X’+Y’+Z’ X’+Y’+Z

YZ
wx 00 01 11 10
0 1 3 2
00 W+X+Y+Z W+X+Y+Z’ W+X+Y’+Z’ W+X+Y’+Z

4 6
01 5 7
W+X’+Y+ZW+X’+Y+Z’W+X’+Y’+Z’ W+X’+Y’+Z

12 13 15 14
11 W’+X’+Y+Z W’+X+Y+Z’W’+X’+Y’+Z’W’+X’+Y’+Z

8 9 11 10
10 W’+X+Y+Z W’+X+Y+Z’W’+X+Y’+Z’ W’+X+Y’+Z
Representation of Truth table on 2-Variable
K-Map
Truth-table to K-map

X Y Z
Y 0 1
X (0,0) (0,1)
minterm 0  0 0 1
0 1 0
minterm 1  0 1 0 (1,0) (1,1)
1 0 1 1
minterm 2  1 1
1 1 1
minterm 3 
Y 0 1
X m (0,0) m (0,1)
0 1
0 1

0 x’y’ x’y
Representation of cells m2 (1,0) m3 (1,1)
1 1 xy’ 1 xy
Representation of Truth table on
3-Variable K-Map
YZ 00 01 11 10
X Y Z F X 0 1 3 2
0 0 0 0 0 1
0 0 1 0 4 5 7 6
0 1 0 0 1 1 1 1
0 1 1 1
1 0 0 0 YZ 00 01 11 10
X 0 1 3 2
1 0 1 1 0 0 0 0
1 1 0 1 4 5 7 6
1 1 1 1 1 0
W X Y Z F Representation of Truth table
0 0 0 0 0 on 4-Variable K-Map
0 0 0 1 0 YZ
0 0 1 0 0 wx 00
0
01 11 10
0 0 1 1 1 00 1 1 3 2

0 1 0 0 0 4
01 1 5
1 7
1 6
0 1 0 1 1
12
0 1 1 0 1 11 1 13 1 14 1 15
0 1 1 1 1 8
10
9 1 11 10
1 0 0 0 0
YZ
1 0 0 1 0
wx 00
0
01 11 10
1 0 1 0 0 00 0 0 1 3 02
1 0 1 1 1 4
01 0 5 7 6
1 1 0 0 0
1 1 0 1 1 11 0 12 13 14 15

1 1 1 0 1 8
10 0 0 9 11 0 10
1 1 1 1 1
Simplification Algorithm
Simplification of logical functions using K-maps is based on the
principle of combining terms in adjacent cells. Two cells are said to be
adjacent if they differ in only one variable.
Identify the ones which cannot be combined with any other ones and
encircle them. These are called essential prime implicants.
 Identify the ones that can be combined in groups of two in only one
way. Encircle them.
 Identify the ones that can be combined with three other ones, to
make a group of four adjacent ones, in only one way. Encircle such
group of ones.
 Identify the ones that can be combined with seven other ones, to
make a group of eight adjacent ones, in only one way. Encircle
them.
 After identifying the essential groups of 2, 4, and 8 ones, if there still
remain some ones which have not been encircled, then these are to
be combined with each other or with other already encircled ones.
2-Variable K-Map
Simplification

X Y Z Y 0 1
0 0 1 X
0 1 1 X’Y’ 0 1 1
1 0 0 +
X’Y 0 0
1 1 0 1

X’Y’ + X’Y = X’(Y’ + Y) = X’


 If there are 1’s in adjacent cells then they can be grouped
and Minimized functions can be obtained
2-Variable K-Map
Simplification

X Y Z Y 0 1
0 0 1 X
0 1 1
X’ 0 1 1
1 0 0
0 0
1 1 0 1

X = 0 constant Y varies from 0  1

Adjacent cells can be grouped 2- cells at a time


4- cells at a time
3-Variable K-Map

X Y Z F 2- cells or 4-cells or 8-cells at a time


0 0 0 0 YZ 00 01 11 10
0 0 1 0 X
0 1 0 0 0 0 0 1 0
0 1 1 1
1 0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1 XZ YZ XY
X=1, Z=1 constant , Y varies
1 1 1 1
Y=1, Z=1 constant , X varies

F = XY + YZ + XZ X=1, Y=1 constant , Z varies


3-Variable K-Map
F (X,Y,Z) = ∑ (0,2,4,5,6) 2- cells or 4-cells or 8-cells at a time

X Y Z F
0 0 0 1 YZ 00 01 11 10
0 0 1 0 X
0 1 0 1 0 1 0 0 1
0 1 1 0
1 1 1 0 1
1 0 0 1
1 0 1 1
1 1 0 1 XY’ Z’
F = XY’ + Z’
1 1 1 0
Z=0, constant , X , Y Change
Solve Using K-Map

F (A,B,C) = A’C + AB’C + BC + AB’ + A’BC’


Solve Using K-Map

F (A,B,C) = A’C + AB’C + BC + AB’ + A’BC’

BC 00 01 11 10
A
0 1 1 1
1 1 1 1

F = C + A’B + AB’
Solve Using K-Maps

1. Simplify F (A,B,C) = ∏ M (0,2,3,5) using K-Map


2. Using K-map, minimize the following function:
F (A,B,C) = ∏ M (0,1,3,6)
Don’t care Conditions

• In some applications the output is not specified for


certain combinations of inputs.
• Don’t Care conditions : we simply don’t care what output
is generated for unspecified input cases.
• Don’t care conditions can be used for further
simplification.
Don’t care Conditions
F (A,B,C) = ∑ (3,4,6,7)

A B C F
0 0 0 0 BC 00 01 11 10
A
0 0 1 0 0 0 0 1 0
0 1 0 0
0 1 1 1 1 1 0 1 1
1 0 0 1
1 0 1 0 F = BC + AC’
1 1 0 1
1 1 1 1
Don’t care Conditions
F (A,B,C) = ∑ (3,4,6,7), d(A,B,C) = ∑ (5)

A B C F
0 0 0 0 BC 00 01 11 10
A
0 0 1 0 0 0 0 1 0
0 1 0 0
0 1 1 1 1 1 X
0 1 1
1 0 0 1
1 0 1 X If don’t care considered as 1, F = BC + A
0
1 1 0 1
If don’t care considered as 0, F = BC + AC’
1 1 1 1
Don’t care Conditions
F (A,B,C) = ∑ (0,2,4,5,6) + d (3,7)

A B C F BC 00 01 11 10
0 0 0 1 A
0 0 1 0
0 1 0 X 1
0 1 0 1
1 1 1 X 1
0 1 1 X
C’ F = C’+ A
1 0 0 1 A
1 0 1 1 X Considered as 1 if it helps in reducing the terms or
literals
1 1 0 1
X taken as 0 and neglected if it does not reduce terms
1 1 1 X or literals
4-Variable K-Map
F(w,x,y,z) = ∑(1,3,4,5,6,7,11,14,15)
w’z
yz 00 01 11 10
wx
00 1 1
01 1 1 1 1 w’x
11 1 1 x
10 1 y

yz
F = w’x + yz + xy + w’z
Solve Using K-Maps

1. Simplify F (A,B,C,D) = ∏ M (1,3,4,6,8,9,12,15) using K-Map


2. Using K-map, minimize the following function:
F (A,B,C,D) = ∏ M (0,2,4,5,8,9,14,15)
Block Diagram & Types of Optimization
Techniques

 Optimization of any Digital


System can be done by
Inputs Outputs
A using either of the following
Y Optimization Techniques
B
? Z
C 1.Local Optimization

2.Global Optimization

24
Local Optimization using K-Maps

Example: Let us consider two variables Y = Σm(0, 2, 3, 4) and Z = Σm(0, 4, 6, 7)


BC
A B’C’ B’ BC BC
0 C 1 3 ’ 2
A’ 1 0 1 1
Y = Σm(0, 2, 3, 4) 4 5 7 6
Y = B’C’+A’B
A 1 0 0 0

BC
A B’C’ B’ BC BC
0 C 1 3 ’ 2
A’ 1 0 0 0
Z = Σm(0, 4, 6, 7) 4 5 7 6
Z = B’C’+AB
A 1 0 1 1
Implementation using Logic Gates (Local)

A B C
A
Y = B’C’+A’B AOI Y
B
Logic Z
C
Z = B’C’+AB A’ B’ C’
B’C’

No. of Logic Y
Gates Required: 9
A’B Y = B’C’+A’B
NOT Gates = 3 B’C’

AND Gates = 4 Z

OR Gates = 2 AB Z = B’C’+AB
Global Optimization using K-Maps

Example: Let us consider two variables Y = Σm(0, 2, 3, 4) and Z = Σm(0, 4, 6, 7)

BC
A B’C’ B’ BC BC
0 C 1 3 ’ 2
A’ 1 0 1 1
Y = Σm(0, 2, 3, 4) 4 5 7 6 Y = B’C’ + A’B
A 1 0 0 0

Common
BC Term
A B’C’ B’ BC BC
0 C 1 3 ’ 2
A’ 1 0 0 0
Z = Σm(0, 4, 6, 7) 4 5 7 6 Z = B’C’ + AB
A 1 0 1 1
Implementation using Logic Gates (Global)

A B C
A
Y = B’C’+A’B AOI Y
B
Logic Z
C
Z = B’C’+AB A’ B’ C’
B’C’

No. of Logic Y
Gates Required: 8
A’B Y = B’C’+A’B
NOT Gates = 3
B’C’
AND Gates = 3 Z

OR Gates = 2 AB Z = B’C’+AB
Conclusions

 Optimization of any Digital Design can be done either by

using Boolean Theorems or with the help of Karnaugh

maps.

 But, for further Optimization of the Design, Global

Optimization Technique is Used. (Reduces the logic gates

further)

You might also like