Decimal Number Conversions
A decimal number can be represented in other number systems without changing its value. In ICT, decimal numbers are commonly converted to binary, octal, and hexadecimal because computers use binary internally, while octal and hexadecimal provide shorter ways to write binary values.
This note explains how to convert a decimal number to each of these number systems using the repeated division method.
Number systems and their bases
A number system is a method of representing numbers using a set of digits and rules. The base, also called the radix, tells us how many different digits are available in that system.
| Number system | Base (radix) | Digits / symbols used |
|---|---|---|
| Binary | 2 | 0, 1 |
| Octal | 8 | 0โ7 |
| Decimal | 10 | 0โ9 |
| Hexadecimal | 16 | 0โ9 and AโF |
In hexadecimal, the letters represent values greater than 9:
| Decimal value | Hexadecimal digit |
|---|---|
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Key Idea: When converting a decimal number to another base, divide by the target base. The remainders form the digits of the answer.
The repeated division method
The repeated division method is used to convert a whole decimal number to binary, octal, or hexadecimal.
Follow these steps:
- Divide the decimal number by the target base (2, 8, or 16).
- Record the remainder.
- Divide the quotient from the previous step by the same base.
- Continue until the quotient becomes 0.
- Read the remainders from bottom to top. This gives the converted number.
The first remainder is the rightmost digit of the answer, so the remainders must be read in reverse order.
Decimal to binary conversion
To convert a decimal number to binary, repeatedly divide it by 2. Each remainder will be either 0 or 1, which are the only digits used in binary.
Example: Convert 25โโ to binary| Division | Quotient | Remainder |
|---|---|---|
| 25 รท 2 | 12 | 1 |
| 12 รท 2 | 6 | 0 |
| 6 รท 2 | 3 | 0 |
| 3 รท 2 | 1 | 1 |
| 1 รท 2 | 0 | 1 |
Read the remainders from bottom to top: 11001.
Therefore:
25โโ = 11001โ
The subscript indicates the base: โโ means decimal and โ means binary.
Decimal to octal conversion
To convert a decimal number to octal, repeatedly divide it by 8. The remainders are between 0 and 7, matching the digits available in octal.
Example: Convert 83โโ to octal| Division | Quotient | Remainder |
|---|---|---|
| 83 รท 8 | 10 | 3 |
| 10 รท 8 | 1 | 2 |
| 1 รท 8 | 0 | 1 |
Read the remainders from bottom to top: 123.
Therefore:
83โโ = 123โ
Each remainder is one octal digit. No remainder in this example is greater than 7.
Decimal to hexadecimal conversion
To convert a decimal number to hexadecimal, repeatedly divide it by 16. A remainder from 10 to 15 is written using the letters A to F.
Example: Convert 250โโ to hexadecimal| Division | Quotient | Remainder |
|---|---|---|
| 250 รท 16 | 15 | 10 (A) |
| 15 รท 16 | 0 | 15 (F) |
Read the remainders from bottom to top: FA.
Therefore:
250โโ = FAโโ
The remainder 10 is written as A, and the remainder 15 is written as F. The final answer is FA, not AF, because remainders are read from bottom to top.
Quick examples
The same division process can be applied to other decimal values.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 19โโ | 10011โ | 23โ | 13โโ |
| 45โโ | 101101โ | 55โ | 2Dโโ |
| 31โโ | 11111โ | 37โ | 1Fโโ |
| 64โโ | 1000000โ | 100โ | 40โโ |
| 72โโ | 1001000โ | 110โ | 48โโ |
| 100โโ | 1100100โ | 144โ | 64โโ |
| 256โโ | 100000000โ | 400โ | 100โโ |
| 409โโ | 110011101โ | 635โ | 199โโ |
Why does the method work?
A number written in a positional number system is made up of digits whose values depend on their positions. When a number is divided by a base, the remainder identifies the value of the rightmost digit in that base. The quotient contains the value represented by the remaining higher positions.
Repeating the division extracts the digits from right to left. Reading the remainders in reverse order puts the digits in their normal left-to-right order.
For example, when converting 25 to binary:
- 25 รท 2 leaves remainder 1, the rightmost binary digit.
- The next division leaves 0, the next digit to its left.
- Continuing in this way produces the digits from least significant to most significant.
Common mistakes to avoid
- Dividing by the wrong base: use 2 for binary, 8 for octal, and 16 for hexadecimal.
- Reading remainders in the wrong direction: always read from bottom to top.
- Stopping too early: continue until the quotient becomes 0.
- Writing hexadecimal remainders incorrectly: use A, B, C, D, E, and F for values 10, 11, 12, 13, 14, and 15.
- Confusing the quotient with the remainder: record the remainder at every division; the remainders form the converted answer.
Exam-focused points
Key Idea: The repeated division method converts a decimal whole number to another base by repeatedly dividing by the target base and recording each remainder.
Key Idea: The remainders must be read from bottom to top, because the first remainder is the least significant (rightmost) digit.
Key Idea: In hexadecimal, remainders 10โ15 are represented by AโF respectively.
Summary
To convert a whole decimal number to binary, octal, or hexadecimal, repeatedly divide it by the required base and record the remainders. Continue until the quotient is zero, then read the remainders from bottom to top. Use base 2 for binary, base 8 for octal, and base 16 for hexadecimal. The number's value stays the same; only its representation changes.