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

pranphy picture pranphy · Jun 15, 2012 · Viewed 96.1k times · Source

What is the advantage of 2's complement over 1's complement in negative number representation in binary number system? How does it affect the range of values stored in a certain bit representation of number in binary system?

Answer

JYelton picture JYelton · Jun 15, 2012

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: