How many bits it takes to save numbers in a range 0 to 29?
We can calculate the number range which can be represented by the number of bits.
Let us consider that the number of bits required is N.
Now in binary digits there are only 2 representation available i.e 1 and 0.
There by the maximum number represented by the number of bit calculated as 2N-1 in case of unsigned integer.
If the value of N=4, it can represent the range of integers from 0 to 15 as 24-1=15.
If the value of the N=5,it can represent from the range of integer from 0 to 31 as 25-1=31.
There by the number of bits required to represent the range of integers from 0 to 29 in unsigned integer form is 5.
Get Answers For Free
Most questions answered within 1 hours.