Division | Quotient | Remainder |
---|---|---|
125 ÷ 2 | 62 | 1 (LSD) |
62 ÷ 2 | 31 | 0 |
31 ÷ 2 | 15 | 1 |
15 ÷ 2 | 7 | 1 |
7 ÷ 2 | 3 | 1 |
3 ÷ 2 | 1 | 1 |
1 ÷ 2 | 0 | 1 (MSD) |
Example 3.2: Converting decimal 70 to its binary equivalent
The procedure of converting 7010 to the binary number is listed below. The binary equivalent of 7010 becomes 10001102.
Division | Quotient | Remainder |
---|---|---|
70 ÷ 2 | 35 | 0 (LSD) |
35 ÷ 2 | 17 | 1 |
17 ÷ 2 | 8 | 1 |
8 ÷ 2 | 4 | 0 |
4 ÷ 2 | 2 | 0 |
2 ÷ 2 | 1 | 0 |
1 ÷ 2 | 0 | 1 (MSD) |
3.6.2Converting Decimal to Octal
Converting a decimal number to its octal equivalent involves repeatedly dividing the decimal number by 8 until a quotient of 0 is obtained. Each remainder obtained is a digit of the equivalent binary number, starting from right to left.
Example 3.3: Converting decimal 253 to its octal equivalent
The procedure of converting 25310 to octal number is as follows:
Division | Quotient | Remainder |
---|---|---|
253 ÷ 8 | 31 | 5 (LSD) |
31 ÷ 8 | 3 | 7 |
3 ÷ 8 | 0 | 3 (MSD) |
The octal equivalent of 25310 is 3758.
3.6.3Converting Decimal to Hexadecimal
Converting a decimal number to its hexadecimal equivalent involves repeatedly dividing the decimal number by 16 until a quotient of 0 is reached. Each remainder obtained is a digit of the equivalent hexadecimal number, starting from right to left.
Example 3.4: Converting decimal 895 to its hexadecimal equivalent
The procedure of converting 89510 to hexadecimal number is as follows:
Division | Quotient | Remainder |
---|---|---|
895 ÷ 16 | 55 | 15 (F) (LSD) |
55 ÷ 16 | 3 | 7 |
3 ÷ 16 | 0 | 3 (MSD) |
The hexadecimal equivalent of 89510 becomes 37F16.
3.6.4Converting Binary to Decimal
The procedure of converting a binary number to its decimal equivalent starts by multiplying the place values to their corresponding digits and summing the results. The procedure of converting binary number 11012 to decimal follows. We can see that 11012 = 1310.
Example 3.5: Converting 110112 to its decimal equivalent
The decimal equivalent of 110112 is found as follows:
110112 = 1x24 + 1x23 + 0x22 + 1x21 + 1x20 = 16 + 8 + 0 + 2 + 1 = 2710
3.6.5Converting Octal to Decimal
The procedure of converting an octal number to its decimal equivalent starts with multiplying the place values (1, 81, 82,…, 8n) by their corresponding digits and summing the results. An example of converting octal number 5348 to its decimal equivalent follows.
Example 3.6: Converting 6278 to its decimal equivalent
The decimal equivalent of 6278 is:
3.6.6Converting Hexadecimal to Decimal
The procedure of converting a hexadecimal number to its decimal equivalent starts by multiplying the place values (1, 161, 162,…, 16n) to their corresponding digits and summing the results. For example, the procedure of converting 5AC16 to decimal follows.
Example 3.7: Converting B9516 to its decimal equivalent
The decimal equivalent of B9516 is calculated as below:
3.6.7Converting Binary to Octal
Converting a binary number to its octal equivalent involves three steps (Figure 3.4). The first step separates the binary number into groups of three digits, starting from right to left. The second step assigns its octal equivalent for each three-digit group. The last step assembles the octal equivalent values in the proper sequence.
Figure 3.4: Converting a binary number to its octal equivalent
Example 3.8: Converting 110011012 to its octal equivalent
110011012 has a total of 8 digits that can form three 3-digit groups with the third group having only 2 most significant digits. The binary digits in these three groups are:
The octal equivalent of 110011012 becomes 3158.
3.6.8Converting Octal to Binary
Converting an octal number to its binary equivalent is the reverse of converting binary to octal. It involves the following two steps:
•Convert each octal digit to its 3-digit equivalent.
•Assemble the binary equivalent values in the proper sequence.
Example 3.9: Converting 6358 to its binary equivalent
The converting process follows:
The binary equivalent of 6358 becomes 1100111012.
3.6.9Converting Binary to Hexadecimal
Converting a binary number to its hexadecimal equivalent involves the same three steps as converting binary to octal, except hexadecimal conversion involves 4-bit binary groupings. Four-bit groupings are used because each hexadecimal digit can be represented in four binary digits (Figure 3.5).
Figure 3.5: Converting a binary number to its hexadecimal number
Example 3.10: Converting 101100111010102 to its hexadecimal equivalent
The binary 101100111010102 has 14 digits that can form four 4-bit groups with the fourth group having only 2 digits. The binary digits in these four groups are: