0

One way of doing this is

$$34.2111_{10} =\\ 3*(2^3+2)+4*2^0+2*(2^3+2)^{-1}+1*(2^3+2)^{-2}+1*(2^3+2)^{-3}+1*(2^3+2)^{-4}=\\ (2+2^0)*(2^3+2)+2^2*2^0+2*(2^3+2)^{-1}+1*(2^3+2)^{-2}+1*(2^3+2)^{-3}+1*(2^3+2)^{-4}= \\ 2^4+2^2+2^3+2^1+2^2+?? = \\ 2^5+0*2^4+0*2^3+0*2^2+1*2^1+??=\\$$

1) How do I solve the decimal part?

2) Is there a faster way of doing this? The more calculations I make the greater the chance I make some mistake.

1 Answers1

1

You have already done the part to the left of the decimal point. To express $0.2111_{10}$ in binary:

$0.2111_{10}=\dfrac{2111}{10000}$

Multiply by $2$ to get $\dfrac{2111}{5000}$: this is $<1$, so the first binary digit is $0$.

Multiply by $2$ to get $\dfrac{2111}{2500}$: this is $<1$, so the second binary digit is $0$.

Multiply by $2$ to get $\dfrac{2111}{1250}$: this is $\ge 1$, so the third binary digit is $1$. Now we must subtract $1$ to get $\dfrac{861}{1250}$.

Multiply by $2$ to get $\dfrac{861}{625}$: this is $\ge 1$, so the fourth binary digit is $1$. Now we must subtract $1$ to get $\dfrac{236}{625}$.

And so on. For some starting points (e.g. $0.375$), this process ends with $0$. But for your example, the process is never-ending.

TonyK
  • 64,559