The range of integers that can be represented by an n bit 2's complement…
2005
The range of integers that can be represented by an n bit 2's complement number system is
- A.
- 2n - 1 to (2n - 1 - 1)
- B.
- (2n - 1 - 1) to (2n - 1 - 1)
- C.
- 2n - 1 to 2n - 1
- D.
- (2n - 1 + 1) to (2n - 1 + 1)
Attempted by 878 students.
Show answer & explanation
Correct answer: A
Answer: -2^(n-1) to 2^(n-1) - 1
Derivation:
There are 2^n distinct bit patterns in an n-bit system.
One half of the patterns (2^(n-1)) represent negative numbers. In two's complement these negatives run from -2^(n-1) up to -1 (inclusive).
The other half represent zero and positive numbers, from 0 up to 2^(n-1) - 1 (inclusive).
Combining these gives the full range: -2^(n-1) to 2^(n-1) - 1.
Quick check (example): For n = 4, this yields -8 to 7, which matches standard 4-bit two's complement.