Table of Contents

Last modified on August 3rd, 2023

The **decimal number system**, the most widely used in the oldest numeral system, consists of numbers with the base of 10. It has 10 notations, starting from 0 to 9.

In contrast, the **hexadecimal number system** consists of numbers with the base of 16. It has 16 notations starting from 0 to 15, where 10 to 15 are expressed with alphabets A to F.

Converting a decimal to a hexadecimal means writing it in its hexadecimal equivalent.

The formula to convert a decimal to hexadecimal is:

Decimal Number = d_{n-1} × 16^{r-1}+….+ d_{2} × 16^{2} + d_{1} × 16^{1} + d_{0} × 16^{0}, here n = number of digits, r = place of the digit

In general we convert a decimal to hexadecimal with successive division method as shown in the example below.

The steps are:

- Divide the number by 16. Note the remainder separately in a column. If the remainder is greater than 16, convert it to hexadecimal alongside. Suppose the remainder is 4, then it will be 4 in hexadecimal also. However, if it is 12, then the hexadecimal remainder is C.
- Write the integer quotient for the next iteration.
- Divide it again by 16. Note the remainder again, and write it in hexadecimal wherever required.
- Repeat the division process until the quotient is zero. Write the remainder from the bottom to the top. This number is the hexadecimal number.

**Convert 9124 to hexadecimal.**

Solution:

The solution is given in the figure alongside.

We get (9124)_{10} = (23A4)_{16}

converting a **DECIMAL** **NUMBER** **with a** **FRACTIONAL PART** to a hexadecimal equivalent

**(1020.1) _{10} to hexadecimal.**

Solution:

The integer 1020 is successively divided by 16:

1020/16 → 63 R 12 → C in hex

63/16 → 3 R 15 → F in hex

3/16 → 0 R 3 → 3 in hex (we stop the process since Q = 0)

For integer, we write the remainders from bottom to up.

So, the hexadecimal equivalent for the integer part is 3FC.

Now let us work with the fractional part, i.e., 0.1

Multiplying it with 16 till we feel that the process isn’t going to stop.

0.1 × 16 → 1.6 → 1 (1.6 – 1 = 0.6)

0.6 × 16 → 9.6 → 9 (9.6 – 9 = 0.6)

0.6 × 16 → 9.6 → 9 (9.6 – 9 = 0.6)

0.6 × 16 → 9.6 → 9 (9.6 – 9 = 0.6)

It is endless. So we stop the iteration right here.

For fractional part, we write the remainders from top to bottom. (Here we take the remainders till 4 significant digits)

∴ hexadecimal equivalent for the fractional part = .1999

∴ (1020.1)_{10 } = (3FC.1999)_{16}

**(23.625) _{10} = ( ? )_{16}**

Solution:

We will divide 23 by 16

23 ÷ 16 = 1 R 7

1 ÷ 16 = 0 R 1

Writing the remainders from the bottom up, we get 17

Now, we will multiply the decimal number with 16 separately to eliminate the decimal separator,

0.625 × 16 = 0.0 + 10 → A

And, putting A with a decimal point after 17, the final hex equivalent is 17.A

∴(23.625)_{10} = (17.A)_{16}

**(724.25) _{10} = ( ? )_{16}**

Solution:

For integer part, dividing by 16:

724 ÷ 16 = 45 R 4

45 ÷ 16 = 2 R 13

2 ÷ 16 = 0 R 2

The hexadecimal is 2D4

For the fractional part:

0.25 × 16 → 4.00 → 4 (4.00 – 4 = 0.00)

0.00 × 16 → 0.00 (stopping the process here)

so, (724.25)_{10} = (2D4.4)_{16} or (2D4.4)_{H}

A reference chart is shown below which can help us to convert decimal to hexadecimal or other numbers like binary.

Last modified on August 3rd, 2023