Q:How is signed negative numbers stored in memory?
Q: How is -1 represented in memory?
A:
In most intel architectures, signed negative numbers are stored in memory as two's Complement.
eg.
-1 will be stored as 11111111,
-2 as 11111110,
-3 as 11111101
Comments
why the negative numbers are stored in 2's complement?
is there anyone who can tell me why the negative numbers are stored in 2's complement.
2's complement
Because doing addition and subtraction using 2's complement on hardware doesn't require any pre-processing (checking the sign bit of the number). Check out the wikipedia page http://en.wikipedia.org/wiki/Two's_complement