The Gateway to Computer Science Excellence
0 votes
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?
in Digital Logic by Active (2.4k points) | 52 views

1 Answer

+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 by
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

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,492 answers
195,439 comments
100,699 users