The result of binary addition of – 8 and – 2 in two’s complement form is :
10110
0110
1110
0111
Answer is Wrong!
Answer is Right!
This question was previously asked in
UPSC CISF-AC-EXE – 2023
– 8 = 01000
– 2 = 00010
– Find two’s complement of 8 (for -8):
– Invert bits: 10111
– Add 1: 10111 + 1 = 11000 (This is -8 in 5-bit two’s complement)
– Find two’s complement of 2 (for -2):
– Invert bits: 11101
– Add 1: 11101 + 1 = 11110 (This is -2 in 5-bit two’s complement)
– Perform binary addition:
11000 (-8)
+ 11110 (-2)
——-
110110
– In 5-bit two’s complement addition, the carry-out from the most significant bit is discarded if the result is within the representable range. The result within 5 bits is 10110.
– To verify 10110, it is a negative number (starts with 1). Take two’s complement: Invert (01001), add 1 (01010). 01010 is 10 in decimal. Since it was negative, 10110 represents -10.