Can you justify your answer more briefly? Moreover what is the necessity of taking range under consideration here?

The Gateway to Computer Science Excellence

0 votes

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?

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

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.

0

Can you justify your answer more briefly? Moreover what is the necessity of taking range under consideration here?

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,378 answers

198,522 comments

105,313 users