Professional Documents
Culture Documents
The addition of two or more octal numbers can be achieved by following some specific rules
which are listed below. Since there are eight digits in this system starting from 0 and the last digit
are 7. The additions of octal numbers are discussed below.
1.
2.
Find the modulo of the sum of digits means divide the sum by 8 and the remainder so
obtained is the octal equivalent of the sum and the quotient is added to the next sum of
digits from right side. Perform the STEP 2 until we add the left most digits.
Let us take an example to have a better idea how the whole operation takes place.
Exp1:- Add the octal numbers (123)8 and (527)8.
Digit (Starting from Right)
Remainder
Quotient
3+7=10
10%8=2
10/8=1
5%8=5
5/8=0
6%8=6
6/8=0
Quotient
4+8 = 12
12%8 = 4
12/8 = 1
9%8 = 1
9/8 = 1
5%8 = 5
5/8 = 0
10%8 = 2
10/8 = 1
(Quotient Added) 1 = 1
1%8 = 1
1/8 = 0
OCTAL SUBTRACTION
Octal subtraction is performed as we perform the binary subtraction. In binary subtraction, first
we find 1s complement or 2s complement of subtrahend in the same way first we will find 7s
complement or 8s complement of that octal number then we add the minuend and the
subtrahend (The addition is performed as we have stated above.). So to find the subtraction of
two octal numbers we have to follow two steps:
1.
2.
By using 7s complement
Let us take an example:
Exp1:- subtract (453)8 (234)8.
STEP 1: 7s complement of (234)8= 777 234 = (543)8
STEP 2: Add the numbers (453)8 and (543)8.
Digits (Starting from Right)
Quotient
3+3 = 6
6%8 = 6
6/8 = 0
9%8 = 1
9/8 = 1
10%8 = 2
10/8 = 1
(Quotient added) 1 = 1
1%8 = 1
1/8 = 0
So, the sum is (1216)8. Now, discard the end carry and add 1 to the right most digit and that will
be the answer.
Hence, (453)8 (234)8 = (217)8.
Exp2:- Subtract (165)8 (76)8.
STEP 1: 7s complement of (76)8 = 77 76 = (1)8
STEP 2: Add the octal numbers (165)8 and (1)8.
Digits (Starting from Right)
Quotient
1+5 = 6
6%8 = 6
6/8 = 0
(Quotient added)0+6 = 6
6%8 = 6
9/8 = 0
(Quotient added)0+1 = 1
1%8 = 1
1/8 = 0
By 8s complement:
Exp1:- Find the value of (574)8 (341)8.
To solve this problem we use 8s complement of subtrahend. There are also two steps first find
the 8s complement of subtrahend and the follow the STEP 2 of the 7s complement method.
Now, 8s complement any octal number = 7s complement of that octal number + 1
STEP 1: Therefore, 8s complement of (341)8 = (777 341) + 1 = (437)8
STEP 2: Add the minuend (574)8and 8s complement of subtrahend (437)8.
Digits (starting from right)
Quotient
4+7 = 11
11%8 = 3
6/8 = 1
11%8 = 3
10%8 = 2
(Quotient Added)
1%8 = 1
1=1
11/8 = 1
10/8 = 1
1/8 = 0
Sum of (574)8 and (437)8 is (1233)8. So, the required value is obtained by discarding the end carry
only.
Therefore, (574)8 (341)8 = (233)8
Exp2:- (764)8 (444)8 solve the problem using 8s complement?
STEP 1: 8s complement of subtrahend = (777 444) + 1 = (334)8
STEP 2: Add the numbers (764)8 and (334)8.
Digits (Starting from Right)
Quotient
4+4=8
8%8=0
8/8=1
10%8=2
10/8=1
11%8 = 3
11/8 = 1
(Quotient added) 1 = 1
1%8 = 1
1/8 = 0
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 to add first two
octal numbers. To add these numbers we will follow the above rules.
Digits (Starting from Right)
Quotient
3+7=10
10%8=2
10/8=1
5%8=5
5/8=0
7%8 = 7
7/8 = 0
Quotient
1+2 = 3
3%8 = 3
8/8 = 0
9%8 = 1
9/8 = 1
11%8 = 3
11/8 = 1
(Quotient added) 1 = 1
1%8 = 1
1/8 = 0
So, the sum of (752)8 and (341)8 is (1313)8. Now discard the end carry and add 1 to the right most
digit.
Hence, (223)8 + (527)8 (436)8 = (314)8.
ADDITION OF HEXADECIMAL
The addition of hexadecimal numbers are achieved by following the given two steps given
below.
1.
2.
Find the modulo of the sum of digits means divide the sum by 16 and the remainder so
obtained is hexadecimal equivalent of the sum and the quotient is added to the next sum of
digits from right side. Perform the second step until we add the last left most digits.
Remainder
Quotient
3+1=4
4%16=4
4/16=0
13%16=13(D)
13/16=0
11%16=11(B)
11/16=0
Remainder
Quotient
C+B=23
23%16=7
23/16=1
21%16=5
21/16=1
18%16=2
18/16=1
1%16=1
1/16=0
Thus the sum of the hexadecimal numbers 2AC16 and FAB16 is 125716.
Example 3: Find the addition of A2B.D416 and 247.6516?
Solution: The solution of the above problem is performed as:
Digit (Starting from Right)
Remainder
Quotient
4+5=9
9%16=9
9/16=0
19%16=3
19/16=1
19%16=3
19/16=1
7%16=7
7/16=0
12%16=12(C)
12/16=0
SUBTRACTION OF HEXADECIMAL
Subtraction of hexadecimal numbers is obtained by following the given steps:
1.
2.
Add minuend and 15s complement or 16s of the subtrahend using the above addition
steps of hexadecimal numbers.
3.
Discard the left most end carry and add 1 to the right most digit (only in case of 15s
complement) and that will be the final solution.
15 A = 5
15 3 = 12 (in hexadecimal number system 12=C)
15 B = 4
So the 15s complement of A3B16 is 5C416.
Now add ABC16and 5C416.
Digit (Starting from Right)
Remainder
Quotient
C+4=16
16%16=0
16/16=1
24%16=8
24/16=1
16%16=0
16/16=1
1%16=1
1/16=0
The remainder is 108016. Now we have to discard the left most end carry 1 and then we have to
add 1 to the right most digit.
Thus 108016becomes 8016+1=8116
Hence, ABC16 A3B16=8116.
We can solve the same problem taking 16s complement of subtrahend. So lets solve the
problem by this method.
The 16s complement of A3B16
= 15s complement of A3B16 + 1
= 5C416 + 1
= 5C516
Now add ABC16and 5C516.
Digit (Starting from Right)
Remainder
Quotient
C+5=16
17%16=1
16/16=1
24%16=8
24/16=1
16%16=0
16/16=1
1%16=1
1/16=0
Thus the remainder is 108116. Now we have to discard the left most end carry 1 then number
obtained is final value.
Hence, ABC16 A3B16 = 8116.
Example 2: Subtract the hexadecimal numbers 67A16 and 54916?
Solution: The solution of this problem is as follows:
Remainder
Quotient
A+6=16
16%16=0
16/16=1
19%16=3
19/16=1
17%16=1
17/16=1
1%16=1
1/16=0
Thus the remainder is 113016. Now discard left most end carry 1 and add 1 to the right most digit.
Hence, 113016become 13016 and after adding 1 we get 13116.
So 67A16 54916 = 13116.
Remainder
Quotient
A+7=17
17%16=1
17/16=1
19%16=3
19/16=1
17%16=1
17/16=1
1%16=1
1/16=0
Thus when we arrange the remainder we get 113116. Now discard the left most end carry and we
will get the final solution.
Hence after discarding end carry of 113116.
We get 13116.
Example 3: Solve ABC16 + FAB16 2AC16?
Solution: first we add ABC16 and FAB16 then we subtract 2AC16from the sum of ABC16 and FAB16.
Digit (Starting from Right)
Remainder
Quotient
C+B=23
23%16=7
23/16=1
22%16=6
22/16=1
26%16=10(A)
26/16=1
1%16=1
1/16=0
Remainder
Quotient
7+3=10
10%16=10(A)
10/16=0
11%16=11(B)
11/16=0
23%16=7
23/16=1
2%16=2
2/16=0
Thus we get 27BA16. After discarding 1 from left most digit of 27BA16and then we add 1.
Hence 27BA16becomes 17BA16 and 17BA16+1=17BB16.
ABC16 + FAB16 2AC16 = 17BB16.
2.
3.
Convert the decimal number obtained from step two into hexadecimal number.
4.
The hexadecimal number obtained from step three is the final answer.
Remainder
16|205
16|12
16|0
Remainder
16|3
|0
0
3