Page 32 - computer science (868) class 11
P. 32
Example 1: (3452) + (167) +1 +1
8
8
Answer: 3 4 5 2
+ 1 6 7
3 6 4 1
(3641) 8
Example 2: (152.6) + (46.71) +1 +1 +1
8 8
Answer: 4 6 . 7 1
+ 1 5 2 . 6
2 2 1 . 5 1
(221.51) 8
1.4.2 Octal Subtraction
Octal subtraction can be done in three different methods which are as follows:
• Borrow method
• 7’s complement method
• 8’s complement method
Octal Subtraction by Borrow Method
Octal subtraction can be performed by the borrow method in the same way as decimal subtraction.
The steps to be followed are:
1. Subtract each digit of minuend and subtrahend starting from the rightmost column (LSB).
2. If the minuend digit is smaller, borrow 8 from the previous digit.
Example 1: (456) - (173) 8
8
Answer: +8
4 3 5 6
- 1 7 3
(263) 2 6 3
8
Example 2: (362.4) - (76.7)
8 8 +8 +8 +8
Answer: 3 2 6 5 2 1 . 4
- 7 6 . 7
(263.5) 2 6 3 . 5
8
Octal Subtraction by 7’s complement method
7’s complement of a number is obtained by subtracting all bits from 7. For example, the 7’s complement of 26501 is
calculated as:
7 7 7 7 7
- 2 6 5 0 1
5 1 2 7 6
The steps to be followed are:
1. Make the number of digits of the subtrahend equal to minuend by adding leading 0’s in the integer part of the
subtrahend and trailing 0’s in the fractional part if required.
2. Find the 7’s complement of the subtrahend.
3030 Touchpad Computer Science-XI

