The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+13 votes

Consider n-bit (including sign bit) 2's complement representation of integer numbers. The range of integer values, $N$, that can be represented is _____ $\leq N \leq $_____ .

+21 votes

Best answer

-2^{n-1} <= N <= 2^{n-1} -1

Example : let we have 3 bit binary no (unsigned )

000 (0) to 111(7) total of 8 (2^{3}) no.

but when we have one signed bit then we have half of negative -4 to -1 and 0 and 1 to 3

bit pattern: 100 101 110 111 000 001 010 011 1's comp: -3 -2 -1 0 0 1 2 3 2's comp.: -4 -3 -2 -1 0 1 2 3

- All categories
- General Aptitude 1.6k
- Engineering Mathematics 7.3k
- Digital Logic 2.7k
- Programming & DS 4.9k
- Algorithms 4.2k
- Theory of Computation 5.4k
- Compiler Design 2.1k
- Databases 4k
- CO & Architecture 3.5k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 570
- Exam Queries 566
- Tier 1 Placement Questions 23
- Job Queries 70
- Projects 18

48,691 questions

52,776 answers

183,434 comments

68,389 users