Addition of two negative numbers using 1's complement
Answers
Answer:
(i) -1010 and -0101
Solution:
- 1 0 1 0 ⇒ 1 0 1 0 1 (1’s complement)
- 0 1 0 1 ⇒ 1 1 0 1 0 (1’s complement)
0 1 1 1 1
1 carry
1 0 0 0 0
1’s complement of the magnitude bits of sum is 1111 and the sign bit is 1.
Hence the required sum is -1111.
Explanation:
For the addition of two negative numbers 1’s complements of both the numbers are to be taken and then added. In this case an end-around carry will always appear. This along with a carry from the MSB (i.e. the 4th bit in the case of sign-plus-magnitude 5-bit register) will generate a 1 in the sign bit. 1’s complement of the magnitude bits of the result of addition will give the final sum.