Learning about decimal and octal numeric systems is a basic tool that most people dabbling in software should understand. You need to know how to convert between the various forms to make sense of machine-level data.

There are four major numerical systems in the world today: binary, octal, decimal and hexadecimal. Each system has its own use in different things. For example, we use the decimal system for any kind of calculation on a human level of intelligence. Older machines constantly use binary and octal, modern machines make use of the hexadecimal system. So as long as human-to-machine interfacing is required, we will always have the need to convert one numerical system into the other.

### The Decimal and Octal Numerical Systems

Everyone knows the decimal number system. It is the main number system we use today, and has 10 discrete digits from 0 to 9. The octal system on the other hand has only 8 digits (hence the name octal). The numbers in an octal system are only from 0 – 7. That means, there is no 8 and 9 in a normal octal system.

The octal system is used mainly in computer programming languages. There is a relationship between the octal and the binary system, which makes it very useful while programming computers. It is also often used in place of the hexadecimal system (16 digits), as it has fewer digits.

### Conversion From Decimal to Octal

It is one of the most commonly explained problems in computer basics. An octal number can be converted to a decimal number using the following formula:

*Decimal Form* = **Ʃ(a _{i} x 8^{i})**

In this formula, ‘a’ is the individual digit being converted, while ‘*i*‘ is the position of the digit counting from the right-most digit in the number, the right-most digit being position 0. (This means from the decimal point. We will get to converting octal fractions later)

Here’s how to do it step-by-step, using the octal number 765:

- Figure out how many digits there are in the number. 765 has 3 digits.
- Then take each digit and multiply it with 8
^{(n-1)}, where ‘n’ is the position of the digit from the right. So**7**will be multiplied by 8^{(3-1)}, which is 8^{2}, or 64. And 7 x 64= 448. - Similarly, you take
**6**x 8^{(2-1)}(= 48),**5**x^{(1-1)}(= 5), then add all three results to get the decimal number. So 448 + 48 + 5 = 501. - Thus (765)
_{8}= (501)_{10}

Here’s another example:

**Convert (1336) _{8} to decimal**:

(1336)_{8} = (1 x 8^{3}) + (3 x 8^{2}) + (3 x 8^{1}) + (6 x 8^{0})

= (1 x 512) + (3 x 64) + (3 x 8) + (6 x 1)

= 512 + 192 + 24 + 6

= 734

Thus (1336)_{8} = (734)_{10}

**Convert (21.21)8 to Decimal**

Here we have an octal number with two digits in the decimal place, i.e., 2 and 1. While converting the fraction from octal to decimal, we

*divide*the digits after the decimal point by 8

^{m}, where ‘m’ is the place of the digit after the decimal.

So, when we convert the octal fraction 21.21 to decimal, we multiply any digit on the left of the decimal with the relevant power of 8, and divide any digit on the right of the decimal with the relevant power of 8.

Thus we get,

2 x 8^{(2-1)} + 1 x 8^{(1-1)} + 2 ÷ 8^{1} + 1 ÷ 8^{2}

= 2 x 8 + 1 x 1 + 2 ÷ 8 + 1 ÷ 64

= 16 + 1 + 0.25 + 0.015625

= 17 + 0.265625

= 17.265625

Thus, (21.21)_{8} = (17.265625)_{10}

Try the steps out with the following numbers:

- I: (5467)
_{8} - II: (6345)
_{8} - III: (76534)
_{8}

**Answers:**

- I: 2871
- II: 3301
- III: 32092

Octal numbers may not be used regularly (most modern systems use hexadecimal), but it certainly pays to know what to do with one when you encounter it. It forms one element of the basic knowledge in electronics, and is therefore necessary to be understood thoroughly.