Advantage of 2’s complement over 1’s complement?

The primary advantage of two’s complement over one’s complement is that two’s complement only has one value for zero. One’s complement has a “positive” zero and a “negative” zero.

Next, to add numbers using one’s complement you have to first do binary addition, then add in an end-around carry value.

Two’s complement has only one value for zero, and doesn’t require carry values.

You also asked how the range of values stored are affected. Consider an eight-bit integer value, the following are your minimum and maximum values:

Notation     Min   Max
==========  ====  ====
Unsigned:      0   255
One's Comp: -127  +127
Two's Comp: -128  +127

References:

  • http://en.wikipedia.org/wiki/Signed_number_representations
  • http://en.wikipedia.org/wiki/Ones%27_complement
  • http://en.wikipedia.org/wiki/Two%27s_complement

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)