Mathematics, like the Nile, begins in munuteness, but ends in magnificence。
The first such event, which may have led to the loss of 28 human lives in February 1991, is the failure of the American Patriot missile battery in Dhahran, Saudi Arabia, to intercept a number of Iraqi Scud missiles. An investigation by the US general Accounting office blamed the incident on a software problem that led to in accurate calculation of elapsed time since the last system boot. It was explained that the system's internal clock measured time in tenths of a second. The measured time was then multiplied by a 24-bit trancated fractional representation of 1/10, with an erro of about (3/4)x10(-23) = 10(-7). Some error was unavoidable, because 1/10 does not have an exact binary representation.
Advantages of signed-magnitude representation include its intuitive appeal, conceptual simplicity, symmetric range, and simple negation by flipping or inverting the sign bit. The primary disadvantage is that addition of numbers with unlike signs (subtraction) must be hadled differently from that of same-sign operands.
Biased representation does not lend itself to simple arithmetic algorithms. Addition and subtraction become somewhat more complicated because one must subtract or add the bias from/to the reult of a normal add/subtract operation, since
x + y + bias = (x + bias) + (y + bias) - bias
x - y + bias = (x + bias) - (y + bias) + bias
For this reason, the practical use of biased representation is limited to the exponent parts of floating-point numbers, which are never multiplied or divided.
In the special case of r =2, the radix complement representation that corresponds to M=2^k is known as 2's complement.
The digit or diminished-radix complement representation is known as 1's complement in the special case of r =2.
In the complement system with the complementation constant M and the number representation range [-N, +P], addition is done by adding the respective unsigned representations (modulo M). Assuming that a selective complementer is available, addition and subtraction become essentially the same operation, and this the primary advantage of complement representations.
Two choices allow just this for fixed-point redix-r arithmetic with k whole digits and l fractional digits:
Radix complement M = r^k;
Digit or diminished-radix complement M = r^k - ulp;