Professional Documents
Culture Documents
5 Variable Karnaugh Map Example
5 Variable Karnaugh Map Example
0
One can circle squares: on either level, or between levels.
1 1
1
c
1 1 1 1
e a 1 1 1
c
1 1 e 1
Best for where e has simple relations: e is in only a few squares or e is in almost all the squares.
Printed; 11/02/04 Modified; February 11, 2004 Department of Electronics, Carleton University John Knight
Slide 46
Digital Circuits p. 91
1
b a
1
b
e=0
d
OK
1
b
e=0
d
b a
e=1
d
e=1
b d
e=0
d
e
a b
1 e
c
1 1 e 1
e=1
Comment on Slide 46
Digital Circuits p. 92
e=0
e=1
1 1
1
c
1 1 1 1
1 e 1 e or e 1
d
1 e or 1 e e 1
e a 1 1 1
c
1 1 e 1
Digital Circuits p. 93
Five-Variable Maps
Five-Variable Maps
The 0 is specifically entered on one map, just to remind you that it is a 1 on the other map. Normally 0 are left blank to reduce the clutter. 59. PROBLEM F = (abc + abd + cb)e + (abd + ac + adb)e = (abc + cb)e + (ac + adb)e +abd Plot F on the 5 variable map on the right. Plot F on the variable entered map on the right. 60. PROBLEM (based on the last problem) Circle the 5 variable map and reduce F to 12 letters. Circle the variable entered map and reduce F to 4 terms of 3 letters each.
a a
b d c b a b c c
e=0
d
e=1
Comment on Slide 47
Digital Circuits p. 94
d d
e=0
a
1 1 1 c
d d
d
b
e=0
a
1 1 1 c
d d
d
1 1 1
d
1 1
e=1
e=1
a
e=1
a
c
F = e(abd) + bd + e(abcd)
c F = e(abd) + bd + abcd Tom says, The interaction of d and e is too complex. Use dual maps.
c
F = e(abd) + bd + e(abcd)
Slide 48
Digital Circuits p. 95
c Method 3 map
Comment on Slide 48
Digital Circuits p. 96
a
Often one can share some gates We optimized maps individually got one common gate abd. size measures 29 letters (literals) 37 gate inputs 11 gates
a c d b c d a b d a b d a b c
1 1 1 1
1 1 1 1
c b
1 1
1 1 1
Map of F
Map of G c
u=abd
F
3 letters
b c d a c d a d b a b c
1 1 1 1
1 a 1 1 1
1 1 1
c
1 1 1
c
c d
Digital Circuits p. 97
Comment on Slide 49
Digital Circuits p. 98
1 1 1 1
1 1 1 1
c b
1 1
1 1 1
c
Map of F
Map of G
11 gate inputs
a b c
a d b a b c a b c
1 1 a
1 a 1 1 1
1 1
1 1 1
c
1 1 1
c
b c
Digital Circuits p. 99
Multiple Outputs
Multiple Outputs
Collecting the u+v+w terms would reduce the number of letters and gate inputs, but will increase the number of gates. However the total logic is clearly reduced.
F = abc + abc + x G
(7 letters, 9 inputs, 3 gates) (7 letters, 9 inputs, 3 gates) (11 letters, 14 inputs, 4 gates))
= acd + abc + x
Total: 25 letters, 10 gates, 32 gate inputs 61. PROBLEM Find the of expressions with minimal logic for the two-output circuit E,F. Soln has 5 gates. If it does not have to be pure of , it can be done in 5 two-input gates, or, with factoring, 4 gates.
Z Z
YZ WX 00 01 11 10
YZ WX 00 01 11 10
00 01
W X Y Z
E F W
00 01 11 10
d 1
d
1
d
1
d
E
1 1
Y
1 1
Y
11
W 10
d
F
62. PROBLEM Find the minimum circuit with the three outputs defined by the maps below. This is a hard problem. You should read over the example for the 7-segment display drivers before attempting it. .
YZ WX 00 01 11 10
00 01 11
YZ WX 00 01 11 10
00 01
1 1
1 1
W 10 1
d
1 1
Y
X W
11 10
1 1 1 1 1 1
Y
YZ WX 00
00 01
Z
01 11 10
X W
11 10
1 1 1 1 1 1 1 1 1 1 d
Y
E=
F=
G=
Comment on Slide 50
Z Y X W
b a f g e d c
a f g e d c b
YZ WX 00
00 01 11 10
01 11
10
LOGIC
Generate Maps
Choose segment a find all the squares where a is lit. Repeat for b, c, . . .
Digits with a lit Digits with b lit Digits with c lit
Slide 51
1. The bright light-emitting diode displays use 7-segments as shown. The dimmer watch and control panel displays are usually liquid crystal and have more complex driver logic.
Comment on Slide 51
1
Digits with a lit
1
W
1 1
1
X W
1 1
1 1 1
1
X W
1 1
1 1
1 1 1
d d d d 1 1 d d
a
Z Y
d d d d 1 1 d d
b
Z Y
d d d d 1 1 d d
c
Z Y
1 1
W
1 1
1
X W
1 1
X W
1 1 1 1 1
1
X W
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
Minimization
Look for isolated 1s with no neighbors. Look for isolated pairs of 1s with no neighbors. These will always have to be circled individually.
Z Z Z
1 1
W
1 1
1
X W
1 1
X W
1 1 1 1 1
1
X W
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
Slide 52
BCD Display
BCD Display
Typical Minimization Procedure
This should work fairly well as as a general procedure, but a clever person may find more efficient procedures for certain problems. 1. Locate isolated 1s. 1 1 1 These are 1s in a square 1 1 that cannot be grouped with d d W any other square except 1 d d d Y possibly a d squares. Isolated 2. Circle these isolated 1s and expand the circle to include any ds.
Z Z Z Z
1
X W
1 1
1
X W
1 1 1 f
Y
1 1
X
1 1
1 e
Y
d d
X W
d d d d 1 1 d d
g
Y
Isolated pair
3. Locate isolated pairs of 1s in which neither 1 can be paired with another any other square. 4. Circle this pair and expand the circle to include any ds.
F=WYZ+L
YZ WX 00 01 11 10
00 01
G=WX+Z+XY
YZ WX 00
00 01
Z
01 11 10
1 1
1 1
W 10 1
d
1 1
Y
X W
11 10
1 1 1 1 1 1
Y
X W
11 10
1 1 1 1
1 1 1 1 1 1 d
Y
Comment on Slide 52
1 1
W
1 1
1
X W
1 1
1 1 1
1
X W
1 1
1 1
1 1 1
d d d d 1 1 d d
a
Y Z
d d d d 1 1 d d
b
Z Y
d d d d 1 1 d d
c
Z Y
1 1
W
1 1
1
X W
1 1
X W
1 1 1 1 1
1
X W
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
The green (light) circles are repeats of half-map circles. A common error is to add the dashed circle W to the b map and on the c map. They are not needed.
Slide 53
BCD Display
Circles that cover half the map These are representend by a single letter and are particularly good. Since they only contain a single letter, they do not need an AND gate. The input can feed directly into the OR gate. There is no advantage to sharing these terms between maps because there is no hardware to share. 5. Locate all circles which, with ds if needed, cover half of a map. There are some ten of them in this example. 6. It is easy to overdo this step Two of these circles cover no 1s that are not covered by other circles. The only new squares they cover contain ds and hence are useless. Remove such circles. The b and c maps have such useless circles.
Z 1 1 W
Z
Z 1 1 1 X W 1 1 1 1 1 1 X W 1 1 1 1
Z 1 1 1
d d d d 1 1 d d
a Y Z 1
d d d d 1 1 d d
b Y Z 1 1 1
d d d d 1 1 d d
c
Z
Y 1 1 1
X
1 1
W
1 1
1 1
X W
d d d d 1 d d
d
Y
X W
d d d d 1 d d
e
Y
d d d d 1 1 d d
f
Y
X W
d d d d 1 1 d d
g
Y
Comment on Slide 53
Multiple Output Maps Maps for 7-Segment Display Driver , One partner squares.
1 1
W Z
1 1
1
X W
1 1
1 1 1
1
X W
1 1
1 1
1 1 1
d d d d 1 1 d d
a
Y
d d d d 1 1 d d
b
Z
Y
d d d d 1 1 d d
c
Z
Y
1 1
W
1 1
1
X W
1 1
X W
1 1 1 1 1
1
X W
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
) 1 1 1 1 1 G H 3 AND gates 1 1 1 1 1 G H 4 AND gates 1 There is no example in the BCD display maps.
Slide 54
BCD Display
1 1
d d d d 1 1 d d
a Y
1 1
d d d d 1 d d
d
Y Z
1 1
X W
1 1
X
d d d d 1 d d
e
Z Y
d d d d 1 d d
e
Z Y
1 1
W
1 1
X W
1 1 1
1 1
X
d d d d 1 1 d d
g
Y
d d d d 1 1 d d
g
Y
Comment on Slide 54
1 1
1 1
1
X W
1 1
1 1 1
1
X W
1 1
1 1
1 1 1
d d d d 1 1 d d
a
Y
d d d d 1 1 d d
b
Y
d d d d 1 1 d d
c
1
Y
1 1
W
1 1
1
X W
1 1
X W
1 1 1 1 1
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Z
d d d d 1 1 d d
f
Y
Z
X W
d d d d 1 1 d d
g
Z
L
1 1 1
X W
1 1
1 1 1
1
X W
1 1
1 1
1 1 1
d d d d 1 1 d d
a
Y
d d d d 1 1 d d
b
Z
Y
d d d d 1 1 d d
c
Z
Y
K
1 1 1 1
X W
1 1
X
1 1
W
1 1 1 1
X W
1 1
X
d d d d d d 1
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
Slide 55
BCD Display
1 1
1 1
1
X W
1 1
X W
1 1 1 1 1
1
X W
1 1
X
d d d d 1 d d
d
Y
d d d d d d 1
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
For all seven maps, the largest circles appear to be optimum. However another circling, using smaller circles might still be optimum. 64. P ROBLEM Reducing the size of L to L=XYZ and adding reusable term R makes all multi-letter terms reusable. Find the number of letters, gate inputs and gates.
W
R
Z Z 1 1 1 X W 1 1 1 1 1 1 X W 1 1 1 1 Z 1 1 1
K
1 1
L L
Z
d d d d 1 1 d d
a
Z
d d d d 1 1 d d
b
Z
d d d d 1 1 d d
c Y
Z
L
1 1
X W
N
1 1 1
W
1 1
1 1
1
X W
1 1 1
1
X
1 1
X
d d d d 1 d d
d
Y
d d d d 1 d d
e
Y
d d d d 1 1 d d
f
Y
d d d d 1 1 d d
g
Y
Comment on Slide 55
1 N J
K
X W
1 L
X 1 J
X
X W
Y 1
1 1
Z 1 X
d d d d 1 1 d d
a
Z
Y
d d d d 1 1 d d
b
Z
Y
d d d d 1 1 d d
c
Z
Y
K N
W
M 1 P
K
X W
1 P
X W
L 1 X X X
M 1
X W
1 1
d d d d d d K
d
Y
d d d d d d K
e
Y
d d d d 1 W d d
f
Y
d d d d W W d d
g
Y
J = YZ K = XZ L = YZ
M = XY N = XYZ P = YZ
Size measures
37 letters (literals) 14 gates 38 gate inputs
Printed; 11/02/04 Modified; February 11, 2004
Using: 35 letters
c=f+Z 14 gates
It is very hard to find the optimal circling in a problem of this size. These maps show a solution which is suboptimal, but you will probably have difficulty improving without comparing answers.
Z Q 1 N J M X W 1 X L 1 X b
Z
Z 1 J X X W Y Y Y 1 X
Z J 1 X
W
Z
1 W a Y Z
Y Y c
Z
Y M 1
Q N
W
M 1 P
Q
X W
P P
X W
Q X 1 X W f
Y
X W
Q d
Y
Q e
Y
1 W g
Y
The equations.
J = YZ L = YZ M = XY
N = XYZ P = YZ Q = XYZ
Comment on Slide 56
Sum of Products ( of )
abc + ae + ace + abd + . . . NAND-NAND logic
Product of Sum ( of )
(a+b+c)(a+e)(a+c+e)(a+b+d)( . . . NOR-NOR logic
Dual of of
NAND
Factoring
of
(NAND-NAND)
Multiplying out
a e a e c a d b
NOR
of
(NOR-NOR)
Slide 57
Comment on Slide 57
Use (D2)
(AB + X) (C + X)
Example
BC + AD
Example
BC + BD (BC + B) (BC + D) (B + B) (C + B)(B + D) (C + D) 1 (C + B)(B + D) (C + D)
Consensus bx + xy + yb = bx + yb Swap rule (Sw) BC + BD = (B + C)(B + D) 65. PROBLEM What can you say about the dual of the Swap rule? If you cant say anything, substitute X for W and X for W. 66. PROBLEM Factor AB + BC + CA
The dual Consensus (b + x)(x + y)(y + b) = (b + x)(y + b) The dual of the Swap rule (B + C)(B + D) = BC + BD
Comment on Slide 58
Review of Rules
Simplify (S) xy + x = x Reduction (R) xy + x = y + x (b + x)(b)=(b + x) Distributive (D2) u + yz = (u + y)(u + z) Extended Distributive (D2) u + xyz = (u + x)(u + y)(u + z) Swap (Sw) by + bz = (b + y)(b + z) Ready to use (D2) Use (D2) twice This can be reduced (B + C)(B + F + C) = (B + C)(F + C) (b + x)(b) = b
Example:
ABC + BCD + BF
commute
Find common variables Choose B over C Use (D1) with B Find complimented variables Use (Sw) with B
(B + F + CD)(B + AC) (B + F + C)(B + F + D)(B + A)(B + C) If one expanded using (D2) alone, get
(B + A)(F + A + B)(F + A + C)(F + A + D)(B + F + C)(B + F + D)(B + C)(F + C)
Printed; 11/02/04 Modified; February 11, 2004 Department of Electronics, Carleton University John Knight
ugh!
Slide 59
= (B + A + BCD)(F + A + BCD) (F + B + C)(F + B + D) (B + C)(F + C) = (B + A)(F + A + BCD) (F + B + C)(F + B + D) (B + C)(F + C) After completing the simplification, you can see why we like the short cuts.
Comment on Slide 59
Swap: w(a) + w(b) = (w + b)(w + a) [W +(XZ + YZ)][W +(XY + YZ)] D1 Swap [(W +(Z +Y)(Z + X)][W +Y(X + Z)] D2 D2 (W + Z + Y)(W + Z + X) (W + Y)(W + X + Z) Factor ABD + ACD + AC + ABD (D1) on both sides A(BD + CD) + A(C + BD) swap [A + (C + BD)][A + (BD + CD)] [A + (C + B)(C + D)][A + (B + D)(C + D)] (D2) on left; swap on right (D2) on left; (D2) on right Swap on left; (D1) on right Finally we have to use (D2).
[A + (C + B)][A + (C + D)][A + (B + D)][A + (C + D)] Clean up brackets (A + C + B)(A + C + D)(A + B + D)(A + C + D) 67. PROBLEM: Factor AC + ABD + ABE + ACDE Five factors, four have 3 letters, one has 2.
Comment on Slide 59
With all the letters different, there is no way to simplify. The expressions get long rapidly. Using (D1) always works, it is easy on the brain, but hard on the pencil. Also the simplifications must be done by other means.
Comment on Slide 60
Multiplying Out
Multiplying Out
Needed to change of to of ( - - - )( - - - )( - - - ) ( ) + ( ) + ( )
Multiplying out is the dual operation of factoring.
Example:
(B + F + C)(B + C)(B + F + D)(B + A) 0 0 = (BB + BC + FB + FC + CB + C)(BB + BA + FB + FA + DB + DA)
Use D1 x +xy = x Use D1 twice BCD
D
ACF BF
B
= (FB + C)(BA + FB + FA + DB + DA) 0 = FBBA + FBFB + FBFA + FBDB + FBDA + CBA + CFB + CFA + CDB + CDA)
Put letters in order x +xy = x
ABC ACD
D C
BCD
= BF + ABC + BCD
F
A
ABC
C
ACD
Slide 60
= (AB + AD) [A (C + D) + A(C + D )] (A + B + C) Use (D1) = {AB [A (C + D) + A(C + D )] + AD)[A (C + D) + A(C + D )]} (A + B + C) Use (D1) = {AB(C + D) + AD(C + D)} (A + B + C)
xy + x = x
= {ABC + ABD + ADC + AD)} (A + B + C) {ABC + ABD + AD)} A ABC + ABD + + ADB = + {ABC + ABD + AD)} B = + {ABC + ABD + AD)} C ABDC + ADC
xy + x = x
Use (D1)
A C D ABD
B
ABC
ABD C
Comment on Slide 60
Multiplying Out
Review of Rules
Simplify (S) xy + x = x Reduction (R) xy + x = y + x (b + x)(b)=(b + x) Distributive (D2) u + yz = (u + y)(u + z) Extended Distributive (D2) u + xyz = (u + x)(u + y)(u + z) Swap (Sw) by + bz = (b + y)(b + z) (b + x)(b) = b
Example:
(B + F + C)(B + C)(B + F + D)(B + A) Find common variables = (B + F + C)(B + F + D) (B + A)(B + C) Use (D2) twice = (B + F + CD) (B + AC) Use (Sw) with B = BAC + B(F + CD) Finally use (D1) = ABC + BF + BCD Go back and look at Slide 60
Slide 61
69. PROBLEM Multiply out to get four terms of three letters each. The answer should be very symmetric on an AB\CD Karnaugh map. (B + C)(A + B + C)(A + C + D)(A + B + C)(A + C + D)
Comment on Slide 61
(A + C + BD) CD + (A + C + BD) BD
ACD + CD + BCD
Use (D1)
= CD + ABD + BCD
Check map for further
D
CD simplifications BCD
= CD + ABD + BC
ABD
A C
Slide 62
Comment on Slide 62
Multiplying out is based on (D1). Easier than factoring based on (D2). Algebra of one is the dual of the other
Slide 63
Comment on Slide 63
(A + B + D)(A + B + D)(A + B + C)(A + C) Rearrange to use (D2) = (A + B + D)(A + B + C)(A + B + D)(A + C) Use (D2) = [A + (B + D)(B + C)] [A + (B + D)C] equal Use Swap = A (B + D)C) + A(B + D)(B + C) Use Swap = A (B + D)C) + A(B C + BD) Use (D1) = ABC + A DC + AB C + ABD = A BC + A DC + AB C + ABD OK
Take dual
equal
AB C
A DC
Slide 64
= [C + (B + A)(B + A)] [(C + (A + D)(B + D)] Use Swap = C(A + D)(B + D) + C(B + A)(B + A) Use Swap = C(AB + D) + C(BA + BA) = CAB + CD + C BA + CBA OK Take the dual (C + A + B)(C + D)(C + B + A)(C + B + A) 71. PROBLEM Factor EF D + ECD + E C + EFD Use (D1) Check on map for more simplifications
ABC
A
CD
D
ABC
C
ABC
Comment on Slide 64
A
D
1 1 1 1 1 1
C
1 1
B
Map of F
1 1 1 1
1 1 1 1
C B
Map of F
1 1 1 1
1 1 1 1
C B
Map of F
Slide 65
This method is probably the easiest, and least error prone, for up to 4 variables. Above 4, it gets hard. It is very easy to incorporate dont cares with this method.
72. PROBLEM Factor EF D + ECD + E C + EFD Using a Karnaugh map and compare your answer with that from Problem 71. 73. PROBLEM Factor ACD + BD + ABC + CD + ABD Use a Karnaugh map and obtain the minimum of expression. 74. PROBLEM Show that Prob 62. has a slightly simpler solution if you find the of expression.
Solution:
to Prob 74. Maps from Prob 62.
YZ WX 00 01 11 10
00 01 11
YZ WX 00 01 11 10
YZ WX 00 01 11 10
00 01
YZ WX 00 01 11 10
00 01
Z
YZ WX 00
00 01 01 11 10
00 01 11
1 1
1 1
1 1 1
1 1
d
1 1
11
10
W 10 1 Y
1 1 1
X W
11 10
1 1
Y
1 1 1 1
1 1 1 1 1 1 d
Y
W 10 1
d
1 1
Y
11
W 10 1
1 1 1 1
1 1 1
Y X
YZ WX 00 01 11 10
00 01
1 1 1 1
11 10
1 1 1 1
Y
1 1
G=XZ+M
E=
F=
G=
G=(X+Z)M
Comment on Slide 65
1 A 1 1 1 1
1 1 1
C
1
B
Map of F
1 A 1 1 1 1
1 1 1
C
1
B
Map of F
Slide 66
True of map
a bc 0 c
00 01 11 b 10 1
0 0 1 1
1 1 1 1
a bc 0
00 01 11 b 10
1 1 1 1
1 1 0 0
0 1 1 0
0 1 1 0
a bc 0 c
00 01 11 b 10
0 0 0 1 1 0 0 0
F=a+b F=a+b F=c F = (a + b)(a + b)c Product map The 0s are the important thing in of maps. When one ANDs the three maps, the product map will have a 0 where any of the sum terms have a 0. The other squares have 1s.
a bc 0
00 01 11 10 1
If one multiplies out F = (a + b)(a + b)c, one gets F= abc + abc. Which has exactly the same map except now one thinks about the 1s instead of the 0s. b
0 0
0
c a bc 0
00 01 11 b 10 1
1 1 0
0 0
Thus the map of F is not quite the of map for F. of map of F However it can be used as that map. Further using DeMorgans theorem on the map of F, is far easier than twisting ones mind around the of maps such as the one above.
1 1 1 0 0 1 1 1
of map of F
75. PROBLEM Multiply out to get three terms of 2 of three letters, and one of two letters. Use a Karnaugh map. (B + C)(A + B + C)(A + C + D)(A + B + C)(A + C + D)
Comment on Slide 66
Slide 67
Solution problem 75
F = (B + C)(A + B + C)(A + C + D)(A + B + C)(A + C + D) F = BC + ABC + AC + ABC + A CD
1 1
F
1 1 1
1 1 1 1 1 1
C B
1 1
F
1
B
A 1
1
C
F = B D + AB C + A B C
76. PROBLEM (ACTUALLY SOLN TO 75) Multiply out to get four terms of three letters each. Use a Karnaugh map. (B + C)(A + B + C)(A + C + D)(A + B + C)(A + C + D)
Comment on Slide 63