Datapath Design - 1
Datapath Design - 1
Datapath Design
Book of John P. Hayes
Fixed-Point Arithmetic
✔ Addition
✔ Subtraction
✔ Multiplication
✔ Division
Half Adder
X 0 Y0 S0 C 0
0 0 0 0
X0 0 1 1 0
S0 1 0 1 0
1 1 1 1
Y0 C0
(b) Symbol
16 bit Adder
Overflow
✔ When the result of an arithmetic operation exceeds the standard word size
n, overflow occurs.
✔ Example: let n=8 X=11101011=23510 and Y=00101010=4210
Z= X+Y =11101011
+ 00101010
00010101 =2110 C7 =1
✔ The result of an addition simply wraps around when the largest number
2n-1 is exceeds.
✔ For n, the number range for unsigned number is 0 to 2n-1
Overflow
✔ We can never have overflow on adding a negative and positive number.
✔ Example: let n=8 X=11101011=-2110 and Y=00101010=+4210
Z= X+Y = 00010101 = 21 C7 =1
10
So, Cn-1 = 1 does not indicate overflow.
✔ Overflow in 2’s complement addition can result from adding 1) two
positive numbers or 2) two negative numbers.
✔ Case 1: Two numbers are positive.
Let n=4 +7 = 0111 +3 = 0011 so, 0111+0011 = 1010 so, cn-2 = 1
✔ Cn-2 =1 indicates that the magnitude of the sum exceeds the n-1 bits
allocated to it.
Overflow
✔ Case 2: Two numbers are negative.
Let n=4 -7 = 1001 -3 = 1101 so, 1001+1101 = 10110 so, cn-2 = 0
✔ Cn-2 =0 indicates the overflow.
✔ For n the number for 2’s complement number is +(2n-1-1) to -2n.
Overflow
✔ Zn-1Zn-2….Z0 : = Xn-1Xn-2…X0 + Xn-1 Yn-1 Cn-2 Zn-1 v
Yn-1Yn-2…Y0 0 0 0 0 0
✔ v = Xn-1Yn-1Cn-2 + Xn-1Yn-1Cn-2
✔ v = Cn-1 xor Cn-2 0 0 1 0 1
0 1 0 1 0
0 1 1 0 0
1 0 0 1 0
1 0 1 0 0
1 1 0 1 1
1 1 1 1 0
Ripple Carry Adder
✔ the carry signal propagate through the adder from right to left
✔ The maximum signal propagation delay is nd, where d is the delay of
a full-adder stage.
High Speed Adder
✔ Reduce the time required to form carry signals.
✔ Approach: To compute the input carry needed by stage i
directly from carrylike signals obtained from all the
preceeding stages i-1, i-2, ..,0.
✔ Adders that use this principle are called carry-lookahead
adders.
Carry Lookahead Adder