Ones' complement

A ones' complement system or ones' complement arithmetic is a system in which negative numbers are represented by the inverse of the binary representations of their corresponding positive numbers.

It is one of three common representations for negative integers in binary computers, along with two's complement and sign-magnitude.

That is, inverting all of the bits of a number (the logical complement) produces the same result as subtracting the value from 0.

Successors of the CDC 6600 continued to use ones' complement arithmetic until the late 1980s, and the descendants of the UNIVAC 1107 (the UNIVAC 1100/2200 series) still do, but the majority of modern computers use two's complement.

Positive numbers are the same simple, binary system used by two's complement and sign-magnitude.

Subtraction is similar, except that borrows, rather than carries, are propagated to the left.

The generation of negative zero becomes a non-issue if addition is achieved with a complementing subtractor.

In case 1, operand 1 is −0 so the result is produced simply by subtracting 1 from 1 at every bit position.

In case 2, the subtraction will generate a value that is 1 larger than operand 1 and an end-around borrow.