Converting Decimal to Octal-
In number system, it is very important to have a good knowledge of how to convert numbers from one base to another base.
In the last article, we discussed-
How to convert a Decimal number to Binary number?
We have learnt that any number can be easily converted from base 10 to any other base using division method and multiplication method.
In this article, we will discuss how to convert any decimal number to Octal number.
(Given Number)_{10} → (?)_{8} |
There are two cases possible-
Case-01: For numbers carrying no fractional part
Case-02: For numbers carrying a fractional part
Case-01: For numbers carrying no fractional part-
To convert the numbers carrying no fractional part from base 10 to base 8, we will use division method.
Division method involves following 2 steps-
Step-01:
Divide the given number (in base 10) with 8 until the result finally left is less than 8.
Step-02:
Traverse the result and remainders from bottom to top to get the required number in base 8.
Example-
Suppose we want to convert a number (1032)_{10} to base 8.
(1032)_{10} → (?)_{8}
Then using division method, we have-
Thus,
(1032)_{10} = (2010)_{8} |
For numbers carrying a fractional part-
Suppose the given number consists of some real part and some fractional part.
To convert such numbers from base 10 to base 8, we will treat the real part and fractional part separately.
For real part-
To convert the real part of number to base 8, we will use division method as we have used in above example.
For fractional part-
To convert the fractional part of number to base 8, we will use multiplication method.
Multiplication method involves following steps-
Step-01:
Multiply the given fractional number with 8 and write the real part and fractional part of result so obtained separately.
Step-02:
Multiply the fractional part obtained after multiplication in previous step with 8 and write the real part and fractional part of result so obtained separately.
Step-03:
Recursively apply step-02 until fractional part obtained after multiplication becomes 0.
(In case fractional part does not terminate to 0, we can find the result up to as many places as we want.)
The series of real part of multiplication results obtained in above steps from top to bottom is the required number in base 8. |
Following example illustrates how to apply these steps-
Example-
Suppose we want to convert a number (1032.6875)_{10} to base 8.
We will treat the real part and fractional part separately.
For real part-
The real part (1032)_{10} will be converted to base 8 in exactly the same manner using division method as we have done above.
So, for real part, we have-
(1032)_{10} = (2010)_{8} |
For fractional part-
The fractional part (0.6875)_{10} will be converted to base 8 using multiplication method.
Using multiplication method, we have-
Real part | Fractional Part | |
0.6875 x 8 | 5 | 0.5 |
0.5 x 8 | 4 | 0.0 |
Now, traverse the real part column from top to bottom to obtain the required number in base 8.
Thus,
(0.6875)_{10} = (54)_{8} |
Explanation-
Step-01:Multiply 0.6875 with 8. Result = 5.5. Write 5 in real part and 0.5 in fractional part.
Step-02:Multiply 0.5 with 8. Result = 4.0. Write 4 in real part and 0.0 in fractional part. Since, fractional part becomes 0, so we stop. |
Combining the result of real and fractional parts, we have-
(1032.6875)_{10} = (2010.54)_{8} |
PRACTICE PROBLEM BASED ON CONVERTING FROM BASE 10 TO BASE 8-
Problem-
Convert the following numbers from base 10 to base 8-
- (172)_{10}
- (172.878)_{10}
Solution-
1. (172)_{10}
(172)_{10} → ( ? )_{8}
Using division method, we have-
Thus,
(172)_{10} = (254)_{8} |
2. (172.878)_{10}
(172.878)_{10} → ( ? )_{8}
We will treat the real part and fractional part separately-
For real part-
- The real part is (172)_{10}
- We will convert the real part from base 10 to base 8 using division method.
- We have already done this in above problem.
Thus,
(172)_{10} = (254)_{8} |
For fractional part-
- The fractional part is (0.878)_{10}
- We will convert the fractional part from base 10 to base 8 using multiplication method.
Using multiplication method, we have-
Real part | Fractional Part | |
0.878 x 8 | 7 | 0.024 |
0.024 x 8 | 0 | 0.192 |
0.192 x 8 | 1 | 0.536 |
0.536 x 8 | 4 | 0.288 |
Since, the fractional part terminates to 0 after several iterations. So, let us find the value up to 4 decimal places.
Now, traverse the real part column from top to bottom to obtain the required number in base 8.
Thus,
(0.878)_{10} = (7014)_{8} |
Combining the results of real and fractional part, we have-
(172.878)_{10} = (254.7014)_{8} |
Also read: Converting Decimal to Hexa
To gain better understanding of how to convert a Decimal number (Base 10) to a Octal number (Base 8),
Get more notes and other study material of Number System.
Watch video lectures by visiting our YouTube channel LearnVidFun.