How to convert decimal to octal, we've to find out about both the amount system first. A number with base 8 is that the octal number and variety with base 10 is that the 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 decimal to octal conversion method, we divide the amount by 8 and write the remainders within the reverse order to urge the equivalent octal number.
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.
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 other 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 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.
Then convert each digit of hexadecimal number into 4 little bits of binary number whereas convert each group of three bits from least significant in 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.
This is a straightforward method which 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 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 remainders from the bottom to the top (or in the reverse order), which will also be equivalent to octal number of given decimal number. This is a procedure for converting an integer decimal number, the algorithm is given below.
Take the decimal number as 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 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.
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 the 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 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 are 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.
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 the 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 a 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.