Before we start performing octal arithmetic, we must become familiar with the octal number system. In this system, the base is 8. So there are only eight digits in this system. These digits are 0, 1, 2, 3, 4, 5, 6, and 7. 8 and 9 do not exist in this system. 7 is the largest single digit in this system which is 1 less than the base. Each position in an octal number represents a power of the base 8.

Octal Addition, Subtraction, Multiplication, and Division

In this topic, I have discussed octal addition, subtraction, multiplication, and division. An alternative method for solving these types of problems is also discussed in this topic below.

Octal Addition

The addition of two or more octal numbers can be achieved by following some specific rules which are listed below.

  1. Add the right most digits of each octal number.
  2. Divide the sum of digits obtained in step one by 8. Now the remainder of this division is the octal equivalent of that sum of digits and the quotient of this division is added to the next sum of digits from the right side.
  3. Perform the second step until we add the left most digits of both numbers.

Here we will use the modulo operation to find the remainder of the sum of digits. If the sum of digits is less than 8 then the remainder will be the sum itself. And if it is greater than 8 then it will be obtained by repeatedly subtracting 8 from the sum of digits. And this repeated subtraction will continue until the result of the subtraction does not become less than 8.

Similarly, the quotient of the division will be 0 if the sum of digits is less than 8 and it will be more than 0 if the sum of digits is greater than 8. Now, let us take some examples to have a better idea how the whole operation takes place.

Example 1:- Add the octal numbers (123)8 and (527)8?

Sum of Digits (Starting from Right)RemainderQuotient
3 + 7 = 1010 % 8 = 210 / 8 = 1
(Quotient added) 1 + 2 + 2 = 55 % 8 = 55 / 8 = 0
(Quotient added) 0 + 1 + 5 = 66 % 8 = 66 / 8 = 0

Hence, the sum of (123)8 and (527)is (652)8.

Example 2:- Add the octal numbers (3254)8 and (7237)8?

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
4 + 7 = 1111 % 8 = 311 / 8 = 1
(Quotient Added) 1 + 5 + 3 = 99 % 8 = 19 / 8 = 1
(Quotient Added) 1 + 2 + 2 = 55 % 8 = 55 / 8 = 0
(Quotient Added) 0 + 3 + 7 = 1010 % 8 = 210 / 8 = 1
(Quotient Added) 1 = 11 % 8 = 11 / 8 = 0

Therefore, the sum is (12513)8.

Octal Subtraction

Octal subtraction is performed as we perform the binary subtraction. In binary subtraction, first we find 1’s complement or 2’s complement of subtrahend in the same way first we will find 7’s complement or 8’s complement of that octal number then we add the minuend and the subtrahend. So to find the subtraction of two octal numbers we have to follow two steps:

  1. Find either 7’s complement or 8’s complement of the subtrahend.
  2. Add the minuend and the subtrahend using the octal addition rules stated above.

Octal Subtraction using 7’s complement

Let us take some examples to understand this process.

Example 3:- subtract (234)8 from (453)8?

Step 1: Find the 7’s complement of (234)8. 7’s complement of (234)8 = 777 – 234 = (543)8

Step 2: Add the numbers (453)and (543)8.

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
3 + 3 = 66 % 8 = 66 / 8 = 0
(Quotient added) 0 + 5 + 4 = 99 % 8 = 19 / 8 = 1
(Quotient added) 1 + 4 + 5 = 1010 % 8 = 210 / 8 = 1
(Quotient added) 1 = 11 % 8 = 11 / 8 = 0

So, the sum is (1216)8. Now, discard the left most digit and add 1 to the right most digit and that will be the answer. Hence, (453)8 – (234)8 = (217)8.

Example 4:- Subtract (76)8 from (165)8?

Step 1: 7’s complement of (76)= 77 – 76 = (1)8
Step 2: Add the octal numbers (165)and (1)8.

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
1 + 5 = 66 % 8 = 66 / 8 = 0
(Quotient added) 0 + 6 = 66 % 8 = 66 / 8 = 0
(Quotient added) 0 + 1 = 11 % 8 = 11 / 8 = 0

The sum is (166)8. Now, discarding the left most digit and adding 1 to the right most digit. Hence, (165)8 – (76)8 = (67)8.

Octal Subtraction using 8’s complement:

Example 5:- Find the value of (574)8 – (341)8?

To solve this problem we are going to take the 8’s complement of subtrahend. There are also two steps. At first, we will find the 8’s complement of the subtrahend and then add the minuend and the 8’s complement of the subtrahend.

8’s complement any octal number = 7’s complement of that octal number + 1

Step 1: 8’s complement of (341)8 = (777 – 341) + 1 = (437)8

Step 2: Add the minuend (574)8 and 8’s complement of subtrahend (437)8.

Digits (starting from right)Remainder (Octal Equivalent)Quotient
4 + 7 = 1111 % 8 = 36 / 8 = 1
(Quotient Added) 1 + 7 + 3 = 1111 % 8 = 311 / 8 = 1
(Quotient Added) 1 + 5 + 4 = 1010 % 8 = 210 / 8 = 1
(Quotient Added)          1 = 11 % 8 = 11 / 8 = 0

So sum of (574)8 and (437)is (1233)8. So, the required value is obtained by discarding the left most digit only. Therefore, (574)8 – (341)8 = (233)8.

Example 6:- (764)8 – (444)solve the problem using 8’s complement?

Step 1: 8’s complement of subtrahend = (777 – 444) + 1 = (334)8

Step 2: Adding the numbers (764)and (334)8.

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
4 + 4 = 88 % 8 = 08 / 8 = 1
(Quotient added) 1 + 6 + 3 = 1010 % 8 = 210 / 8 = 1
(Quotient added) 1 + 7 + 3 = 1111 % 8 = 311 / 8 = 1
(Quotient added) 1 = 11 % 8 = 11 / 8 = 0

So the sum is (1320)8. Now discard the left most digit and that will be the required answer. Hence, (764)8 – (444)8 = (320)8.

Problem Including both Addition and Subtraction of Octal Number

Example 7:- Solve the given problem: (223)8 + (527)8 – (436)8?

To solve this problem, first we are going to add the first two octal numbers then we subtract the third octal number from the sum of the first two octal numbers. So, let us start adding first two octal numbers. To add these numbers we will follow the octal addition rules.

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
3 + 7 = 1010 % 8 = 210 / 8 = 1
(Quotient added) 1 + 2 + 2 = 55 % 8 = 55 / 8 = 0
(Quotient added) 0 + 2 + 5 = 77 % 8 = 77 / 8 = 0

So the sum is (752)8. Now, we will find either 7’s complement or 8’s complement of the subtrahend (436)8 and we will proceed accordingly. Here I am taking the 7’s complement of (436)8. Therefore, 7’s complement of (436)8 = 777 – 436 = (341)8. Now, we will add (752)and (341)8 to get the final result.

Digits (Starting from Right)Remainder (Octal Equivalent)Quotient
1 + 2 = 33 % 8 = 33 / 8 = 0
(Quotient added) 0 + 5 + 4 = 99 % 8 = 19 / 8 = 1
(Quotient added) 1 + 7 + 3 = 1111 % 8 = 311 / 8 = 1
(Quotient added) 1 = 11 % 8 = 11 / 8 = 0

The sum of (752)8 and (341)8 is (1313)8. Now discard the left most digit and add 1 to the right most digit. Hence, (223)8 + (527)8– (436)8 = (314)8.

Alternate Method for Addition and Subtraction of Octal Number

The addition or subtraction of two or more octal numbers can be performed by an alternate method that follows as:

  1. The addition or subtraction is performed first by changing the given octal numbers into their equivalent decimal number and then we add or subtract them.
  2. Change the obtained final addition value or subtraction value into octal number.

Now the question arises here how an octal number can be altered in decimal number the answer is as follows:

  1. Multiply each digit of the octal number with its corresponding position octal value and it start from right side as for first digit 80 = 1, 81 = 8, 82 = 64, 83 = 512 and so on.
  2. Add all the numbers obtained from first step and that is the final decimal equivalent value of an octal number.

Let us verify the first problem of octal addition by this rule.

Example 8:- Add the octal numbers (123)8 and (527)8?

Solution: – First we change both the octal number into decimal number by the above rules.
(123)8 

= 1 × 82 + 2 × 81 + 3 × 80

= 64 + 16 + 3

= 83

= (83)10

(527)8 

= 5 × 82 + 2 × 81 + 7 × 80

= 320 + 16 + 7

= 343

= (343)10

(83)10 + (343)10 = (426)10

Now the step one has been executed. Thus we will start second step as: In the first step we have found the final decimal value, now we are going to change this decimal number into its equivalent octal number.

The process of altering a decimal number into its octal equivalent is done by repeated division of the decimal number by 8 until the number becomes less than 8. The remainder found in each division together forms the octal number. The remainders are taken in order from bottom to up. Thus the octal equivalent of (426)10 is as obtained:

426/8 = 53 + 2 Remainder

53 / 8 = 6 + 5 Remainder

6 / 8 = 0 + 6 Remainder

Hence the octal equivalent is (652)8. And this is the final answer in octal number system. (123)8 + (527)8 = (652)8

Similarly any octal numbers can be added by this method. Now we will discuss about the subtraction of octal number in the same procedure. The subtraction of octal numbers are illustrated below with proper example.

Example 9:- Subtract the octal number (453)8 and (234)8?

Solution: – The subtraction process will be processed in the same way as the addition is performed above. Now we change the octal numbers (453)8 and (234)8 into decimal numbers.

(453)8 

= 4 × 82 + 5 × 81 + 3 × 80

= 256 + 40 + 3

= 299

= (299)10

(234)8 = 2 × 82 + 3 × 81 + 4 × 80

= 128 + 24 + 4

= 156

= (156)10

Now, (299)10 – (156)10 = (143)10

Since the first step is complete now so we will go for the next step to change the decimal value into octal value.

143 / 8 = 17+ 7 Remainder

17 / 8 = 2 + 1 Remainder

2 / 8 = 0 + 2 Remainder

The octal equivalence of (143)10 is (217)8. Hence the result is (453)8 – (234)8= (217)8.

Multiplication and Division of Octal Number

Multiplication and Division of octal number can also be achieved easily by the above method. To take a good understanding let us go through an example.

Example 10:- Multiply the octal number (444)8 and (555)8?

Solution :- let us change both the numbers into decimal number system.

(444)8 

= 4 × 82 + 4 × 81 + 4 × 80

= 256 + 32 + 4

= 328

= (292)10

(555)8 

= 5 × 82 + 5 × 81 + 5 × 80

= 320 + 40 + 5

= 365

= (365)10

(292)10 × (365)10 = (106580)10

Now change (106580)10 into octal equivalent.

106580 / 8 = 13322 + 4 Remainder

13322 / 8 = 1665 + 2 Remainder

1665 / 8 = 208 + 1 Remainder

208 / 8 = 26 + 0 Remainder

26 / 8 = 3 + 2 Remainder

3 / 8 = 0 + 3 Remainder

Therefore, the octal equivalent is (320124)8. Hence, (444)8 × (555)8 = (320124)8. The division of octal numbers can be done in the same way as the multiplication has been done. First we will convert the numbers into their decimal equivalent then we will divide the dividend by divisor. After that we will have to convert the quotient and remainder (in any) into octal number system.

See Also:

  1. Binary Addition, Subtraction, Multiplication, and Division
  2. Hexadecimal Addition, Subtraction, Multiplication, and Division