52 views

In the question given below:-

https://gateoverflow.in/1413/gate2013-4

If i consider first bit as sign bit.. we can store my number in rest 7 bits. so in that case 127 is the largest number that can be stored. so why -127 isnt the answer?
| 52 views

+1 vote
Range will tell you which all number can be represented using the limited number of bits.
Range of 2's complement number with n bits is $-2^{n-1}$ to $2^{n-1}-1$ so the smallest number possible using 8 bits is $-2^{7}=-128$

So if we can represent -128 using 8 bits which is even smaller than -127 (as asked in the question) so -128 has to be the answer.
by Active (3.3k points)
edited
0
Can you justify your answer more briefly? Moreover what is the necessity of taking range under consideration here?
0
Check now.
0

@ Vikas Verma Can you help me out with this doubt?

https://gateoverflow.in/262259/digital-self-doubt

+1 vote