key observation adjacencies in the k-map
DESCRIPTION
Design Examples Two Bit Comparator Truth Table Block Diagram Design Steps: 1- Simplify to reduce cost (three 4-variable K-maps, one for each output) 2- Implement using a suitable design style (e.g. 2-level AND-OR, NAND-NAND, or multilevel techniques)TRANSCRIPT
Key Observation
Adjacencies in the K-Map
000
001
010
01 1
1 10
1 1 1
100
101
00 01 11 10
0
1
BC A
B
C
011
010
000
001
100
110
101
111
B
C
A
Any two adjacant cells in the K-map differ in exactly one variable.
The uniting theorem can be applied when adjacent cells contain (function =1)to eliminat the changing variable.
Design ExamplesTwo Bit Comparator
F 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
F 2 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0
F 3 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
B 0 1 0 1
A 0 0 1 1
=, >, < F 1 A B = C D F 2 A B < C D F 3 A B > C D
A B
C D
N 1
N 2
Block Diagram
Truth Table
Design Steps:1- Simplify to reduce cost (three 4-variable K-maps, one for each output)2- Implement using a suitable design style (e.g. 2-level AND-OR, NAND-NAND, or multilevel techniques)
Design ExamplesTwo Bit Comparator (continued)
F1 = A' B' C' D' + A' B C' D + A B C D + A B' C D'
F2 = A' B' D + A' C
F3 = B C' D' + A C' + A B D'
AB 00 01 11 10
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
00
01
11
10 C
CD
A
D
B K-map for F 1
AB 00 01 11 10
0 0 0 0
1 0 0 0
1 1 0 1
1 1 0 0
00
01
11
10 C
CD
A
D
B K-map for F 2
AB 00 01 11 10
0 1 1 1
0 0 1 1
0 0 0 0
0 0 1 0
00
01
11
10 C
CD
A
D
B K-map for F 3
f1 = AC(BD+bd) + ac(bd+BD) = (AC+ac) (bd+BD) = (a c) (b d)
Design ExamplesTwo-Bit Adder
Truth Table
+ N 3
X 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 1
Y 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1
Z 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
B 0 1 0 1
A 0 0 1 1
A B
C D
N 1
N 2
X Y Z
Block Diagram
Design ExampleTwo-Bit Adder (Continued)
X = A C + B C D + A B D
Z = B D' + B' D = B xor D
Y = A' B' C + A B' C' + A' B C' D + A' B C D' + A B C' D' + A B C D
AB 00 01 11 10
0 0 0 0
0 0 1 0
0 1 1 1
0 0 1 1
00
01
11
10 C
CD
A
D
B K-map for X
AB 00 01 11 10
0 1 1 0
1 0 0 1
1 0 0 1
0 1 1 0
00
01
11
10 C
CD
A
D
B K-map for Z
AB 00 01 11 10
0 0 1 1
0 1 0 1
1 0 1 0
1 1 0 0
00
01
11
10 C
CD
A
D
B K-map for Y
5-Variable K-MapsConstructed from two 4-variable K-Maps.
E
C C
100 101 111 110
B ABC
000 001 011 010
00
01
11
10 D
DE
B
1
1
1
1
1 1 1 1
1 1 1 1
1
1
100 101 111 110
B
C
ABC 000 001 011 010
00
01
11
10 D
DE
B
C
E
1
1
1
1
1
1
1
1
1 1
f = bCDE + Bd
g = ABe + Bce + bE
A = 0 A = 1
5-Variable K-Maps
ƒ(A,B,C,D,E) = m(2,5,7,8,10,13,15,17,19,21,23,24,29 31)
BC DE
BC DE
A =0
A =1
00 01 11 10 00
01
11
10
00 01 11 10 00
01
11
10
0 4 12 8
1 5 13 9
3 7 15 11
2 6 14 10
16 20 28 24
17 21 29 25
19 23 31 27
18 22 30 26
Another View
ƒ(A,B,C,D,E) = C E + A B' E + B C' D' E' + A' C' D E'
BC DE 00 01 11 10
00
01
11
10
A=0
BC DE 00 01 11 10
00
01
11
10
A=1
1 1
1
1
1 1
1
1
1 1 1
1 1 1
6-Variable K-Maps
ƒ(A,B,C,D,E,F) =m(2,8,10,18,24,
26,34,37,42,45,50,53,58,61)
CD EF
CD EF
AB =00
AB =01
00 01 11 10 00
01
11
10
00 01 11 10 00
01
11
10
0 4 12 8
1 5 13 9
3 7 15 11
2 6 14 10
16 20 28 24
17 21 29 25
19 23 31 27
18 22 30 26
CD EF
AB =11
00 01 11 10 00
01
11
10
48 52 60 56
49 53 61 57
51 55 63 59
50 54 62 58
CD EF
AB =10
00 01 11 10 00
01
11
10
32 36 44 40
33 37 45 41
35 39 47 43
34 38 46 42
CD EF
CD EF
AB =00
AB =01
00 01 11 10 00
01 11
10
00 01 11 10 00
01 11
10
CD EF
AB =11 00 01 11 10
00 01
11 10
CD EF
AB =10 00 01 11 10
00 01
11 10
1
1 1
1
1 1
1 1
1 1
1 1
1 1
6-Variable K-Maps
ƒ(A,B,C,D,E,F) =m(2,8,10,18,24,
26,34,37,42,45,50,53,58,61)
= D' E F' + A D E' F+ A' C D' F'
CD EF
CD EF
AB =00
AB =01
00 01 11 10 00
01
11
10
00 01 11 10 00
01
11
10
0 4 12 8
1 5 13 9
3 7 15 11
2 6 14 10
16 20 28 24
17 21 29 25
19 23 31 27
18 22 30 26
CD EF
AB =11
00 01 11 10 00
01
11
10
48 52 60 56
49 53 61 57
51 55 63 59
50 54 62 58
CD EF
AB =10
00 01 11 10 00
01
11
10
32 36 44 40
33 37 45 41
35 39 47 43
34 38 46 42
CD EF
CD EF
AB =00
AB =01
00 01 11 10 00
01 11
10
00 01 11 10 00
01 11
10
CD EF
AB =11 00 01 11 10
00
01 11
10
CD EF
AB =10 00 01 11 10
00 01
11 10
1
1 1
1
1 1
1 1
1 1
1 1
1 1
Definitions
Implicant: Single 1 entry or any group of 1’s that can be combined together in a K-map to form a product term.
(Dual): Single 0 entry or any group of 0’s that can be combined together in a K-map to form a sum term.
Prime Implicant: an implicant that cannot be combined with another implicant to eliminate a term
Essential Prime Implicant: a prime implicant that contains a 1 entry not covered by any other implicant.
6 Prime Implicants:A' B C’ , C D, A‘ D , B C' D’ , A C , AB D'
essential
Minimum cover = A’ D + A C + B C ‘ D ’
CD 00 01 11 10
0 1 1 0
1 1 1 0
1 0 1 1
0 0 1 1
00
01
11
10 A
AB
C
B
D
Example
Definitions
Implicant: Single 1 entry or any group of 1’s that can be combined together in a K-map to form a product term.
(Dual): Single 0 entry or any group of 0’s that can be combined together in a K-map to form a sum term.
Prime Implicant: an implicant that cannot be combined with another implicant to eliminate a term
Essential Prime Implicant: a prime implicant that contains a 1 entry not covered by any other implicant.
CD 00 01 11 10
0 1 1 0
1 1 1 0
1 0 1 1
0 0 1 1
00
01
11
10 A
AB
C
B
D
Example
Illustrating the Definitions
Prime Implicants:B D, C D, A C, B' C
essential
Essential primes form the minimum cover
AB 00 01 11 10
0 0 0 0
0 1 1 0
1 1 1 1
1 0 1 1
00
01
11
10 C
CD
A
D
B
5 Prime Implicants:
B D, A B C', A C D, A' B C, A' C' D
essential
Essential implicants form minimum cover
AB 00 01 11 10
0 0 1 0
1 1 1 0
0 1 1 1
0 1 0 0
00
01
11
10 C
CD
A
D
B
Illustrating the Definitions
Prime Implicants:A D’, AB, A C, BD
essential
Essential primes form the minimum cover
CD 00 01 11 10
0 0 0 0
0 1 1 0
1 1 1 1
1 0 1 1
00
01
11
10 A
AB
C
B
D
5 Prime Implicants:
B D, A B C', A C D, A' B C, A' C' D
essential
Essential implicants form minimum cover
AB 00 01 11 10
0 0 1 0
1 1 1 0
0 1 1 1
0 1 0 0
00
01
11
10 C
CD
A
D
B
Try the other axis
Quine-McCluskey (Tabular) Method systematically finds all prime implicants
Implication Table
Column I 0000 0100 1000 0101 0110 1001 1010 0111 1101
1111
Example: Simplify ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)
Step 1: List minterms and don’t cares using their binary representation, and group according to number of 1’s
Remarks:Only terms in adjacent groups have to becompared with one another. Terms in non-adjacent groups differ in morethan one variable. Thus can not be combined
Principle:Combine terms in adjacent groups which differ in a single variable, and eliminate thechanging variable.
Q & M Method
Implication Table
Column I Column II 0000 ¦ 0-00 -000 0100 ¦ 1000 ¦ 010- 01-0 0101 ¦ 100- 0110 ¦ 10-0 1001 ¦ 1010 ¦ 01-1 -101 0111 ¦ 011- 1101 ¦ 1-01
1111 ¦ -111 11-1
ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)
Step 2:
Compare elements of a group with k 1's against those with k+1 1's. If they differ by one bit, eliminate changing variable and place reduced term in next column.
E.g., 0000 vs. 0100 yields 0-00 0000 vs. 1000 yields -000
When a term is used in a combination, mark that term with a check. If cannot be combined, mark term with a star. These are the prime implicants.
Implication Table
Column I Column II Column III 0000 ¦ 0-00 * 01-- * -000 * 0100 ¦ -1-1 * 1000 ¦ 010- ¦ 01-0 ¦ 0101 ¦ 100- * 0110 ¦ 10-0 * 1001 ¦ 1010 ¦ 01-1 ¦ -101 ¦ 0111 ¦ 011- ¦ 1101 ¦ 1-01 *
1111 ¦ -111 ¦ 11-1 ¦
Q & M MethodStep 2 Continues:
Compare elements of a group in Col. II with
k 1's against those with k+1 1's. If they differ by one bit, eliminate changing variable and place reduced term in next column.
E.g., 010- vs. 011- yields 01- - -101 vs. -111 yields -1-1
Q & M - Prime Implicant Chart
rows = prime implicantscolumns = mintermsplace an "X" if minterm iscovered by the prime implicant
If column has a single X, than theimplicant associated with that rowis essential. It must appear inminimum cover
5,7,13,15 (-1-1)
4,5,6,7(01--)
9,13(1-01)
8,10(10-0)
8,9(10-0)
0,8(-000)
0,4(0-00) 4 5 6 8 9 10 13x
x xx
x
xxx
x
xx
x
x
4 5 6 8 9 10 13x
x xx
x
xxx
x
xx
x
x
5,7,13,15 (-1-1)
4,5,6,7(01--)
9,13(1-01)
8,10(10-0)
8,9(10-0)
0,8(-000)
0,4(0-00)
Gate Logic
• Review
Description Z = 1 if X and Y are both 1
Truth Table SwitchesY 0 1 0 1
X 0 0 1 1
Z 0 0 0 1
X Y
X • Y
false
true
NOT
AND
OR
Description If X = 0 then X ' = 1 If X = 1 then X ' = 0
Switches
X
X 0 1
X 1 0
T ruth T able
T rue
False X
Description Z = 1 if X or Y (or both) are 1
T ruth T able Switches
X 0 0 1 1
Y 0 1 0 1
Z 0 1 1 1
X Y
X + Y
False
T rue
Gate realization
Switch realizationa
e’
c’
d
w
1 s
Example : Logic circuit & its Switch realization
s = a (d+w)(c’+ e’)
c
e
dwa
s
Logic Functions: NAND
NANDDescription Z = 1 if X is 0 or Y is 0
T ruth T able Switches
X Y
X • Y
False
T rue X 0 0 1 1
Y 0 1 0 1
Z 1 1 1 0
Description Z = 1 if X and Y are both 1
Truth Table SwitchesY 0 1 0 1
X 0 0 1 1
Z 0 0 0 1
X Y
X • Y
false
true
AND
Note that switch circuit of the NAND gate is the complementof the switch circuit for the AND gate.
Logic Functions: NAND, NOR, XOR, XNOR
NORDescription Z = 1 if both X and Y are 0
T ruth T able Switches
X 0 0 1 1
Y 0 1 0 1
Z 1 0 0 0
X Y
X + Y False
T rue
OR
Description Z = 1 if X or Y (or both) are 1
T ruth T able Switches
X 0 0 1 1
Y 0 1 0 1
Z 0 1 1 1
X Y
X + Y
False
T rue
Note that switch circuit of the NOR gate is the complementof the switch circuit for the OR gate.