Computer Science, asked by Dhanush7184, 1 year ago

There is a new data-type which can take as values natural numbers between (and including) 0 and 25. How many minimum bits are required to store this data-type.

Answers

Answered by Anonymous
0

There is a new data-type which can take as values natural numbers between (and including) 0 and 25. how many minimum bits are required to store this datatype.

Answered by jaskiran6565
0

Answer:

5 bits

Explanation:

The data type takes values from 0 to 25 including 0 and 25.

So, totally there are 26 distinct numbers.

5 bits are needed to represent 26 distinct numbers.

In general the formula for number of bits to represent  n  distinct values is  ceil(log2n)  

Therefore, number of bits needed to represent 26 numbers is  ceil(log226)=5

Thank you :)

Similar questions