Professional Documents
Culture Documents
Some combinational circuits are very comment and it is worth looking at them in more detail. One particular class of very useful circuits are arithmetic circuits; i.e., those circuits used for performing operations such as: addition, subtraction, multiplication, etc. of binary numbers.
Page 1
Page 2
!x y x !y x y sum
x y
sum
cout
cout
Page 3
Binary full-adders
Most commonly, we are interested in adding n-bit numbers. Therefore, we need to be able to also handle a carry in signal. The circuit implementing these two functions is known as a binary fulladder.
Page 4
sum
cout cin
cout
Note that the 2-nd implementation uses 2 half-adders to implement the full-adder.
Page 5
FA
FA
FA
FA
We might want to think about the performance (delay) of this adder circuit
Page 6
The delay of the longest path tells us the minimum amount of time that we need to wait for the output to be correct.
x y
sum
FA
cout cin
FA
FA
FA
Page 7
x y
sum
FA
FA
FA
FA
cout cin
We can compute the longest path for an n-bit ripple adder as follows:
Page 8
Write the carry out ci+1 in terms of the pi and gi signals instead.
Page 9
We have written the carries in terms of values all computed when the inputs are applied to the circuit: All pi and gi are computed after 1 gate delay. All ci are then computed after 2 more gate delays, since the are 2-level SOP in terms of pi and gi.
Page 10
Page 11
4-CLA
4-CLA
4-CLA
4-CLA
Performance will be 3+2+2+2 = 9 units of gate delay to get c16 (notice a ripple adder would have required 2(16)+1 = 33 units of delay.
Page 12
8-bit adder design type ripple (8, 1-bit FA) 4, 2-bit CLA 2, 4-bit CLA 1, 8-bit CLA delay 17 gates 7 gates 5 gates 3 gates cost 120 140 188 316 max gate 2 3 5 9
350 300 250 200 150 100 50 0 ripple (8, 1-bit FA) 4, 2-bit CLA 2, 4-bit CLA 1, 8-bit CLA Delay Area
Page 13
Practical comments
There is another point in generating carry look-ahead for high numbers of bits
If we dont have a large enough gate, we might have to decompose the gate into smaller gates; e.g., say we need a 5-input AND gate, but only have 2-input AND gate
We might need to do something like:
Page 14
Page 15
Overflow detection
When two n-bit binary numbers A and B are added together and the sum requires (n+1) bits, we say an overflow has occurred. True to either signed or unsigned arithmetic. Overflow is a problem for digital computation since we are limited in the number of bits available to represent a number. Detection of overflow depends on whether the numbers are signed or unsigned.
Page 16
Page 17
Examples of overflow: assume 8-bits available (-128 to +127); carry into and out of the MSB shown.
Page 18
C V
FA (MSB)
FA
FA
Page 19
Binary multipliers
Multiplication of binary numbers works exactly like in decimal:
Since numbers are binary, the multiplication of a_i (multiplier bit) with B can be done with AND. When a_i = 0, we add 0 to the partial product. When a_i = 1, we add the multiplicand to the partial product. To multiply 2, n-bit numbers we need 2n-bit output.
Page 20
Page 21
ppi bi aj
FA
Page 22