753 views
0 votes
0 votes
How 11010 is -6 ? According to me it should be -10 .

Please explain anyone.

2 Answers

Best answer
2 votes
2 votes

6 can be written in binary as 0110 

but in your query, it is given -6 so for storing we have to take its 2's complement i.e

(sign bit) 1010 (2's complement of 6) so it will be 11010

and for -10 we have its binary as 

(sign bit) 0110 (2's complement of 10) so it will be 10110 

selected by
0 votes
0 votes
There are three ways in which negative numbers can be expressed in binary:

1. Sign magnitude form

2. One's complement form

3. Two's complement form

Out of these Two's complement method is most popular and is used in modern computers. In this method negative of a number x is represented by taking two's complement of the number. The given number is represented in 2's complement representation. If MSB of number is 1, it is negative number. Since in our example MSB is 1, so the number is negative number and we can find magnitude of number by taking its 2's complement

I hope you know how to find 2's complement of a number.

So, when you take 2's complement of 11010, it will be 00110 which is binary equivalent of 6. So given binary string represents -6

Related questions

0 votes
0 votes
1 answer
1
HeartBleed asked Feb 4, 2019
1,314 views
Let Z = X – Y, X, Y, Z are signed magnitude numbers and X, Y are represented in n-bit numbers. To avoid overflow minimum number of bits would require for Z is _________...
0 votes
0 votes
1 answer
2
Aghori asked Nov 13, 2017
2,297 views
I think it is $8$ bits including sign bit. But given answer is $7$ bits. Am I wrong?