Computer Architecture
Computer Architecture
Computer Architecture
Lecture – 1, 2
Text Books
Computer Architecture and Organization
Hayes J.P., McGraw-Hill.
Addition
Subtraction
Multiplication
Division
Half Adder
X0 Y0 S0 C0
X0 0 0 0 0
S0 0 1 1 0
1 0 1 0
Y0 C0 1 1 1 1
S0 = X 0 ⊕ Y0
C0 = X 0Y0
Full Adder
S0 = X 0 ⊕ Y0 ⊕ C−1
C0 = X 0Y0 + X 0C−1 + Y0C−1
Full Adder
Serial Binary Adder
Least expensive
circuit in terms of
hardware cost.
It adds the numbers bit
by bit and so requires
n clock cycle to
compute the sum of
two n-bit numbers.
Circuit size
independent of n.
Ripple Carry Adder
Cn-2 =1 indicates that the magnitude of the sum exceeds the n-1 bits
allocated to it.
v = Cn −1 ⊕ Cn −2 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
Carry-Lookahead Adder
It reduce the time required to form carry signals.
Two signals:
generate signal, gi = xiyi
propagate signal, pi = xi + yi
c0 = g0 + p0cin
c1 = g1 + p1g0 + p1p0cin
c2 = g2 + p2g1 + p2p1g0 + p2p1p0cin
c3 = g3 + p3g2 + p3p2g1 + p3p2p1g0 + p3p2p1p0cin
It limits n to 4.
Adder Expansion
If we replace n 1-bit adder stages in the n-bit ripple carry adder
with n k-bit adders, we obtain an nk-bit adder.