How to Convert Decimal to Octal?
Conversion of Decimal to Octal
We have to find out about both the amount systems first. A number with base 8 is an octal number and variety with base 10 is a decimal number. Here we'll learn conversion from decimal to octal number. It is the same as converting any decimal number to binary or decimal to hexadecimal.
In decimal to binary, we divide the amount by 2, in decimal to hexadecimal we divide the amount by 16. In the case of the decimal to octal conversion method, we divide the amount by 8 and write the remainder within the reverse order to urge the equivalent octal number.
The decimal system is the most familiar number system to the general public. It is the base 10 which has only a total of 10 symbols − 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Whereas the octal system is one of the number systems to represent numbers. It is the base 8 which has only 8 symbols as 0, 1, 2, 3, 4, 5, 6, and 7.
An Overview of Octal
Before starting to learn to convert the decimal to octal, it would be better to first have a good idea regarding the Octal. So, in mathematics Octal is a numeral system, which is quite often referred to as Oct as well. In simple terms, this system takes 8 as a base of the calculation and not the number 10. So, what the number 10 represents in the normal numeral system is represented by 8 in the octal numeral system.
Now, coming to the Decimal, in the normal numeral system the decimal is always represented by 10, but in the octal numeral system, it is again represented by 8. If you might be wondering that if 10 is represented by 8 in the octal numeral system then what about 100. Then again it is simple, 100 is 10 times 10, and in a similar manner, for the octal numeral system it becomes 8 times 8, that is to say, 65. So, 100 of the normal numeral system becomes 64 in the octal numeral system.
In the decimal system, as said above, each number has a base of ten. So, let us take as an example of Seventy-four, 74. So it means 7 multiplied by 10 to the power of 1, and adding. 4 multiply by 10 to the power of 0.
Now, let us look at the octal numeral system the same number which is 74, which means multiplying 8 with the 8, and then adding 8 to the power of 1 and then again adding 2.
There is so much more to learn about the octal number system, and if you wish to learn about this system of numerals then click on this link.
Converting the Decimal to Octal
There are many methods for converting the decimal to octal, a few of which are discussed here:
Euclidean Method of Successive Division by 8: As the name suggests this method comes from the Greek Mathematician Euclid. All you have to do here is to divide the original number by the power of 8, which is supposed to be the largest power of 8. By doing so, you are going to have reminders, what you have to do of these reminders is to divide the smaller powers of 8 in a successive manner, until at last you are left with 1. The formation of the Octal numerals is done by the quotients, and it is written in the order, which is generated by the algorithms.
Method of Successive Multiplication by 8: This method is also useful for converting the Decimal fraction to the octal. First, all you have to do is to multiply the decimal fraction by the 8. Whatever result may come, its integer part becomes the first digit of the octal fraction. Now do the same with the fractional part of the number, that is to say, multiplying it with the number 8 until at last, it becomes null. Sometimes, these two given methods, which is to say, the Euclidean Method of Successive division by 8 and the Method of successive multiplication by 8.
Conversion from Decimal to Octal Number System
Let’s learn how to convert decimal to octal. There are various direct or indirect methods to convert a decimal number into an octal number( decimal to octal conversion method). In the indirect method, we need to convert the decimal number into another number system (e.g., binary or hexadecimal), then we can convert them into binary numbers by converting each digit into binary numbers from hexadecimal and using grouping from the octal numeration system.
Example − Convert the Decimal Number 98 into an Octal Number
First, convert it into a binary or hexadecimal number.
= (1x26 + 1x25 + 0x24 + 0x23+ 0x22 + 1x21+ 0 x 20)10 or (6 x 161+2x160)10
Because the bases of the binary and hexadecimal are 2 and 16, respectively, you get
Then convert each digit of the hexadecimal number into 4 little bits of binary number whereas converting each group of three bits from least significant into a binary number.
= (001 100 010)2
or (0110 0010)2
= (001 100 010)2
= (1 4 2)8
But, there are two of the direct methods which are available for converting the decimal number into an octal number − Converting with Remainders and Converting with Division. These are explained as follows below.
(a) Converting With Remainders (for Integer Part)
This is a straightforward method that involves dividing the number to be converted. Let the decimal number be N and then divide this number with 8 because the base of the octal number system is 8. Note down the worth of the remainder, which can be − 0, 1, 2, 3, 4, 5, 6, or 7. Again we divide the remaining decimal number until it becomes 0 and note every remainder of the step performed. Then write the remainder from the bottom to the top (or in the reverse order), which will also be equivalent to the octal number of the given decimal number. This is a procedure for converting an integer decimal number, the algorithm is given below.
Take the decimal number as a dividend.
Divide the number by 8 (as 8 is the base of octal so divisor here).
Preserve the remainder in an array (and it will be: 0, 1, 2, 3, 4, 5, 6 or 7 because of the divisor 8).
Repeat the above two steps until the amount is bigger than zero.
Print the mentioned array in the reverse order (which will also be equivalent to the octal number of the given decimal number).
The dividend (here is the given decimal number) is the number here which is also being divided, the divisor (here the base of the octal, i.e., 8) in the number by which the dividend is divided, and the quotient is the result for the division.
Example − To Convert the Decimal Number 210 into an Octal Number
As we know the given number is a decimal integer number, so just by using the above algorithm, we perform a short division by 8 with the remainder.
Now, we write the remainder from the bottom to the top (in the reverse order), this will be 322 which is also the equivalent octal number for the decimal integer 210.
For the decimal fractional part, the method is explained as follows below.
(b) Converting With Remainders (for Fractional Part)
Let the decimal fractional also be a part of M then we multiply this number by 8 because the base for the octal number system is 8. Note down the value of the integer part, which will be − 0, 1, 2, 3, 4, 5, 6, and 7. Again we multiply the remaining decimal fractional number until it becomes 0 and then note every integer part for the result of every step. After that write the noted results of the integer part, which will be an equivalent fraction octal number of the given decimal number. This is a procedure for converting a fractional decimal number, the algorithm is given below.
Take the decimal number as a multiplication.
Multiply this number by 8 (8 is the base of octal so multiplier here).
Store the value of the integer part of the result in an array (it will be: 0, 1, 2, 3, 4, 5, 6, and 7 because of multiplier 8).
Repeat the two of the above steps until and unless the number becomes zero.
Print the array (which is going to be like a fractional octal number to a given decimal fractional number).
Example − Convert the Decimal Fractional Number 0.140869140625 Into an Octal Number.
As we know the given number is a decimal fractional number, so by just using the above algorithm, we perform a short multiplication by 8 with the integer part.
Now, we write all these resultant integer parts, and this will be approximately 0.11010 which is also equivalent to the octal fractional number for the decimal fractional 0.140869140625.
FAQs on Convert Decimal to Octal
1. How is octal calculated?
The octal numeral system, or we can say oct for short, is known to be the base-8 number system and uses the digits from 0 to 7. We can make octal numerals from binary numerals by grouping various consecutive binary digits into groups of three (starting from the very right).
2. Why does octal skip 8 and 9?
Not confusing at all! The jump from the number 7 to 10 is precisely the point! The octal system represents numbers in the base 8, which means that each digit represents the power of the number 8. Therefore, the 1's place only needs the digits 0-7, and the number 10 in octal (NOT the decimal number 10), is 1×81+0×80=8 in decimal.
3. What is the base of 16?
The digits in hexadecimal (or base 16) start with the numbers 0,1,2,3,4,5,6,7,8,9 (just like in base 10). The remaining base-16 digits are here A,B,C,D,E,F, corresponding in order to the remaining base equal to 10 numbers less than 16 (namely 10,11,12,13,14,15).
4. How do I convert decimal to binary?
An easy method of converting decimal to binary number equivalents is to write down the decimal number and to continually divide-by-2 (two) to give a result and a remainder of either a “0” or a “1” until the final result we get equals zero.