# How Computers Store Negative Numbers (Using -11 as Case Study).
Computer uses different methods to represent negative numbers in biniary form, we would take a look at three common methods by which computer represents negative numbers in binary form: First is the Sign and Magnitude, second is the one's compliment, and third is the Two's Compliment Using -11 as a case study.
# Sign and Magnitude.
sign and magnitude uses the most significant bit (MSB) to represents the sign of the number (0(positive) and 1(negative)),the remaining bits stands for the magnitude of the number.Using -11 for Example,the sign aand the magnitude would be:
1 0001011
1 represents the most significant bit (MSB) for Negative number and 00001011 represents the magnitude of the absolute value (11).
# One's Complement
In One's Complement, negative numbers are represented by inverting all the bits of the corresponding positive number.To represent -11 One's Complement,firstly, we find the binary representation of 11 which is 00001011 the we invert all the bits:
11110100
The inverted bits represents the One's Complement representation of -11.
# Two's Complement
To represent a negative number in Two's Complement, we fisrt find the binary representation of the absolute value of the number (11), then we Invert all the bits One's Complement), and Lastly, Add 1 to the result.
following the steps above, lets the two's compliment for -11.
1. The binary representation of11 is:
00001011
2.For us to find the One's compliment, we invert the bits by changing the 0s to 1s and 1s to 0s ( i.e negative and positive and positive to negative), which would be:
11110100
3. Then Finally we add 1 to the result of the one's compliment:
11110100 + 1 = 11110101
From this we can say that the two's Complement representation of -11 is:
11110101
# Corresponding Hexadecimal Value
To find the hexadecimal value, we divide the binary value to nibbles and then find the corresponding Hexadecimal Value from there:
for 11110101 (binary)
When divided to nibbles we have
* 1111= F (hexadecimal)
* 0101= 5 (hexadecimal)
Therefore, the corresponding hexadecimal represention of 11110101(binary)= OxF5 (hexadecimal).