All topics

s3.2.4

Changing Between Bases: Special Case

1,000 questions

A shortcut exists for converting between bases when one base is an integer power of the other (e.g., base-2 to base-8, since 8=238=2^3).

To convert from a smaller base to a larger base (mm to n=man=m^a):

Group the digits of the number in base mm into sets of aa. Convert each group from base mm to base 10, which gives you the corresponding digit in base nn. For example, to convert 1100010112110001011_2 to base-8, group into threes: [110001011][110 | 001 | 011]. Convert each group: 1102=6110_2=6, 0012=1001_2=1, 0112=3011_2=3. The answer is 6138613_8.

To convert from a larger base to a smaller base (nn to mm):

Convert each digit of the base-nn number into an aa-digit number in base mm. For example, converting 6439643_9 to base-3 (9=329=3^2, so a=2a=2): 69=2036_9 = 20_3, 49=1134_9 = 11_3, 39=1033_9 = 10_3. The answer is 2011103201110_3.

Practise this