Search code examples
binarynegative-number

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


What is the advantage of 2's complement over 1s' 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?


Solution

  • The primary advantage of two's complement over ones' complement is that two's complement only has one value for zero. Ones' 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: