[Math] Converting a number from one base to another without going through base 10.

number-systems

I have a problem. I am very good at converting numbers from base to base after going through base 10.
The question is, how can I do the conversions without going through base 10?

Thanks

Best Answer

You just do long division, remembering that you work in a different basis.

For example let us say that we want to change $254_{6}$ to basis $4$.

Since we have to divide by $4$ let us start by making the multiplication by $4$ table for basis $6$: $$4 \times 0 =0 ; 4 \times 1 =4 ; 4 \times 2 =12 ; 4 \times 3 =20 ; 4 \times 4 =24 ; 4 \times 5=32$$

Now by long division we get $25_{(6)}:4$ has $q=4, r=1$ and $14_{(6)}:4$ has $q=2, r=2$. This gives $$ 254_{(6)}:4 ; q=42, r=2$$

This gives us that the last digit is $2$.

Now when we divide $42_{6}$ to $4$ we get $q=10, r=2$. Thus second last digit is $2$.

Finally $10_{(6)} :4$ gives $q=1$ and $r=2$. The third last digit is $4$ and the first digit is $1$.

This gives $$254_{(6)}=1222_{(4)}$$