Suppose we have a decimal like 0.25 and we want to convert it to binary, one of the methods goes like this:
Multiplying the decimal by 2 repeatedly:
0.25 * 2 = {0}.50 | {0}
0.50 * 2 = {1}.00 | {1}
0.00
--------------------------
.01
0.01
Why does this work?
Let $r$ be a real number between $0$ and $1$. The first digit in the base $b$ representation of $r$ is the number of times $1/b$ goes into $r$ -- or, to be more precise, it's the largest whole number $n_1$ with the property that $$n_1\cdot\frac{1}{b} \le r$$ This condition is equivalent to $$n_1 \le br$$ Another way of saying this is that the first digit is the largest whole number less than or equal to $br$. So to find the first digit of the base $b$ representation, multiply $r$ by $b$ and take the integer part.
Similarly, the second digit of the base $b$ representation of $r$ is the largest whole number $n_2$ with the property that $$n_2 \cdot \frac{1}{b^2} \le r - \frac{n_1}{b}$$ Equivalently, $$n_2 \le b^2 r - b\cdot n_1$$ Therefore you can find the second digit by computing $b^2 r - b\cdot n_1$ and just keeping the integer part. This continues for each digit in the base $b$ expansion.