# Conversion of Octal Number System to Binary, Decimal and Hexadecimal Number Systems

Here, we are going to learn **how to convert Octal Number System to Binary, Decimal and Hexadecimal Number Systems?**

Submitted by Saurabh Gupta, on October 19, 2019

### 1) Conversion of Octal Number System to Binary Number System

To convert octal numbers into binary numbers, we can use the relationship between octal and binary numbers.

Octal Number | Binary Number |
---|---|

0 | 000 |

1 | 001 |

2 | 010 |

3 | 011 |

4 | 100 |

5 | 101 |

6 | 110 |

7 | 111 |

**Example 1: Convert (73.2) _{8} into ( ? )_{2}**

**Solution:**

Using the table provided above, we can replace octal numbers with their equivalent binary digits.

7 = 111 3 = 011 2 = 010

Therefore, **(73.2) _{8} = (111 011.010)_{2}**

**Example 2: Convert (475.62) _{8} into ( ? )_{2}**

**Solution:**

Using the table provided above, we can replace octal numbers with their equivalent binary digits.

4 = 100 7 = 111 5 = 101 6 = 110 2 = 010

Therefore, **(475.62) _{8} = (100 111 101.110 010)_{2}**

### 2) Conversion of Octal Number System to Decimal Number System

Conversion of octal number into a decimal number can be done using the positional weights by multiplying the positional weights with the corresponding bit and add them all together to obtain the decimal number.

- In an integral part of the octal number, the weights follow the pattern as
**8**,^{0}**8**,^{1}**8**,^{2}**8**,^{3}**8**,^{4}**8**and so on from right to left.^{5} - In the fractional part of the octal number, the weights follow the pattern as
**8**,^{-1}**8**,^{-2}**8**,^{-3}**8**,^{-4}**8**and so on from left to right.^{-5}

**Example 1: Convert (75.3) _{8} = ( ? )_{10}**

**Solution:**

We multiply each bit with the corresponding positional weight and then add them together to get the result.

Therefore, **(75.3) _{8} = (61.375)_{10}**

**Example 2: Convert (624.712) _{8} = ( ? )_{10}**

**Solution:**

We multiply each bit with the corresponding positional weight and then add them together to get the result.

Therefore, **(624.712) _{8} = (404.894)_{10}**

**Example 3: Convert (482.31) _{8} = ( ? )_{10}**

**Solution:**

Given number **(482.31) _{8} is not an octal number as a range of octal number is from 0 to 7 and the given number includes 8. So, it cannot be converted to a decimal number**.

### 3) Conversion of Octal Number System into Hexadecimal Number System

Conversion of the octal number to hexadecimal can only be done using a certain definite path. We first have to convert octal number to binary number and then convert the binary number into hexadecimal number i.e., **Octal Number → Binary Number → Hexadecimal Number**

**Example 1: Convert (35.7) _{8} into ( ? )_{16}**

**Solution:**

**Step 1:** Convert octal number to binary number.

Therefore, **(35.7) _{8} = (011101.111)_{2}**

**Step 2:** Convert binary number to a hexadecimal number.

Therefore, **(011101.111) _{2} = (1D.E)_{16}**

Therefore, **(35.7) _{8} = (1D.E)_{16}**

**Note:** To know how to convert the binary number into a hexadecimal number?, Read: Conversion of binary number into a hexadecimal number.

**Example 2: Convert (73.2) _{8} into ( ? )_{16}**

**Solution:**

**Step 1:** Convert octal number to binary number.

Therefore, **(73.2) _{8} = (111011.010)_{2}**

**Step 2:** Convert binary number to a hexadecimal number.

Therefore, **(111011.010) _{2} = (3B.4)_{16}**

Therefore, **(73.2) _{8} = (3B.4)_{16}**

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.