How many bits are required to represent any decimal number in the range from 0…
2021
How many bits are required to represent any decimal number in the range from 0 to 2n -1 in base 2?
- A.
n
- B.
n-1
- C.
2n-1
- D.
n+1
Attempted by 264 students.
Show answer & explanation
Correct answer: A
The maximum value that can be represented by n binary bits is calculated using the formula:
Max Value = 2n-1
Example: If n = 3 bits, the range is 0 to 23 - 1, which is 0 to 7.
Binary range for 3 bits: 000 to 111