How do computers store neg binary numbers?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
_buddha
Messages
6
Reaction score
0

Homework Statement


Which of the following numbers will be stored in an 8-bit computer as 11000001? This computer uses the 2's compliment convention.

a)-64 b)-63 c)63 d)64


Homework Equations


1's and 2's compliment


The Attempt at a Solution


The answer is -63 and after trial and error i get that answer, but I am just wondering what exactly happens to the actual number. This is what my understanding is, so since the first digit in the number is a 1, therefore its negative. And after converting it to its compliment i get 00111111, which equals to 63 in base 10. So therefore the answer is -63. Is this the correct way of handling this question?
 
Physics news on Phys.org
You can also just add the bits together, except remembering that for 2's complement, the MSB is negative.

-1 * 128 + 1 * 64 + 0 * 32 + 0 * 16 + 0 * 8 + 0 * 4 + 0 * 2 + 1 * 1 = -128 + 64 + 1 = -63