Professional Documents
Culture Documents
Ce04sl PDF
Ce04sl PDF
• can we improve the linear depth of our adder, making it run faster?
• the circuit may have a higher cost
• can we improve the linear depth of our adder, making it run faster?
• the circuit may have a higher cost
• Idea: We split the addition in two parts that can run in parallel.
• but: We can’t calculate the upper half of the sum if we don’t know
the carry-bit from the lower half.
• Solution: We calculate the upper half two times, once for carry=0
and once for carry=1
• Multiplication by hand:
1 2 1 4·
2 1
4 8
1 6 8
• Binary Multiplication works the same way. Lets look at 101·101:
1 0 1 · 1 0 1
1 0 1
0 0 0
1 0 1
1 1 0 0 1
this shifter with control line can perform LSH or RSH, c decides which
function to perform.
To multiply the binary numbers A and B and save the result into C :
1 Set i to 0 and C to 0
2 if bit i of B is 1, C =C +A
3 A=LSH(A)
4 i=i+1
5 if B has a bit i, goto 2.
6 C contains the product
This can be easily implemented with an adder, shifter and a place to store
the temporary result.
Number Representation
Overview
Signed Numbers
Substracting Numbers
Signed Magnitude
One’s Complement
Two’s Complement
00011001 25
11111010 -6
00010011 19
• another example:
00000101 5
11111010 -6
11111111 -1
Addition Overflow
01000000 64
01000001 65
10000001 -127
• The result is wrong! We call this an overflow error.
• When two numbers with the same sign are added and the result has
the other sign, overflow has occured.
• When two numbers with different signs are added, overflow cannot
occur.
Excess-n