Is there a binary system where $1000 = -1 $? And if not, why?

61 Views Asked by At

My first thought after seeing that $0000 = 0$ and $1000 = -0$ waste one possible number, was to start negative numbers with $1000 = -1$. So that you just have to write the number flip the first bit and subtract one. It's way easier to see which number is meant, for humans at least. Why isn't it used nor mentioned on Wikipedia as a possible approach?

1

There are 1 best solutions below

3
On

A different but similar system as you describe is used to store signed integers in computers: Two's complement

The following reason is probably why two's complement is used instead of your system: (from Wikipedia)

The two's-complement system has the advantage that the fundamental arithmetic operations of addition, subtraction, and multiplication are identical to those for unsigned binary numbers (as long as the inputs are represented in the same number of bits and any overflow beyond those bits is discarded from the result). This property makes the system both simpler to implement and capable of easily handling higher precision arithmetic.

So a processor needs only one add instruction, not one for adding two unsigned (non-negative) numbers and one for adding two signed numbers, which would be the case with your system.