What is Octal Number? The number to the base 8 is called octal numbers. It uses the numbers from 0 to 7. What is Hexadecimal Number? The number to the base 16 is called Hexadecimal numbers. It uses the numbers from 0 to 9, A, B, C, D, E, and F. There are mainly two ways to convert hexadecimal number to binary number.
Indirect Method
In indirect method first we need to convert hexadecimal number to decimal number then we can convert that decimal number to octal number.
For Example
Convert Hexadecimal number (D7)16to Octal number ( )8
A) First, we convert hexadecimal number (D7)16to decimal number ( )10, we use the Multiplication method.
Steps | Description | Solution |
---|---|---|
1 | Write down the hexadecimal number. | (D7)16 |
2 | Count right to left of the hexadecimal number. | 1 0 D 7 |
3 | List the powers of sixteen from right to left. Start at 160, evaluating it as “1”. Increment the exponent by one for each power. | 1 0 D 7 161 160 |
4 | Multiply each digit of the hexadecimal number by the corresponding power of 16 | D(13)x161 + 7×160 |
5 | Add all the numbers to get the decimal equivalent. | = D(13)x161 + 7×160 = 13×16 + 7×1 = 208 + 7 = 215 (D7)16 = (215)10 |
B) Secondly, we convert decimal number ( )10 to octal number ( )8, we use the Division method.
Steps | Description | Solution |
---|---|---|
1 | Divide decimal number by 8 until quotient is 0. | 215/8 = 26 Remainder is 7 26/8 = 3 Remainder is 2 3/8 = 0 Remainder is 3 |
2 | The last remainder obtained from the division is the most significant bit (MSB) of the binary number. Hence arrange the number from the most significant bit (MSB) to the least significant bit (LSB). Read from the bottom (MSB) to top (LSB) as 327. | (215)10 = (327)8 |
Hexadecimal number (D7)16 to Octal number (327)8
Direct Method
In this method, we grouped hexadecimal number and replace their equivalent octal number. To get octal number of given hexadecimal number, first we have to convert hexadecimal number into its 4 bits binary equivalent and then convert binary number into its octal equivalent.
For Example
Convert Hexadecimal number (D7)16 to Octal number ( )8
Steps | Description | Solution |
---|---|---|
1 | Write down the hexadecimal number | (D7)16 |
2 | Group all the digits in sets of four starting from the LSB (far right). | (D)16 = (1101)2 (7)16 = (0111)2 |
3 | Group each value of step 2 to make a binary number. | (D7)16 = (11010111)2 |
4 | Rearrange all the digits in sets of three starting from the LSB (far right). Add zeros to the left of the last digit if there aren’t enough digits to make a set of three. | 011 010 111 |
5 | Use the table below to convert each set of three into an octal digit. | 011 = 3 010 = 2 111 = 7 (D7)16 = (327)8 |