Docsity

Understanding Binary Addition: From Half-Adder to Ripple Carry Adder, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
Adder
In order to construct a CPU, we need to perform arithmetic and logical operations.
Basic arithmetic operator: addition
What's involved in adding binary numbers?
carry
0110
decimal
0011 3
0110 6
result
1001 9
In each column:
input: add 2 bits, along with a carry bit from the previous result
output: 1 bit result, 1 bit carry
Half-adder
adds 2 bits (
x, y
), generates sum (
s
) and carry (
c
)
(note that previous carry is being ignored)
Truth table
Boolean expressions:
xysc
0000
s = \xy + x\y = x XOR y
0110
c = xy
1010
1101
pf3
pf4
pf5

Partial preview of the text

Download Understanding Binary Addition: From Half-Adder to Ripple Carry Adder and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Adder

In order to construct a CPU, we need to perform arithmetic and logical operations. Basic arithmetic operator: addition What's involved in adding binary numbers? carry 0 1 1 0 decimal 0 0 1 1 3 0 1 1 0 6 result 1 0 0 1 9 In each column: input: add 2 bits, along with a carry bit from the previous result output: 1 bit result, 1 bit carry Half-adder adds 2 bits ( x, y ), generates sum ( s ) and carry ( c ) (note that previous carry is being ignored)

Truth table Boolean expressions: x y s c 0 0 0 0 s = \xy + x\y = x XOR y 0 1 1 0 c = xy 1 0 1 0 1 1 0 1

Half adder: circuit

s = \xy + x\y = x XOR y c = xy Circuit: Black box:

Ripple carry adder

adding k-bit values ripple-carry adder: combine k 1-bit full adders 3-bit ripple-carry adder

Notice that 0 is hard-wired as carry-in for rightmost full adder (could have used half adder)

Adder delay

Ripple-carry adder is logically correct, but may be slow. Each circuit requires a finite amount of time to give stable outputs when inputs change. Circuits are working in parallel, but it takes a finite amount of time before the carry-in from one circuit is available for the next one to use. Assume time T for each FA to generate output. n-bit ripple carry adder has O(n) delay: nT

Speed can be improved by using "carry-lookahead": compute carries in parallel