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.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,647 questions

56,492 answers

195,439 comments

100,699 users