EL2095 Digital System Optimizations (CH 4) : Sekolah Teknik Elektro Dan Informatika Institut Teknologi Bandung
EL2095 Digital System Optimizations (CH 4) : Sekolah Teknik Elektro Dan Informatika Institut Teknologi Bandung
Optimizations (CH 4)
Sekolah Teknik Elektro dan Informatika
Institut Teknologi Bandung
Introduction
We now know how to build digital circuits
Delay the time from inputs changing to new correct stable output
Size the number of transistors
For quick estimation, assume
Transforming F1 to F2 represents
an optimization: Better in all
criteria of interest
w
x
y
F1
w
x
y
6 transistors
1 gate-delay
w
x
F1 = wxy + wxy
(a)
= wx(y+y) = wx
F2
F2 = wx
(b)
F1
20
size
(transistors)
15
10
F2
1 2 3 4
delay (gate-delays)
(c)
Note: Slides with animation are denoted with a small red "a" near the animated items
Introduction
Tradeoff
Transforming G1 to G2
represents a tradeoff: Some
criteria better, others worse.
w
x
20 transistors
2 gate-delays
G1
w
y
z
G1 = wx + wy + z
18 transistors
3 gate-delays
x
y
z
G2
G2 = w(x+y) + z
20
size
(transistors)
15
G1
G2
10
5
1 2 3 4
delay (gate-delays)
Introduction
Tradeoffs
delay
size
size
Optimizations
delay
You cant build a car that is the most comfortable, and has the
best fuel efficiency, and is the fastest you have to give up
something to gain other things.
Example
F = xyz + xyz + xyz + xyz
F = xy(z + z) + xy(z + z)
F = xy*1 + xy*1
F = xy + xy
x
4 literals + 2
terms = 6
gate inputs
y
F
x
y
6 gate inputs =
18 transistors
1
y
m
y
1
1
m
x
0
n
F
1
m
y
0
n
y
x
0
0
ab + ab = a(b + b) = a*1 = a
Combining terms to eliminate a variable
c + d = c + d + d = c + d + d + d + d ...
Minimization
What
Why
How
Result
Is an application of adjacency
Procedure guarantees a minimal expression
Easy to use; fast
Problems include:
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
D
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
minterm
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
m0
m1
m2
m3
m4
m5
m6
m7
m8
m9
m10
m11
m12
m13
m14
m15
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
D
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
minterm
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
m0
m1
m3
m2
m6
m7
m5
m4
m12
m13
m15
m14
m10
m11
m9
m8
This helps but its still hard to see all possible adjacencies.
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
AB
CD
00
01
11
10
00 01 11 10
m0
m4
m12
m1
m5
m13
m7
m15
m6
m6
m7
m5
m3
m2
m4
m12
m13
m15
m14
m10
m11
m9
m8
m0
m4
m12
m8
m1
m5
m13
m9
m14
m3
m7
m15 m11
m2
m10
m2
m6
m14 m10
m3
m11
m1
m9
m0
m8
Karnaugh Map
LSB
x y
m0
m0
m1
m1
m2
m3
m2
m3
MSB
Karnaugh Map
MSB
Karnaugh Map
m0
m1
m2
m3
m4
m5
m6
m7
MSB
LSB
yz 00
x
01
11
10
m0
m1
m3
m2
m4
m5
m7
m6
Karnaugh Map
LSB
MSB x yz 00
0
0
1
01
11
10
Karnaugh Map
01
11
10
00
m0
m1
m3
m2
01
m4
m5
m7
m6
11
m12
m13
m15
m14
10
m8
m9
m11
m10
Karnaugh Map
01
11
10
00
01
11
10
K-map Minimization
For any cell in 2-D array, there are four direct neighbors
(top, bottom, left, right)
2-D array can therefore show adjacencies of up to four
variables
MSB
LSB
yz 00
x
LSB
yz
00
MSB wx
01
11
10
01
11
10
00
m0
m1
m3
m2
01
m4
m5
m7
m6
11
m12
m13
m15
m14
10
m8
m9
m11
m10
m0
m1
m3
m2
m4
m5
m7
m6
LSB
yz
00
wx
01
11
10
00
01
11
10
wxyz
wxyz
wyz
00
01
11
10
00
01
11
10
wx
wyz
Grouping 1s
Grouping 0s
Variable changes
Exclude
Exclude
Variable Constant 0
Incl. Complement
Incl. true
Variable Constant 1
Incl. true
Incl. Complement
K-maps
xyz
yz
00
01
11
10
00
01
11
10
00
01
11
10
xz
yz
yz
11
10
00
01
11
10
F=wxy+yz
yz
wx
01
00
yz
wx
wxy
yz
00
01
11
10
00
01
11
10
G=z
00
01
11
10
00
01
11
10
wx
Prime
implicant
implicant
cd 00
01
11
10
00
01
11
bcd
10
acd
acd
cd 00
01
11
10
00
01
11
10
ac
bcd
abd
abc
ac + abc + bcd
ac + abc + abd
cd 00
01
11
10
00
01
11
10
(a+c)(a+c+d)(a+b)
a+c
a+c+d
a+b
b+c
Minimize:
abcd
1. Convert to sum-of-products:
abcd
abcd abd
abcd
abcd
cd
ab
00
01
11
10
00
01
abc
11
abd
10
H = bd + abc + abd
bd
Exercise
F=f(x,y,z) = m(0,2,3,4,5,7)
K=f(w,x,y,z) = m(0,1,4,5,9,11,13,15)
L=f(a,b,c,d) = m(0,2,5,7,8,10,13,15)
J=f(x,y,z) = M(0,3,4,7)
T=f(w,x,y,z) = M(1,3,8,10,12,13,14,15)
01
11
10
000
001
011
12
13
15
14
010
11
10
00
01
11
10
100
16
17
19
18
101
20
21
23
22
111
28
29
31
30
110
24
25
27
26
00
01
11
10
000
001
011
010
00
01
11
10
100
101
111
110
(a,b,c,d,e) =
m(3,4,7,10,11,14,15,16,17,20
,26,27,30 31)
01
11
10
000
001
011
010
(a,b,c,d,e) =
m(3,4,7,10,11,14,15,16,17,20
,26,27,30 31)
Implicants
00
01
11
10
100
101
111
110
bd
ade
abcd
bcde
Exercise
f(A,B,C,D,E) = m(0,2,4,7,10,12,13,18,23,26,28,29)
f(A,B,C,D,E) = M(0,2,4,11,14,15,16,20,24,30,31)
Exercise
f(A,B,C,D,E) = m(0,2,4,7,10,12,13,18,23,26,28,29)
DE 00
ABC
01
11
10
000
001
011
010
00
01
11
10
100
101
111
110
Exercise
f(A,B,C,D,E) = M(0,2,4,11,14,15,16,20,24,30,31)
DE 00
ABC
01
11
10
000
001
011
010
00
01
11
10
100
101
111
110
f (B D E )(B C D)(A B D E )
(A B C E )(A C D E )
Other Exercise
00
01
11
10
00
01
11
10
ab
f(a,b,c,d) = a + bc + bd
bd
bc
a
Exercise
2,3,4,
detector
yz
Withou
x
t dont
cares:
0
F = xy
1
+ xyz
G
00
01
11
10
xy
a
xyz
1
yz
y
00
01
11
10
With dont
cares:
z F = y + z