Conversion of an Octal number into Binary and vice versa :-
The numbering system which uses
In binary system (base-2) a total of 2 digits (0 and 1) are used to represent a number of any size (magnitude), where as in octal system (base-8) a total of 8 digits (0, 1, 2, 3, 4, 5, 6 and 7) are used to represent a number of any size (magnitude).
The highest digit in the octal system is (7)8. The number (7)8 in binary is represented as (111)2. You will notice that we are using three binary digits (bits) to represent the highest octal digit.
In octal to binary conversion, we will have to use three bits to represent each octal digit.
The following table shows the conversion of each octal digit into their corresponding binary digits.
Octal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|---|
Binary | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
For example, an octal number
Octal Number -> 2 4 6
Binary Number -> 010 100 110
Hence,
Similarly while converting a binary number into an octal, we first divide the binary number into groups of 3 digits each starting from the right most side. Each of these three binary digits are replaced with their corresponding octal digits.
In case we find that the left most group of binary digits do not have three digits, we prefix the required number of zeros to make it three binary digits.
For example, let us try convert a binary
Binary Number -> 1 101 100
Binary Number -> 001 101 100 // After prefixing zeros in the left most group
Octal Number -> 1 5 4
Hence, the octal equivalent of the given binary
(369)8 is an octal number.- Each octal digit is represented using three bits.
- Binary number
(10101010)2 is equivalent to an octal number(252)8 . - An octal number
(364)8 is equivalent of binary number(011110100)2 .
0 Comments