Decimal To Hex Conversion
In number system, we have learned about binary numbers, decimal numbers, octal numbers and hexadecimal numbers. All these numbers have different bases such as binary has base 2, decimal has base 10, octal has base 8 and hex has base 16. These numbers can be converted into other number systems by following the methods or procedure.
Decimal to Hexadecimal Table
To convert the decimal number to hex, students have to remember the table given below, to solve the problems in a quick way. Also, learn here Hexadecimal Number System.
Decimal Number |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Hexadecimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
How to Convert a Decimal number into Hexadecimal number?
To convert a decimal number into hex follow the below-given, steps;
- First, divide the decimal number by 16, considering the number as an integer.
- Keep aside the remainder left.
- Again divide the quotient by 16 and repeat till you get the quotient value equal to zero.
- Now take the values of the remainder’s left in the reverse order to get the hexadecimal numbers.
Note: Remember, from 0 to 9, the numbers will be counted as same in the decimal system. But from 10 to 15, they are expressed in alphabetically order such as A, B, C, D, E, F and so on.
Let us take an example to understand the steps given above for decimal to hex conversion.
Example: Convert (960)_{10} into hexadecimal.
Solution: Following the step,
- First, divide 960 by 16.
960 ÷ 16 = 60 and remainder = 0
- Again, divide quotient 60 by 16.
60 ÷ 16 = 3 and remainder 12.
- Again dividing 3 by 16, will leave quotient=0 and remainder = 3.
- Now taking the remainder in reverse order and substituting the equivalent hexadecimal value for them, we get,
3→3, 12→C and 0→0
Therefore, (960)_{10} = (3C0)_{16}
This example must have made you understand the conversion method of decimal to hex. Let us solve a few more examples to get a good practice over it.
Decimal to Hex Examples
Problem 1: Convert decimal number 49 into hexadecimal.
Solution: Let us create a table to solve the problem.
Divide by 16 |
Quotient |
Remainder |
Hex Value |
49 ÷ 16 |
3 |
1 |
1 |
3 ÷ 16 |
0 |
3 |
3 |
Therefore, 49_{10} = 31_{16}.
Problem 2: Convert 1228_{10 }into hex.
Solution:
Divide by 16 |
Quotient |
Remainder |
Hex Value |
1228 ÷ 16 |
76 |
12 |
C |
76 ÷ 16 |
4 |
12 |
C |
4 ÷ 16 |
0 |
4 |
4 |
Therefore, 1228_{10 }= 4CC_{16}
Problem 3: Convert 600_{10} into hexadecimal number.
Solution:
Divide by 16 |
Quotient |
Remainder |
Hex Value |
600 ÷ 16 |
37 |
8 |
8 |
37 ÷ 16 |
2 |
5 |
5 |
2 ÷ 16 |
0 |
2 |
2 |
Therefore, 600_{10 }= 258_{16}