- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Convert Octal to Binary?n
Octal number is one of the number systems which has value of base is 8, that means there only 8 symbols − 0, 1, 2, 3, 4, 5, 6, and 7. Whereas Binary number is most familiar number system to the digital systems, networking, and computer professionals. It is base 2 which has only 2 symbols − 0 and 1, these digits can be represented by off and on respectively.
Conversion from Octal to Binary number system
There are various direct or indirect methods to convert a octal number into binary number. In an indirect method, you need to convert an octal number into other number system (e.g., decimal or hexadecimal), then you can convert into binary number by converting each digit into binary number from hexadecimal system and using conversion system from decimal to binary number.
Example − Convert octal number 205 into binary number.
First convert it into decimal or hexadecimal number, = (205)8 = (2x82+0x81+5x80)8 or (010 000 101)2 Because base of octal and hexadecimal are 8 and 16 respectively. = (133)10 or (0 1000 0101)2 = (133)10 or (85)16 Then convert it into binary number by converting each digit. = (1x27+0x26+0x25+0x24+0x23+1x22+0x21+1x20)2 or (1000 0101)2 = (10000101)2
However, there is a simple direct method to convert an octal number to binary number. Since there are only 8 symbols (i.e., 0, 1, 2, 3, 4, 5, 6, and 7) in octal representation system and its base (i.e., 8) is equivalent of 23=8. So, you can represent each digit of octal in group of 3 bits in binary number.
Octal Symbol | Binary equivalent |
---|---|
0 | 000 |
1 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
This method is simple and also works as reverse of Binary to Octal Conversion. The algorithm is explained as following below.
- Take Octal number as input
- Convert each digit of octal into binary.
- That will be output as binary number.
Example-1 Convert octal number 540 into binary number.
According to above algorithm, equivalent binary number will be,
= (540)8 = (101 100 000)2 = (101100000)2
This is very simple conversion, you can use for mixed (integer with fractional) octal number as well.
Example-2 − Convert octal number 352.563 into binary number.
According to above algorithm, equivalent binary number will be,
= (352.563)8 = (011 101 010 . 101 110 011)2 = (011101010.101110011)2
- Related Articles
- How to Convert Binary to Octal?
- How to Convert Octal to Binary?
- How to Convert Decimal to Binary, Octal, and Hexadecimal using Python?
- C++ Program to Convert Octal Number to Binary Number
- C++ Program to Convert Binary Number to Octal and vice-versa
- How to Convert Decimal to Octal?
- Python program to print decimal octal hex and binary of first n numbers
- How to convert a Decimal to Octal using C#?
- Java Program to convert integer to octal
- Java Program to convert Decimal to Octal
- Golang Program to convert Decimal to Octal
- Swift Program to convert Decimal to Octal
- C++ Program to convert Decimal Numbers to Octal
- C# program to convert decimal to Octal number
- Java Program to convert int to Octal String
- How to convert an integer to a octal string in Python?
