Conversion of Signed Numbers to Two’s Complement

Signed Numbers are 8 bit quantities with the least significant 7 bits representing the magnitude and the most significant bit indicating the sign. 0 in this bit indicates the number is positive, and 1 indicates it is negative. There is no magnitude information in this 8th bit-just the sign.

To convert a negative signed number to two’s complement, first set the 8th bit to zero. Then invert all 8 bits. Finally add 1. An example follows:

Signed Number:

10001111

set the 8th bit to zero:

00001111

invert all 8 bits:

11110000

finally, add 1; resulting in the final two’s complement number:

11110001

 

If the 8th bit is 0, indicating that the signed number is positive, the number requires no conversion. It’s two’s complement representation is the same as the signed magnitude representation.

 


Home