Octal Number System
The octal number system has a radix of eight so that it uses eight digits : 0, 1, 2, 3, 4, 5, 6 and 7. The position weights in the system are powers of eight. The digit positions of first six powers of eight are:
\[8^{0} = 1 \] \[8^{1} = 8 \] \[8^{2} = 64 \] \[8^{3} = 512 \] \[8^{4} = 4096 \] \[8^{5} = 32768\]
The octal number system is frequently used in digital circuits due to two principal reasons. First, it can be easily converted to binary. Secondly, there are significantly fewer digits in any given octal number than in the corresponding binary number so that it is much easier to work with shorter octal numbers.
Decimal-to-Octal Conversion.
To convert a decimal number to octal, we employ the same repeated-division method that we used in decimal-to-binary conversion. However, here the division factor is 8 instead of two. The following examples illustrate decimal-to-octal conversion.
- (i) To convert decimal number 91 to octal number, the procedure is as under :
| Division | Remainder |
|---|---|
| 91 ÷ 8 = 11 | 3 (LSB) |
| 11 ÷ 8 = 1 | 3 |
| 1 ÷ 8 = 0 | 1 (MSB) |
| ∴ \((91)_{10}\)= \((133)_{8}\) |
- (ii) As another example, consider the conversion of decimal number 266 to octal number.
| Division | Remainder |
|---|---|
| 266 ÷ 8 = 33 | 2 (LSB) |
| 33 ÷ 8 = 4 | 1 |
| 4 ÷ 8 = 0 | 4 (MSB) |
| ∴ \((266)_{10}\)= \((412)_{8}\) |
Octal-to-Decimal Conversion.
An octal-to-decimal conversion can be done in the same manner as a binary-to-decimal conversion i.e. simply add up the position weights to obtain the deci mal number. The following examples illustrate octal-to-decimal conversion.
- (i) To convert octal number \((133)_{8}\) to decimal number, the procedure is as under :
| Position weights | \(8^{2}\) | \(8^{1}\) | \(8^{0}\) |
|---|---|---|---|
| Octal number | 1 | 3 | 3 |
\[∴ (133)_{8} = (8^{2} × 1) + (8^{1} × 3) + (8^{0} × 3)\]
\[= 64 + 24 + 3 = 91\]
\[∴ (133)_{8} = (91)_{10}\]
- (ii) As another example, consider the conversion of octal number \((372)_{8}\) to decimal number.
| Position weights | \(8^{2}\) | \(8^{1}\) | \(8^{0}\) |
|---|---|---|---|
| Octal number | 3 | 7 | 2 |
\[∴ (372)8 = (82 × 3) + (81 × 7) + (80 × 2)\]
\[= 192 + 56 + 2 = 250\]
\[∴ (372)_{8} = (250)_{10}\]
Octal-to-Binary Conversion.
The advantage of oc tal number system is the ease with which an octal number can be converted to a binary number and vice-versa. It is because eight is the third power of two, providing a direct correlation between three-bit groups in a binary number and the octal dig its i.e. each three-bit group of binary bits can be represented by one octal digit. Therefore, conversion from octal to binary is performed by converting each octal digit to its 3-bit binary equivalent. The eight possible digits are converted as shown in the adjoining table.
- (i) The conversion of octal number \((472)_{8}\) to binary num ber is done as under :
| 4 | 7 | 2 |
|---|---|---|
| ↓ | ↓ | ↓ |
| 100 | 111 | 010 |
Therefore, octal 472 is equivalent to binary 100111010 i.e.,
\[(472)_{8} = (100111010)_{2}\]
- (ii) As another example, consider the conversion of octal number \((5431)_{8}\) to binary number.
| 5 | 4 | 3 | 1 |
|---|---|---|---|
| 101 | 100 | 011 | 001 |
Therefore, octal 5431 is equivalent to binary 101100011001 i.e. \[(5431)_{8} = (101100011001)_{2}\]
Binary-to-Octal Conversion.
The conversion of binary number to octal number is simply the reverse of the above process. The bits of the binary number are grouped into groups of three bits starting at the LSB. Then each group is converted to its octal equivalent. To illustrate this method, consider the conversion of binary number (100111010)2 to octal number. The procedure is as under:
| 100 | 111 | 010 |
|---|---|---|
| ↓ | ↓ | ↓ |
| 4 | 7 | 2 |
\[(100111010)_{2} = (472)_{8}\]
There are fewer digits in the octal number than in the corresponding binary number. Therefore, it is much easier to work with shorter octal numbers. Sometimes the binary number will not have even groups of 3 bits. In that case, we can add one or two 0s to the left of the MSB of the binary number to fill the last group.
This point is illustrated below for the binary number 11010110.
| 011 | 010 | 110 |
|---|---|---|
| ↓ | ↓ | ↓ |
| 3 | 2 | 6 |
A 0 is placed to the left of the MSB to produce even groups of 3 bits.