-2

When storing a negative number with one's complement before you add the 1 for two's complement, why are all the bits other than the sign inverted? I suppose It would just be simpler if the only thing different was the sign. The only reason I can think of is it somehow make it easier for the computer.

Greener
  • 1,327
  • 3
  • 13
  • 19

2 Answers2

3

Because that what one's complement is defined to do. See http://en.wikipedia.org/wiki/Signed_number_representations

Richard Schneider
  • 34,944
  • 9
  • 57
  • 73
  • 2
    Yep, you're right: *History: The early days of digital computing were marked by a lot of competing ideas about both hardware technology and mathematics technology (numbering systems). `One of the great debates was the format of negative numbers, with some of the era's most intelligent people having very strong and different opinions`.* --http://bit.ly/iO68tw – John K Jun 09 '11 at 01:55
  • Thank you for the actual helpful answer John. – Greener Jun 09 '11 at 21:23
1

See, for example, http://en.wikipedia.org/wiki/One%27s_complement, or other sources a quick google can give you. Basically, yes, it makes addition and subtraction easier to implement compared to sign magnitude numbers (though 2's complement makes maths even easier).

Sysyphus
  • 1,061
  • 5
  • 10