How do computers store neg binary numbers?

AI Thread Summary
In an 8-bit computer using two's complement, the binary number 11000001 represents -63. The leading 1 indicates that the number is negative, and converting it to its two's complement yields 00111111, which equals 63 in decimal. The calculation confirms this by evaluating the binary value as -128 + 64 + 1, resulting in -63. Understanding two's complement is essential for accurately interpreting negative binary numbers. This method is crucial for handling binary arithmetic in computing systems.
_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
 
Back
Top