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.
Asked
Active
Viewed 324 times
-2
-
1having +0 and -0 is troublesome at best – msw Jun 09 '11 at 01:59
2 Answers
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
-
2Yep, 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
-
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