Conversion of Hexadecimal number into Octal and vice versa :-
To convert a hex number to an octal, we will first convert the hex number to binary and then to octal.
Below are the detailed steps followed for the above mentioned process:
- Convert each hex digit to its corresponding four binary digits (bits) from right to left.
- Combine all the binary digits.
- Separate the binary digits into groups of 3 bits each from right to left.
- Ensure the left most group has 3 bits by prefixing necessary zeros.
- Find the octal equivalent of each group and combine the resultant digits together.
For example, hexadecimal number
Hex Number -> 5 A F 6
Binary Number -> 0101 1010 1111 0110
Binary Number -> 0101101011110110
Binary Number -> 0 101 101 011 110 110
Binary Number -> 000 101 101 011 110 110 // After prefixing zeros in the left most group
Octal Number -> 0 5 5 3 6 6
Octal Number -> 055366
Hence, the octal equivalent of the given hexadecimal number is
- Convert each octal digit to its corresponding three binary digits (bits) from right to left.
- Combine all the binary digits.
- Separate the binary digits into groups of 4 bits each from right to left.
- Ensure the left most group has 4 bits by prefixing necessary zeros.
- Find the hex equivalent of each group and combine the resultant digits together.
Octal Number -> 2 4 6
Binary Number -> 010 100 110
Binary Number -> 010100110
Binary Number -> 0 1010 0110
Binary Number -> 0000 1010 0110 // After prefixing zeros in the left most group
Hex Number -> 0 A 6
Hex Number -> 0X0A6
(ABCD)16 is a hexadecimal number.- Each hexadecimal digit is represented as
four bit binary number. - Octal number
(157)8 is equivalent to the hexadecimal number(6F)16 . - Hexadecimal number
(369)16 is equivalent of octal number(1561)8 .
0 Comments