Index  Comments

The predominant method of representing negative integers in automatic computers is two's complement. As with many other aspects of automatic computers, this is a lesser system which should be discarded for better systems, but isn't. Two remaining systems are ones' complement and ``signed magnitude''. I prefer ``signed magnitude'', and the primary purpose of this article will be listing my reasoning.

Ones' complement requires minor adjustments in circuitry, and features two representations for zero. Unlike two's complement, both one's complement and ``signed magnitude'' are symmetrical around zero.

The two's complement system negates an integer by inverting its bits and adding one to the result; I believe its prime justification is the simplicity of the underlying circuitry, as the adder needs no difference from unsigned arithmetic and that integral comparator is similarly simplified. These are unacceptable excuses for keeping an inferior system in place, by the complexity of modern machinery.

As it requires no particular hardware support, it's not quite an insidious optimization, but leaving no better options for such operations is an insidious optimization, so it's worthwhile pointing out.

The ``signed magnitude'', which I prefer to call merely ``signed'', is certainly most ``intuitive'', resembling typical human notation and relying on no mathematical tricks. The two signs combine into a table indicating which operation is really to be performed. Rather than addition for subtraction, which already makes a separate subtraction questionable, subtraction and addition would be chosen by the signs; adding a negative number to a positive number actually performs a subtraction, and so on.

Signed integers also make some operations both unconditional and trivial, such as the absolute value function, which becomes an unconditional bit set. A prime reason signed integers interest me is the application for arbitrary-length numbers; negating such a representation is a O(1) operation, unlike two's complement; one's complement could gain some of this by having inversion built into selection, but this is still more complex. I'll list additional support for signed integers as it comes to me.