I am converting numbers between different bases without issues, but I'm struggling to understand the why the method I'm using works.
If I convert $A5$ (base 16) to base 8, I would do the following:
Turn $A5$ into binary (4 bits)
$A = 1010$
$5 = 0101$
$10100101$ (split into three bits) $= 010$ $100$ $101$
$010$ = 2
$100$ = 4
$101$ = 5
$A5$ (base 16) $= 245$ (base 8)
I know the answer is correct, but I don't understand why the binary is split into $X$ bits depending on the base, and how the value $X$ is chosen. If it's base 4, for example, how many bits should the binary be separated into when converting?
This approach only works when the base is a power of $2$. In that case you use $n$ bits when the base is $2^n$. In base $16=2^4$ you use four bits. There are $2^n$ binary strings of length $n$. In base $4=2^2$ you use $2$ bits.