Originally Posted by

**Stormey** Hi.

Hope it's the right place to post it (if not - please move it to the right forum).

I have a question regarding the transfer between numeral systems.

the way to convert, for example, the binary number $\displaystyle 101011001_{2}$ to decimal will be:

$\displaystyle 101011001_{2}= 1\cdot 2^8+0\cdot 2^7+1\cdot 2^6+0\cdot 2^5+1\cdot 2^4+1\cdot 2^3+0\cdot 2^2+0\cdot 2^1+1\cdot 2^0=345_{10}$

and, if I want to go back to a binary number:

$\displaystyle 345_{10} : 2 = 172_{10}$ , $\displaystyle r=1_{2}$

$\displaystyle 172_{10} : 2 = 86_{10}$ , $\displaystyle r=0_{2}$

$\displaystyle 86_{10} : 2 = 43_{10}$ , $\displaystyle r=0_{2}$

$\displaystyle 43_{10} : 2 = 21_{10}$ , $\displaystyle r=1_{2}$

$\displaystyle 21_{10} : 2 = 10_{10}$ , $\displaystyle r=1_{2}$

$\displaystyle 10_{10} : 2 = 5_{10}$ , $\displaystyle r=0_{2}$

$\displaystyle 5_{10} : 2 = 2_{10}$ , $\displaystyle r=1_{2}$

$\displaystyle 2_{10} : 2 = 1_{10}$ , $\displaystyle r=0_{2}$

$\displaystyle 1_{10} : 2 = 0_{10}$ , $\displaystyle r=1_{2}$

concatenating all the remainders togather, we'll get: $\displaystyle 101011001_{2}$

now, I do understand the logic behind this operations, but one thing is bothering me:

let's say I want to convert the same binary number to a 5-based (or even a 6 or a 7-based) number.

the only way to do it is to first convert $\displaystyle 101011001_{2}$ to $\displaystyle 345_{10}$ with the same method above, and only then to convert $\displaystyle 345_{10}$ to $\displaystyle 2340_{5}$ (using the second method, with the remainders).

Why isn't there a way to directly convert $\displaystyle 101011001_{2}$ to $\displaystyle 2340_{5}$?

What is stoping me from doing that?

Hope the the question is clear enough.

thanks in advanced.