The learning nerd!

On a mission to learn everything!

Decimal to Octal and Octal to Decimal —

This is the continuation of learning binary series.
You learned that binary is in the base two number system.
You also learned Hex is in the base 16 number system.
Well Octal is in the base 8 number system.
0 1 2 3 4 5 6 7

Decimal to Octal

Example 1:
Lets start with a decimal number
33
Since you know that Octal is in the base number system.
You divide 33 / 8
33 / 8 =  4
remainder 1  – Since you know 8 goes into 33 4 times and there is the number 1 left over
Then you take the number you got and divide that by 8
4 / 8 =  0
remainder none – Since you know goes into 4 0 times and there for the remainder is none.
So the answer is 41
Example 2:
Lets start with another decimal number
98
You divide 98 / 8
98 / 8 = 12
Remainder 2 – Since you know 8 goes into 98 12 times and there is the number 2 left over
Then you take the number you got and divide that by 8
12 / 8 = 1
Remainder 4 – Since you know 8 goes into 12 1 time and there is the number left over
Then you take the number you got and divide that by 8
1 / 8 = 0
Remainder 1 – Since you know 8 goes into 1 0 times and there is the number 1 left over
You now take all the remainders you got and put them together. Last to first.
So the answer is 142

Octal to Decimal

Example 1:
As you learned above octal is a base 8 number system,
0 1 2 3 4 5 6 7
Lets start with an octal number
238
2 | 3 | 8
Each digit is multiplied by 8 by its power
2 | 1 | 0
2 × 8² + 3 × 8¹ + 8 × 8⁰ – You now solve this with PEMDAS
P(parenthesis)-E(exponents)-M(multiplication)-D(division) -A(addition)-S(subtraction)
You solve the exponents then the multiplication and then addition
2 × 64 + 3 × 8  + 8
128 + 24 + 8 = 152
Example 2:
Lets start with another octal number
7050
7 | 0 | 5 | 0
Each digit is multiplied by 8 by its power
3 | 2 | 1 | 0
7 × 8³ + 0 × 8² + 5 × 8¹ + 0 × 8⁰
7 × 512 + 0 × 64 + 5 × 8 + 0
3584 + 0 + 40 + 0 = 3624


Categorised as: Binary | Hardware



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>