Log In
1 vote
A decimal number has $25$ digits. The number of bits required for its equivalent binary representation is approximately??

according to me I got $83$  but answer given Virtual gate is $75 $please check??? I am right or wrong
in Digital Logic
edited by

1 Answer

2 votes
Maximum number that can be represented with $n-bits$ in base $x$ $= x^n - 1$

Maximum no. with $25$ bits in $base-10$ $=$ $10^{25}-1$ and maximum number with $k$ bits in $base-2$ $= 2^x-1$

In order to be able to be represent every $25-bit$ decimal number with $k$ bits in binary $10^{25}-1 \leq 2^k -1$

$log_{2}(10^{25} ) \leq k$

$25*log_2{10} \leq k$

$k \geq 83.048$   $\rightarrow$ $k = 84$
i also doing  same but i have one more doubt how u write inequality like less than or equal  plz explian so answer differ as 83 or 84
k should be more than 83.048, means only 83 bits are not enough to represent 25 digit max decimal.

(like $\log_2(6) = 2.58$ , to represent 6 we need more than 2 bits in binary)
Yes, some numbers will not be covered if you use $83$ bits. and When using $84$ bits you will be able to cover all $25$ digit decimal numbers and also some $26$ digit numbers.

Related questions