1

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?

LM2357
  • 4,083
XBagon
  • 13

1 Answers1

2

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.

Paul
  • 2,795
  • I know two's complement. That's why i wondered, why would you make it so complicated. – XBagon Mar 07 '17 at 13:56
  • @XBagon I updated my answer – Paul Mar 07 '17 at 14:01
  • Leibniz is often credited with the discovery of binary arithmetic (using base 2), but he, himself, knew that this system had been discovered by the Chinese some 4000 years earlier. See Glaser's History of Binary and other Nondecimal Numeration, http://www.eipiphiny.org/books/history-of-binary.pdf I am getting old and am perhaps in my dotage, but I seem to recall that Leibniz also played around with a base three numeration using a negative. What I recall is not quite what you have in mind, but it did use negative numbers. – Airymouse Mar 07 '17 at 14:40