Professional Documents
Culture Documents
1.
Unsigned representation: extend number with less bits to the left with zeros to match the larger number of bits (n bits)
If MSB in less bits number = 1 then extend number with less bits to the left with ones to match the larger number of bits (n bits)
If MSB in less bits number = 0 then extend number with less bits to the left with zeros to match the larger number of bits (n bits)
2.
Addition: - go to step 3
3.
Perform the addition between the two numbers. Consider to show the carry for each bit addition.
4.
Check for the overflow condition to know how many bits are containing your result
Unsigned representation:
Signed 2s complement representation: - If Carry-in to the sign bit & Carry-out are not similar then overflow occurs
5.
Overflow: -Full result is in n+1 bits one carry-out bit + n bits of result
No overflow: -Full result is in n bits (result of the addition) so the carry-out SHOULD be discarded whether it is 1 or 0
6.
Check for the sign of the result considering ALL bits of your result as derived in step 4
Unsigned representation:
Addition: -No ve number could happen When adding two unsigned (+ve) numbers
Subtraction:
7.
Result is -ve then a) Convert result to 2s-complement b) Use the rule (equation) c) Put ve sign in front of the value