Академический Документы
Профессиональный Документы
Культура Документы
Addition of octal numbers is carried out by the same principle as that of decimal or binary numbers.
10
10
11
10
11
12
10
11
12
13
10
11
12
13
14
10
11
12
13
14
15
10
11
12
13
14
15
16
With the help of this table addition of octal numbers is best illustrated by the following examples:
Evaluate:
(i) (162)8 + (537) 8
Solution:
11
<---- carry
162
537
721
Therefore, sum = 7218
<---- carry
136
636
774
Therefore, sum = 7748
<---- carry
25.27
13.2
40.47
Therefore, sum = (40.47)
<---- carry
67.5
45.6
135.3
Therefore, sum = (135.3)
OCTAL ADDITION
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
(Quotient added)
5%8=5
1+2+2=5
(Quotient added)
6%8=6
0+1+5=6
Hence, the sum of (123)8 and (527)8 is (652)8.
5/8=0
6/8=0
[NOTE: WHEN THE SUM OF THE DIGITS IS LESS THAN 8 THEN THE MODULO OF
THE SUM WILL BE THE SUM ITSELF AND THE QUOTIENT WILL BE ZERO.]
Exp2:- Add the octal numbers (325.4)8 and (723.8)8.
Digits
Right)
(Starting
from Remainder
Equivalent)
4+8 = 12
(Quotient Added) 1+5+3
=9
(Quotient Added) 1+2+2
=5
(Quotient Added) 0+3+7
= 11
(Quotient Added) 1 = 1
(Octal
Quotient
12%8 = 4
12/8 = 1
9%8 = 1
9/8 = 1
5%8 = 5
5/8 = 0
11%8 = 3
11/8 = 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. Find either 7s complement or 8s of the subtrahend.
2. Add the minuend and the subtrahend.
Let us take an example:
3
(Starting
from Remainder
Equivalent)
3+3 = 6
(Quotient added) 0+5+4
=9
(Quotient added) 1+4+5
= 10
(Quotient added) 1 = 1
(Octal
Quotient
6%8 = 6
6/8 = 0
9%8 = 1
9/8 = 1
10%8 = 2
10/8 = 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)
Remainder (Octal
Equivalent)
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, 8scomplement of (341)8 = (777 341) + 1
= (437)8
4
Remainder (Octal
Equivalent)
Quotient
4+7 = 11
11%8 = 3
6/8 = 1
(Starting
from Remainder
Equivalent)
4+4=8
(Quotient added)
1+6+3=10
(Quotient added) 1+7+3
= 11
(Quotient added) 1 = 1
(Octal
Quotient
8%8=0
8/8=1
10%8=2
10/8=1
11%8 = 3
11/8 = 1
1%8 = 1
1/8 = 0
PROBLEM
INCLUDING
BOTH ADDITION
SUBTRACTION OF OCTAL NUMBER
AND
Remainder (Octal
Equivalent)
Quotient
3+7=10
10%8=2
10/8=1
5%8=5
5/8=0
7%8 = 7
7/8 = 0
(Quotient added)
1+2+2=5
(Quotient added) 0+2+5
=7
So the sum is (752)8.
Remainder (Octal
Equivalent)
Quotient
1+2 = 3
3%8 = 3
8/8 = 0
9%8 = 1
9/8 = 1
11%8 = 3
11/8 = 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.
ALTERNATE
METHOD
FOR
ADDITION
SUBTRACTION OF OCTAL NUMBERS
AND
= 156
= (156)10
(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+ 7R
17/8 = 2+ 1R
2/8 = 0+ 2R
The octal equivalence of (143)10 is (217)8.
Hence
the
result
is
(453)8
(234)8 =
(217)8.
Octal Addition
Following octal addition table will help you to handle octal addition.
To use this table, simply follow the directions used in this example: Add 6 8 and 58. Locate 6 in the A column
then locate the 5 in the B column. The point in 'sum' area where these two columns intersect is the 'sum' of
two numbers.
68 + 58 = 138.
Example Addition
Octal Subtraction
The subtraction of octal numbers follows the same rules as the subtraction of numbers in any other number
system. The only variation is in borrowed number. In the decimal system, you borrow a group of 10 10. In the
binary system, you borrow a group of 210. In the octal system you borrow a group of 810.
Example Subtraction
Letters represents numbers starting from 10. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
Each position in a hexadecimal number represents a 0 power of the base (16). Example 16 0
Last position in a hexadecimal number represents an x power of the base (16). Example 16 x where
x represents the last position - 1.
Example
Hexadecimal Number 19FDE16
Calculating Decimal Equivalent
Step
Binary Number
Decimal Number
Step 1 19FDE16
Step 2 19FDE16
Step 3 19FDE16
Step 4 19FDE16
10646210
10
Hexadecimal Addition
Following hexadecimal addition table will help you greatly to handle Hexadecimal addition.
To use this
table, simply
follow
the
directions
used in this
example
Add
A16 and
516. Locate A
in
the
column then
locate the 5
in
the
column. The
point in 'sum'
area
where
these
two
columns
intersect
is
Example Addition
Hexadecimal Subtraction
The subtraction of hexadecimal numbers follow the same rules as the subtraction of numbers in any other
number system. The only variation is in borrowed number. In the decimal system, you borrow a group of 10 10.
In the binary system, you borrow a group of 210. In the hexadecimal system you borrow a group of 1610.
Example - Subtraction
11
Hexadecimal Addition
Decimal basic concepts:
Decimal is base 10.
There are 10 digits in counting (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
When you reach 10, you carry a 1 over to the next column
The number after 9 is 10
Hexadecimal basic concepts:
Hexadecimal is base 16.
There are 16 digits in counting (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
When you reach 16, you carry a 1 over to the next column
The number after F (decimal 15) is 10 in hex (or 16 in decimal)
1.
2.
3a.
If the result of step two is 16 or larger subtract the result from 16 and carry 1 to the next
column.
3b.
If the result of step two is less than 16, convert the number to hexadecimal.
Example: (Use the color code in each step to see whats happening)
12
The problem:
A
Carry Over:
Carry Over:
1.
2.
3.
(19 16 = 3 carry a 1)
Carry Over:
1.
2.
3.
Decimal 12 is hexadecimal C
Carry Over:
1.
1
A
13
2.
3.
(25 16 = 9 carry a 1)
Carry Over:
1.
2.
3.
(22 16 = 6 carry a 1)
Carry Over:
1.
2.
3.
1 1
1 6 F
+
4 A 2
---------------6 1 1
-----------------
The digits in unit's place F are 2. From the table, F + 2 = 1116 from which 1 is written in unit's place and 1 is
carried over to the next higher (16) place.
The digits in 16's place are added as
1 + 6 + A = 7 + A = 1116 (From table) out of which, 1 is written down as sum and 1 is carried to the next higher
(162) place.
The digits in 162 's place add as 1 + 1 + 4 = 616.
Thus 16F16 + 4A216 = 61116.
Hexadecimal Subtraction:
The rule to be remembered for subtraction is the digit borrowed from the immediate higher place is counted as
16.
14
16 16
B 2
Borrowed
Remaining digit after borrowing
C 3 9
-
B 4 A
-----------------E
------------------In units place, A the bigger number is to be subtracted from 9. So, 1 digit from 16's place is borrowed and 16 +
9 = 25.
A is subtracted from 25.
25 - A16 = F16 (Note the values of A and F are 10 and 15).
As 1 is borrowed from 3, now for the next place 4 is to be subtracted from 2. This again requires borrowing
from the next higher place.
16 + 2 - 4 = 18 - 4 = E16.
Now, for the next place, B is to B subtracted from B remaining after lending 1. B - B = 0.
Thus C3916 - B4A16 - = EF16.
Hexadecimal Multiplication:
The following table gives products of all combinations of two single digits.
While multiplying, if the product consists of two digits, the digit on the left is carried over and added to the
product in the next place.
Example:
15
1 A 8
x
A F
--------------1 8 D 8
1 0 9 0
-------------------------1 2 1
D 8
--------------------------First the digit F in the number AF16 is multiplied with each of the digits in the number 1A816.
F x 8 = 78.
The digit 8 is written below in the product row and 7 is carried over to the next place to be added with the next
product.
F x A = 9616
and 9616 + 716 = 9D16.
D is written in the product row and 9 is carried over to the next place
F x 1 = F.
and F16 + 916 = 1816 .
The second row of multiplication is done in a similar manner, by multiplying the digit A with each of the digits in
1A816.
The two products are then added to get the final product.
Thus 1A816 x AF16 = 121D816.
Question 3: Add F4A16 + 3D916.
Solution:
The addition steps are explained below showing table used for hexadecimal addition.
16
1 1
Carried Over Digits.
F 4 A
+ 3 D 9
----------------1 3 2 3
-----------------
The addition table is used to determine the sum of two digits. If the sum shows two digits in the table, the left
digit is carried over to the immediate higher place and added with the digits in that place. The sums A + 9 = 13,
1 + 4 + D = 5 + D = 12 and 1 + F + 3 = 4 + F = 13 are highlighted in the table.
If the sum is found by writing the digits in decimal form A16 + 916 = 1010 + 910 = 1910. 16 in 19 is carried over as 1
to the immediate higher place, and the remainder 3 is written as sum for that place.
Hence F4A16 + 3D916 = 132316.
17
3 8
Digits
carried over in second
multiplication by F
2 7
Digits
carried over in first
multiplication by D
A 3 9
X
F D
-------------8 4 E 5
9 9 5 7 0
---------------------A 1 A 5 5
----------------------
The products used for multiplication D x 9 = 75, D x 3 = 27, D x A = 82, F x 9 = 87, F x 3 = 2D and F x A = 96
are highlighted in the Multiplication table.
For each product, the digit on the right is written in the product row and the digit on the left is carried over to the
next place.
The digit carried over is added to the product got for the digit in that place.
The two products obtained for D and F with A3916 is then added.
This A3916 x FD16 = A1A5516.
In multiplication of octal numbers a simple rule for multiplication of two digits in any radix is to
multiply them in decimal. If the product is less than the radix, then we take it as the result. If the
product is greater than the radix we divide it by the radix and take the remainder as the least
significant digit. The quotient is taken as carry in the next significant digit.
For example, (3)4 (1)4 = (3)4 but (3)4 (2)4 = (12)4 since 3 2 = 6 is decimal and division of 6 by 4
has the remainder 2 and quotient 1.
To multiply two octal numbers we use the rule given above. The process for multiplication of
octal numbers is illustrated with the help of the following examples:
Evaluate:
(i) 68 238
Solution:
We have 6 3 = 18 in decimal, which when divided by 8 gives a remainder 2 and carry 2. Again 6 2 = 12
in decimal, and 12 + 2 = 14. This when divided by 8 gives a remainder 6 and a carry 1.
Hence 68 238 = 1628
6 3 = 18
18/8 = 2 with remainder 2 l,s,d,
6 2 = 12 + 2 (carry) = 14
14/8 = 1 with remainder 6.
OCTAL MULTIPLICATION
19
20
Here's the tricky part. Since we're dealing with the octal number system ( 8 ), we have to find multiples of 8
closest to each digit. These are 0, 8, 16, 24, 32, 40, 48 and so on...For 30, the closest would be 3 x 8 = 24. So
subtract 30 by 24 to get 6. Carry the 3 over to the second digit.
The number we carry over is determined by the number of 8's we had to subtract from 30 to get a difference of
less than 8. I.E 30 - 8 = 22 - 8 = 14 - 8 = 6. We subtracted 30 by 8 three times so we add 3 to the digit before. Or it
is simply the number we multiply by 8 to get the number closest to 30.
17 + 3 is 20. The multiple ( of 8 ) closest to 20 is 16. So we subtract 20 by 16 to get 4 and carry over a 2 to the 3rd
digit.
21
22