Converting Decimal To Hexadecimal
Converting Decimal To Hexadecimal
Steps:
1. Divide the decimal number by 16. Treat the division as an integer division.
2. Write down the remainder (in hexadecimal).
3. Divide the result again by 16. Treat the division as an integer division.
4. Repeat step 2 and 3 until result is 0.
5. The hex value is the digit sequence of the remainders from the last to first.
Note: a remainder in this topic refers to the left over value after performing an integer
division.
HEXADECIMAL 0 1 2 3 4 5 6 7 8 9 A B C D E F
DECIMAL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
REMAINDER (in
NOTES DIVISION RESULT
HEXADECIMAL)
Start by dividing the number by 16,
that is
(1128/16).
(70/16).
(the number 70 on the DIVISION
column comes from the previous
RESULT).
Example 2
Convert the number 256 DECIMAL to HEXADECIMAL
DIVISION RESULT REMAINDER (in HEX)
256 / 16 16 0
16 / 16 1 0
1 / 16 0 1
ANSWER 100
Example 3
Convert the number 921 DECIMAL to HEXADECIMAL
ANSWER 399
Example 4
Convert the number 188 DECIMAL to HEXADECIMAL
REMAINDER
DIVISION RESULT
(in HEX)
188 / 16 11 C (12 decimal)
11 / 16 0 B (11 decimal)
ANSWER BC
Note that here, the answer would not be 1112, but BC. Remember to write down the
remainder in hex, not decimal.
Example 5
Convert the number 100 DECIMAL to HEXADECIMAL
REMAINDER
DIVISION RESULT
(HEX)
100 / 16 6 4
6 / 16 0 6
ANSWER 64
Example 6
Convert the number 590 DECIMAL to HEXADECIMAL
REMAINDER
DIVISION RESULT
(HEX)
590 / 16 36 E (14 decimal)
36 / 16 2 4 (4 decimal)
2 / 16 0 2 (2 decimal)
ANSWER 24E