






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!































Operation Add
Magnitud
e
Subtract Magnitude
When A>B When A<B When A=B
(+A)+(+B) +(A+B)
(+A)+(-B) +(A-B) -(B-A) +(A-B)
(-A)+(+B) -(A-B) +(B-A) +(A-B)
(-A)+(-B) -(A+B)
(+A)-(+B) +(A-B) -(B-A) +(A-B)
(+A)-(-B) +(A+B)
(-A)-(+B) -(A+B)
(-A)-(-B) -(A-B) +(B-A) +(A-B)
Hardware Requirement
Parallel Adder for the Microoperation
Comparator to establish A>B,A<B or A=B
Two parallel Subtractor to perform the
Microoperation A-B and B-A
A XOR gate to determine sign of the
result
A register
AVF
E
B
s
A
s
B register
Complementer
Parallel Adder
S
Load
Sum
M
Mode
Control
Input
Carry
Output
Carry
Addition and subtraction in
S+M
2’s Complement Representation
AC-BR
AC<-AC+BR+
V<-Overflow
End
AC+BR
AC<-AC+BR
V<-Overflow
End
Basic adders
Circuits to add two n bit unsigned binary
numbers
▫
Serial adder
▫ Parallel adders
Ripple carry Adder
Carry lookahead adder
Serial adder
Least expensive in
terms of hardware
N clock cycle to
compute sum of n
bit no.’s
1 bit
adder
Carry
in C i-
Carry
out Ci
Q D
Yi
Xi
Zi
Ripple carry adder - limitation
Large signal propagation delay
Gate Delay
▫
Time taken by the signal to propagate
through the logic gate
x
x’
1
0
gate delays
Delay’s in ripple carry adder
1
2
3
4
5
6
7
8
9
For an n-bit ripple carry adder, the
longest path has 2n+1 gates
4x2+1=
64 bit->2x64+1 =129 gates
Carry look ahead adder
Compute the input carry needed by stage i
directly from carry like signals from preceding
stages rather than wait for carry to ripple
▫ The “generate” function g
i
produces 1 when there
must be a carry out from position i (i.e., when A
i
and B
i
are both 1). g
i
= A
i
B
i
▫ The “propagate” function p
i
is true when, if there is
an incoming carry, it is propagated (i.e, when A
i
=
or B
i
=1, but not both). p
i
= A
i
B
i
▫Then we can write Carry out as C
i
= g
i
i
C
i-
1
▫ Sum equation for stage I Z
i
= p
i
g
i
C
i-
Carry look ahead adder
A
i
B
i
C
i
C
i+ 1
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Generate
Propagate
4 stage Carry Look Ahead
Adder
1
= g
0
0
c
0
2
= g
1
1
c
1
= g
1
1
(g
0
0
c
0
)
= g
1
1
g
0
1
p
0
c
0
3
= g
2
2
c
2
= g
2
2
(g
1
1
g
0
1
p
0
c
0
)
= g
2
2
g
1
2
p
1
g
0
2
p
1
p
0
c
0
4
= g
3
3
c
3
= g
3
3
(g
2
2
g
1
2
p
1
g
0
2
p
1
p
0
c
0
)
= g
3
3
g
2
3
p
2
g
1
3
p
2
p
1
g
0
3
p
2
p
1
p
0
c
0
4 bit carry look ahead adder