Question discussion

10001 is the 2’s complement of which of the following number in 2’s complement representation?

172011Medium 1 reply 977 views

Discussion 1

0
CCommunity
In two's-complement representation, positive numbers are simply represented as themselves, and negative numbers are represented by the two's complement of their absolute value.

Since 10001 starts with 1, hence the number is negative. Now we Change the sign to get the magnitude of the number.

1 0 0 0 1 ® 0 1 1 1 0

Now subtract 1 from magnitude,

0 1 1 1 0

+ 1

0 1 1 1 1 = (15)10

Hence the answer is (-15).