Roberto Waltman <> writes:
>> Keith Thompson wrote:
>>> A 2's-complement representation makes some operations easier,
>
>>And some harder.
>
> Could you expand this? What operations are easier using other
> representations? (Other than BCD, etc. for financial applications.)
The most obvious example is negation. In sign and magnitude, you
just invert the sign bit. In ones' complement, you invert every bit.
In two's complement, you invert every bit and then increment (which
can toggle every bit again).
This assumes that he difficulty of an operation is measured by the
number of bits that are affected, which probably isn't the case.
(Note the correct placement of the apostrophes: "two's complement"
and "ones' complement".)
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"