1

I did

$$31213111332_{4} = \\ 2*4^0+3*4^1+3*4^2+1*4^3+1*4^4+1*4^5+3*4^6+1*4^7+2*4^8+1*4^9+3*4^{10} = \\ 2*16^0+3*4^1+3*16^1+1*4*16^1+1*16^2+1*4*16^2+3*16^3+1*4*16^3+2*16^4+1*4*16^4+3*16^5 = \\ 2*16^0 + 3*4^1+7*16^1+5*16^2+7*16^3+6*16^4+3*16^5 = \\ 36757E_{16}$$

Which is correct but I have a question. What if $2*16^0+3*4^1$ was greater than 15 (F) ?

2 Answers2

2

Don’t worry. You would have at most $3*4^0+3*4^1=15\;(F)$, since base $4$ digits are at most $3.$

J. W. Tanner
  • 60,406
1

It's easier if you convert groups of two base-4 digits into one base-16 digit, from right to left:

$$ \begin{array}{rcl} 31213111332_{4} &=& 03_{4} \ 12_{4} \ 13_{4} \ 11_{4} \ 13_{4} \ 32_{4} \\&=& 3_{10} \ 6_{10} \ 7_{10} \ 5_{10} \ 7_{10} \ 14_{10} \\&=& 3_{16} \ 6_{16} \ 7_{16} \ 5_{16} \ 7_{16} \ E_{16} \\&=& 36757E_{16} \end{array} $$

Two base-4 digits correspond to $4$ bits, the size of a base-16 digit.

lhf
  • 216,483