Conversions from Decimal

From Coder Merlin
< Number Systems
Revision as of 10:33, 23 January 2022 by Yong-yan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Conversions from Decimal


To convert a decimal (base 10) number to any other base, we simply repeatedly divide by the base until we have a quotient of zero. Specifically, the dividend starts with the number that we want to convert, the divisor will always be the base. The remainder of each successive operation indicates the digit in the new base first at the right-most position and then moving left. The quotient of each step becomes the dividend of the subsequent step.

Let’s first try converting the number 2810 to octal (base 8):

The dividend is the decimal number that we want to convert, in this case 28. The divisor is the base to which we want to convert, in this case 8. The remainder indicates each successive digit. We stop the process when the quotient is 0.

Step Dividend Divisor Quotient Remainder
1 28 8 3 4
2 3 8 0 3

So, 2810 is 348. (Remember that we read the remainder from bottom to top.)

Let’s try converting the number 56710 to octal:

Step Dividend Divisor Quotient Remainder
1 567 8 70 7
2 70 8 8 6
3 8 8 1 0
4 1 8 0 1

So, 56710 is 10678.

Let’s try converting the number 63,21510 to hexadecimal:

Step Dividend Divisor Quotient Remainder
1 63215 16 3950 15
2 3950 16 246 14
3 246 16 15 6
4 15 16 0 15

So, 63,21510 is hexadecimal [15][6][14][15], or more conventionally, F6EF16.
(Remembering that in hexadecimal, we use the digit “F” for 15, “E” for 14, etc.)


Finally, let’s convert the number 53410 to binary:

Step Dividend Divisor Quotient Remainder
1 534 2 267 0
2 267 2 133 1
3 133 2 66 1
4 66 2 33 0
5 33 2 16 1
6 16 2 8 0
7 8 2 4 0
8 4 2 2 0
9 2 2 1 0
10 1 2 0 1

So, 53410 is 10 0001 01102