Introduction                                                                                                                                   Print this page
<< Previous |  First |  Last |  Next >>       


Properties of Two's Complement Numbers

  1.   X plus the complement of X equals 0.
  2.   There is one unique 0.
  3.   Positive numbers have 0 as their leading bit ( MSB ); while negatives have 1 as their MSB .
  4.   The range for an n-bit binary number in 2's complement representation is from -2 (n-1) to 2 (n-1) - 1
  5.   The complement of the complement of a number is the original number.
  6.   Subtraction is done by addition to the 2's complement of the number.

Value of Two's Complement Numbers
For an n-bit 2's complement number the weights of the bits is the same as for unsigned numbers except of the MSB . For the MSB or sign bit, the weight is -2 n-1. The value of the n-bit 2's complement number is given by:

A 2's-complement = (a n-1 ) x (-2 n-1 ) + (a n-2 ) x (2 n-1 ) + ... (a 1 ) x (2 1 ) + a 0

For example, the value of the 4-bit 2's complement number 1011 is given by:

= 1 x -2 3 + 0 x 2 2 + 1 x 2 1 + 1
= -8 + 0 + 2 + 1
= -5

<< Previous |  First |  Last |  Next >>