Logic Synthesis at MIT
Logic Synthesis at MIT
input A
input B
input C
Logic Synthesis
1
!
1
-its systematic!
-it works!
-its easy!
-are we done yet???
Lecture 2
INVERTER:
A B
A B
=A
Bubble indicates
inversion
AND:
= A" B
SUM-OF-PRODUCTS
OR:
output Y
3 binary inputs
so 23 = 8 rows in our truth table
Output 1 if at
least 2 out of 3 of
my inputs are a 1.
Otherwise, output 0.
= A+ B
!
3
Lecture 2
Straightforward Synthesis
We can use
SUM-OF-PRODUCTS
to implement any logic
function.
= A" B"C
= A" B"C" D
Propagation delay:
3 levels of logic
No more than 3 gate delays assuming gates with an arbitrary
number of inputs. But, in general, well only be able to use gates
with a bounded number of inputs (bound is ~4 for most logic
families).
Lecture 2
= A" B"C" D
Lecture 2
= A" B
A B
= A+ B
A B
INV
AND2
OR2
tPD
8ps
15ps
18ps
tCD
1ps
3ps
3ps
=A"B
A B
When designing with NANDs and NORs one often makes use of
De Morgans laws:
De Morgan-ized NAND symbol
NOR form:
A+ B = A" B
Lecture 2
AND/OR form
De Morgan-ized
Inverter
NAND/NAND form
NOR/NOR form
Lecture 2
10
Boolean Minimization:
Logic Simplification
An Algebraic Approach
!A + ! A = !
For any expression and variable A:
Y = A" B"C + A" B"C + A" B"C + A" B"C
!
!
Key to simplification:
equations that match the pattern of the LHS
(where b !
might be any expression) tell us that when b is true, the
value of a doesnt matter. So a can be eliminated from the equation,
getting rid of two 2-input ANDs and one 2-input OR.
6.111 Fall 2009
Lecture 2
Lecture 2
12
On to Hyperspace
K-Map: a truth table arranged so that terms which differ by exactly one
AB
00
01
11
10
1
010
000
01
11
111
101
13
01
11
10
Lecture 2
Finding Subcubes
AB
00
01
11
10
CD
00
01
11
00
10
1
01
11
10
AB
00
01
11
10
Lecture 2
CD
15
AB
14
10
001
Lecture 2
00
Again its cyclic. The left edge is adjacent to the right edge,
and the top is adjacent to the bottom.
011
110
100
CD
Why did he
shade that
row Gray?
AB
Z
00
00
01
11
00
01
11
10
10
16
Start by expressing your Boolean function using 0terms (product terms with no dont care care entries).
For compactness the table for example 4-input, 1output function F(w,x,y,z) shown to the right includes
only entries where the output of the function is 1 and
weve labeled each entry with its decimal equivalent.
1-terms:
0, 8
5, 7
7,15
8, 9
8,10
9,11
10,11
10,14
11,15
14,15
Example due to
Srini Devadas
Lecture 2
X
0
1
1
0
0
0
0
1
1
Y
0
0
1
0
0
1
1
1
1
Z
0
1
1
0
1
0
1
0
1
label
0
5
7
8
9
10
11
14
15
Look for pairs of 0-terms that differ in only one bit position and merge
them in a 1-term (i.e., a term that has exactly one entry). Next 1-terms
are examined in pairs to see if the can be merged into 2-terms, etc. Mark
k-terms that get merged into (k+1) terms so we can discard them later.
W
0
0
0
1
1
1
1
1
1
17
2-terms:
-000 [A]
01-1 [B]
-111 [C]
10010-0
10-1
1011-10
1-11
111-
8, 9,10,11
10,11,14,15
3-terms:
10-- [D]
1-1- [E]
none!
18
Dominated Columns
An X in the prime term table in row R and column C signifies that the 0term corresponding to row R is contained by the prime corresponding to
column C.
Some functions may not have essential primes (Fig. 1), so make arbitrary
selection of first prime in cover, say A (Fig. 2). A column U of a prime
term table dominates V if U contains every row contained in V. Delete the
dominated columns (Fig. 3).
0000
0101
0111
1000
1001
1010
1011
1110
1111
A
X
.
.
X
.
.
.
.
.
B
.
X
X
.
.
.
.
.
.
C
.
.
X
.
.
.
.
.
X
D
.
.
.
X
X
X
X
.
.
E
.
.
.
.
.
X
X
X
X
1. Prime table
A is essential
B is essential
0000
0001
0101
0111
1000
1010
1110
1111
D is essential
E is essential
Each row with a single X signifies an essential prime term since any prime
implementation will have to include that prime term because the
corresponding 0-term is not contained in any other prime.
Lecture 2
B
.
X
X
.
.
.
.
.
C
.
.
X
X
.
.
.
.
D
.
.
.
X
.
.
.
X
E
.
.
.
.
.
.
X
X
F
.
.
.
.
.
X
X
.
G
.
.
.
.
X
X
.
.
H
X
.
.
.
X
.
.
.
0101
0111
1000
1010
1110
1111
B
X
.
.
.
.
.
C
X
X
.
.
.
.
D
.
X
.
.
.
X
E
.
.
.
.
X
X
F
.
.
.
X
X
.
G
.
.
X
X
.
.
H
.
.
X
.
.
.
C dominates B,
G dominates H
C
X
X
.
.
.
.
D
.
X
.
.
.
X
E
.
.
.
.
X
X
F
.
.
.
X
X
.
G
.
.
X
X
.
.
C is essential
G is essential
Selecting C and G
shows that only E is
needed to complete
the cover
This gives a prime cover of {A, C, E, G}. Now backtrack to our choice of
A and explore a different (arbitrary) first choice; repeat, remembering
minimum cover found during search.
A
X
X
.
.
.
.
.
.
19
Lecture 2
20
Ci
0
0
0
0
1
1
1
1
2. If the size of the selected set of primes equals or exceeds the best solution thus far return
from this level of recursion. If there are no elements left to be contained, declare the selected
set as the best solution recorded thus far.
3. Heuristically select a prime.
4. Add the chosen prime to the selected set and create a new table by deleting the prime and all
0-terms that are contained by this prime in the original table. Set T to this new table and go to
Step 1.
!
!
21
B
C
If C is 1 then
copy B to Y,
otherwise copy
A to Y
2-input Multiplexer
B
C
Co
FA
Ci
0
0
11S
I2
0
0
I3 1
1S
00
01
11
10
C/AB
00
01
11
10
22
A 4-input Mux
implemented as
a tree
I0 0
0
I1 11
S
C/AB
CO
S0
S1
Gate
symbol
Lecture 2
A B
Systematic Implementation of
Combinational Logic
C
schematic
Full Adder
Lecture 2
Truth Table
Y
Co
0
0
0
1
0
1
1
1
S
0
1
1
0
1
0
0
1
B
0
1
0
1
0
1
0
1
Then, create a new table by deleting the chosen prime from the original table without adding it to
the selected set. No 0-terms are deleted from the original table. Set T to this new table and go
to Step 1.
A
0
0
1
1
0
0
1
1
23
Full-Adder
Carry Out Logic
0
0
0
1
1
0
1
1
0
1
2
3
4
5
6
7
Cout
A,B,Cin
Lecture 2
24
Systematic Implementation of
Combinational Logic
Same function as on previous slide, but this
time lets use a 4-input mux
Full-Adder
Carry Out Logic
0
Cin
Cin
1
0
1
2
3
Cout
XC2V6000:
957 pins, 684 IOBs
CLB array: 88 cols x 96/col = 8448 CLBs
18Kbit BRAMs = 6 cols x 24/col = 144 BRAMs = 2.5Mbits
18x18 multipliers = 6 cols x 24/col = 144 multipliers
A,B
Lecture 2
25
Virtex II CLB
Lecture 2
Lecture 2
26
Lecture 2
28
Virtex II Sum-of-products
Wide fan-in OR
Lecture 2
29