Professional Documents
Culture Documents
edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Functional Specications
There are many ways of specifying the function of a combinational device, for example:
Argh Im tired of word games
A B B C
Concise alternatives:
Truth Table
C 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 A 0 1 0 1 0 1 0 1 Y 0 1 0 1 0 0 1 1
truth tables are a concise description of the combinational systems function. Boolean expressions form an algebra in whose operations are AND (multiplication), OR (addition), and inversion Y = C B A + C BA + CBA + CBA (overbar).
Lab 1 is due Thursday 2/19 Quiz 1 is a week from Friday (in section)
6.004 Spring 2009 2/12/09
modied 2/12/09 10:01
Any combinational (Boolean) function can be specied as a truth table or an equivalent sum-of-products Boolean expression!
L04 - Logic Synthesis 1 6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 2
Straightforward Synthesis
We can implement SUM-OF-PRODUCTS with just three levels of logic. INVERTERS/AND/OR
A B C A B C A B C A B C
1) Write out our functional spec as a truth table 2) Write down a Boolean expression with terms covering each 1 in the output:
Y = C B A + C BA + CBA + CBA
3) Wire up the gates, call it a day, and declare success! This approach will always give us Boolean expressions in a particular form: SUM-OF-PRODUCTS
2/12/09 L04 - Logic Synthesis 3
Propagation delay -No more than 3 gate delays (assuming gates with an arbitrary number of inputs)
2/12/09
AND
AB Y 00 01 10 11 0 1 1 1
OR
AB Y 00 01 10 11
NAND
1 1 1 0
AB Y 00 01 10 11 1 0 0 0
NOR
A A N > D B 0 0 0 1 0 0 1 0
A 0 0 1 1
B > A 0 1 0 0
B 0 1 0 1
X O R 0 1 1 0
N O O R R 0 1 1 1 1 0 0 0
O N E 1 1 1 1
Hmmmm all of these have 2-inputs (no surprise) each with 4 combinations, giving 22 output cases
2 = 24 = 16
L04 - Logic Synthesis 5
22
CMOS gates are inverting; we can always respond positively to positive transitions by cascaded gates. But suppose our logic yielded cheap positive functions, while inverters were expensive
6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 6
A B C
3-inv
A
B C
B>A
0 1 0 0
AB Y 00 01 10 11 0 1 1 0
XOR
A B
A B
CHALLENGE: Come up with a combinational circuit using ANDs, ORs, and at most 2 inverters that inverts A, B, and C ! Such a circuit exists. What does that mean?
- If we can invert 3 signals using 2 inverters, can we use 2 of the pseudoinverters to invert 3 more signals? - Do we need only 2 inverters to make ANY combinational circuit?
A B A B
AB=A+B
AB=A+B
y
Hint: theres a subtle dierence between our 3-inv device and three combinational inverters! Is our 3-inv device LENIENT?
6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 7
A+B = AB
= = =
= = =
A3 A2 A1
A B
tpd = 1 tcd = 0
A 0 0 1 1
B 0 1 0 1
C 0 1 1 0
N tpd = O( ___ ) -- WORST CASE. Ah!, but what if we want more than 2-inputs
2/12/09
2/12/09
AN
... 2
log2N
22
21
Propagation delay: O(N) since each additional MOSFET adds C
O(N) O(log N)
log N N-input TREE has O( ______ ) levels... log N Signal propagation takes O( _______ ) gate delays. Question: Can EVERY N-Input Boolean function be implemented as a tree of 2-input gates?
tpd
Dont be mislead by the big O stu the constants in this case can be much smaller so for small N this plan might be the best.
2/12/09 L04 - Logic Synthesis 12
~4
6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 11 6.004 Spring 2009
Logic Simplication
Can we implement the same function with fewer gates? Before trying well add a few more tricks in our bag. BOOLEAN ALGEBRA: OR rules: a + 1 = 1, a + 0 = a, a + a = a AND rules: a1 = a, aO = 0, aa = a Commutative: a + b = b + a, ab = ba Associative: (a + b) + c = a + (b + c), (ab)c = a(bc) Distributive: a(b+c) = ab + ac, a + bc = (a+b)(a+c) Complements: a + a = 1, a a = 0 a + ab = a, a + a b = a + b Absorption:
a(a + b) = a, a( a + b) = ab
AB=A+B
C A
Pushing Bubbles
xyz = x + y + z
NOR-NOR
C A Y B
AB=A+B
C A Y B
You might think all these extra inverters would make this structure less attractive. However, quite the opposite is true. 6.004 Spring 2009 2/12/09
x + y = xy
L04 - Logic Synthesis 13
ab + a b = b, (a + b)( a + b) = b a + b = ab , a b = a + b
2/12/09 L04 - Logic Synthesis 14
Boolean Minimization:
An Algebraic Approach
Cant he come up with a new example???
B(1)
Y = CA + CB
CA
NOTE: The steady state behavior of these circuits is identical. They dier in their transient behavior.
and variable A:
Hey, I could write A program to do That!
1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1
A C
Y = C B A + CB A + CBA + C BA Y = C B A + CB + C BA Y = C A + CB
6.004 Spring 2009 2/12/09
CB
B
2/12/09
BA
L04 - Logic Synthesis 15 6.004 Spring 2009
Y = C A + CB + AB
Truth Table
0
Y
1
2-input Multiplexer
MUXes can be generalized to 2k data inputs and k select inputs
D00 D01 D10 D11 S0 S1
00 01 10 11
C 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
A 0 1 0 1 0 1 0 1
Y 0 1 0 1 0 0 1 1
CA
CB BA
0 1 1
S
0 1
S
S0 S 1
6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 17 6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 18
A 0 0 0 0 1 1 1 1
6.004 Spring 2009
B Cin Cout 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1
2/12/09
0 0 0 1 0 1 1 1 A,B,Cin
MUX Logic
Fn(A,B)
00 B1
S
A = B
0 1 2 3 4 5 6 7
A B0 11
S
Cout
Generalizing: In theory, we can build any 1-output combinational logic block with multiplexers.
Y= A B
A
L04 - Logic Synthesis 20
D1 D2 DN k
DECODER: k SELECT inputs, N = 2k DATA OUTPUTs. Selected Dj HIGH; all others LOW.
Have I mentioned that HIGH is a synonym for 1 and LOW means the same as 0
Co
FA S
Ci
000
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
Ci 0 1 0 1 0 1 0 1
S 0 1 1 0 1 0 0 1
Co 0 0 0 1 0 1 1 1
Shared decoder
NOW, we are well on our way to building a general purpose table-lookup device. We can build a 2-dimensional ARRAY of decoders and selectors as follows ...
6.004 Spring 2009 2/12/09 L04 - Logic Synthesis 21
For K inputs, decoder produces 2K signals, only 1 of which is asserted at a time -think of it as one signal for each possible product term.
A B CIN S COUT
2/12/09
Ci
A B CIN
COUT
Model: LOOK UP value of function in truth table... Inputs: ADDRESS of a T.T. entry ROM SIZE = # TT entries... 2N x #outputs ... for an N-input boolean function, size = __________
Summary
Sum of products
Any function that can be specied by a truth table or, equivalently, in terms of AND/OR/NOT (Boolean expression) 3-level implementation of any logic function Limitations on number of inputs (fan-in) increases depth SOP implementation methods NAND-NAND, NOR-NOR
ROMs
Decoder logic generates all possible product terms Selector logic determines which pterms are ored together
2/12/09