View
222
Download
1
Tags:
Embed Size (px)
Citation preview
3
Literals xi or xi’
Product Term x2x1’x0
Sum Term x2 + x1’ + x0
Minterm of n variables: A product of n variablesin which every variable appears exactly once.
Definitions
4
Implementation
Specification Schematic Diagram Net list,
Switching expressionObj min cost Search in solution space(max performance)
Cost: wires, gates Literals, product terms, sum terms
We want to minimize # of terms, # of literals
5
Implementation (Optimization)
Karnaugh map – 2D truth table
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 A’B
2 1 0 1 AB’
3 1 1 1 AB
6
Function can be represented by sum of minterms:f(A,B) = A’B+AB’+AB
This is not optimal however! We want to minimize the number of literals and terms.We factor out common terms –
A’B+AB’+AB= A’B+AB’+AB+AB=(A’+A)B+A(B’+B)=B+A
f(A,B) = A+B
8
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 A’B
2 1 0 0
3 1 1 1 AB
Another Example
f(A,B)=A’B+AB=(A’+A)B=B
10
ID A B f(A,B) Maxterm
0 0 0 0 A+B
1 0 1 1
2 1 0 0 A’+B
3 1 1 1
Using Maxterms
f(A,B)=(A+B)(A’+B)=(AA’)+B=0+B=B
11
Two variable K-maps
Id a b f (a, b)
0 0 0 f (0, 0)
1 0 1 f (0, 1)
2 1 0 f (1, 0)
3 1 1 f (1, 1)
2 variables means we have 22 entries and thus we have 2 to the 22 possible functions for 2 bits, which is 16.
f(a,b)a
b
12
Two-Input Logic Gates
AND
Y = AB
A B Y0 0 00 1 01 0 01 1 1
AB
Y
OR
Y = A + B
A B Y0 0 00 1 11 0 11 1 1
AB
Y
13
More Two-Input Logic Gates
XNOR
Y = A + B
A B Y0 00 11 01 1
AB
Y
XOR NAND NOR
Y = A + B Y = AB Y = A + B
A B Y0 0 00 1 11 0 11 1 0
A B Y0 0 10 1 11 0 11 1 0
A B Y0 0 10 1 01 0 01 1 0
AB
Y AB
Y AB
Y
1001
14
Three variables K-maps
Id a b c f (a,b,c)
0 0 0 0 1
1 0 0 1 02 0 1 0 13 0 1 1 04 1 0 0 15 1 0 1 06 1 1 0 17 1 1 1 0
15
Corresponding K-map
0 2 6 4
1 3 7 5
b = 1
c = 1
a = 1
1 1 1 1
0 0 0 0
(0,0) (0,1) (1,1) (1,0)
c = 0
Gray code
f(a,b,c) = c’
16
Karnaugh Maps (K-Maps)• Boolean expressions can be minimized by combining
terms• K-maps minimize equations graphically• PA + PA = P
C 00 01
0
1
Y
11 10AB
1
1
0
0
0
0
0
0
C 00 01
0
1
Y
11 10AB
ABC
ABC
ABC
ABC
ABC
ABC
ABC
ABC
B C0 00 11 01 1
A0000
0 00 11 01 1
1111
11000000
Y
17
• Circle 1’s in adjacent squares• In the Boolean expression, include only the
literals whose true
K-map
C 00 01
0
1
Y
11 10AB
1
0
0
0
0
0
0
1
B C0 00 11 01 1
A0000
0 00 11 01 1
1111
11000000
Y
y(A,B)=A’B’
18
Another 3-Input example
Id a b c f (a,b,c)
0 0 0 0 0
1 0 0 1 02 0 1 0 13 0 1 1 04 1 0 0 15 1 0 1 16 1 1 0 -7 1 1 1 1
19
Corresponding K-map
0 2 6 4
1 3 7 5
b = 1
c = 1
a = 1
0 1 - 1
0 0 1 1
(0,0) (0,1) (1,1) (1,0)
c = 0
f(a,b,c) = a + bc’
20
Yet another example
Id a b c f (a,b,c,d)
0 0 0 0 1
1 0 0 1 12 0 1 0 -3 0 1 1 04 1 0 0 15 1 0 1 16 1 1 0 07 1 1 1 0
21
Corresponding K-map
0 2 6 4
1 3 7 5
b = 1
c = 1
a = 1
1 - 0 1
1 0 0 1
(0,0) (0,1) (1,1) (1,0)
c = 0
f(a,b,c) = b’
22
4-input K-map
01 11
01
11
10
00
00
10AB
CD
Y
0
C D0 00 11 01 1
B0000
0 00 11 01 1
1111
1
110111
YA00000000
0 00 11 01 1
0000
0 00 11 01 1
1111
11111111
11
100000
23
4-input K-map
01 11
1
0
0
1
0
0
1
101
1
1
1
1
0
0
0
1
11
10
00
00
10AB
CD
Y
0
C D0 00 11 01 1
B0000
0 00 11 01 1
1111
1
110111
YA00000000
0 00 11 01 1
0000
0 00 11 01 1
1111
11111111
11
100000
24
4-input K-map
01 11
1
0
0
1
0
0
1
101
1
1
1
1
0
0
0
1
11
10
00
00
10AB
CD
Y
Y = AC + ABD + ABC + BD
0
C D0 00 11 01 1
B0000
0 00 11 01 1
1111
1
110111
YA00000000
0 00 11 01 1
0000
0 00 11 01 1
1111
11111111
11
100000
25
K-maps with Don’t Cares
0
C D0 00 11 01 1
B0000
0 00 11 01 1
1111
1
110X11
YA00000000
0 00 11 01 1
0000
0 00 11 01 1
1111
11111111
11
XXXXXX
01 11
01
11
10
00
00
10AB
CD
Y
26
K-maps with Don’t Cares
0
C D0 00 11 01 1
B0000
0 00 11 01 1
1111
1
110X11
YA00000000
0 00 11 01 1
0000
0 00 11 01 1
1111
11111111
11
XXXXXX
01 11
1
0
0
X
X
X
1
101
1
1
1
1
X
X
X
X
11
10
00
00
10AB
CD
Y