Learn Hexadecimal Numbers: The simple and easy way.

Just like binary, we have hexadecimal numbers, but with 2 obvious differences. Now let’s learn hexadecimal numbers in detail.

The first difference is base 16. And second, obviously, it has 16 digits. But we have a problem here. We know only 10 digits 0…9. In hexadecimal we cannot put 10 as our tenth number, because it is hexadecimal, the series is supposed to go from 0 to 15 digits before it turns to 10.

Hence, in this system, we use alphabets like a, b, c, d, e, and f to represent those numbers. Therefore, the hexadecimal series goes like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, and 15.

The method of converting Decimal to Hexadecimal, and Hexadecimal to Decimal remains the same, just like Binary Numbers. You can read the Binary Number article here.

Learn converting Decimal to Hexadecimal numbers

While converting Decimal to Hexadecimal, we will divide the Decimal by the base number to which we are converting; and collect the reminders. In this case, the base number would be 16, and reminders will be anything between 0 to 15. Let us try a few examples.

Example 1. (26)_{10 }= (?)_{16}

Note that, the number 10 is A, in Hexadecimal. So, (26)_{10 }= (1A)_{16}

Let’s try another example. Example 2. (2052)_{10 }= (?)_{16}

Hence, (2052)_{10 }= (804)_{16}

Learn to convert Hexadecimal to Decimal Numbers

As mentioned before, we will use the same method to convert Hexadecimals to Decimals, which we used to convert Binary Numbers to Decimals, but with the only difference, that we will be using multiples of 16, rather than 2.

Let us discuss this along with some examples.

Example 3. (2A)_{16 }= (?)_{10}

= (2 x 16^{1})+ (A x 16^{0}) = (2 x 16^{1})+ (10 x 16^{0}) = (2 x 16)+ (10 x 1) = 32 + 10 = 42

Note:

1. (A)_{16} = (10)_{10}

2. 16^{0} = 1

Therefore, (2A)_{16 }= (42)_{10}

Let’s have another example. Example 4. (9E)_{16 }= (?)_{16}

= (9 x 16^{1})+ (E x 16^{0}) = (9 x 16^{1})+ (14 x 16^{0}) = (9 x 16)+ (14 x 1) = 144 + 14 = 158

Note:

1. (E)_{16} = (14)_{10}

2. 16^{0} = 1

Thus, (9E)_{16 }= (158)_{10}

Easy? Drop your question in the comment box below. I will try my best to answer. Happy coding!