Hexadecimal number system (Hex) is just like decimal and binary number system. Where in decimal system the base is 10 and in binary system the base is 2, the base in hexadecimal system is 16. In Hex, we use digits 0-9 and alphabets A to F. The decimal numbers 0-9 are same in Hex system but for decimal numbers 10-15, we have A-F in Hex. For decimal numbers 16-25, we resume our counting of Hex from 10. Since we mostly use decimal numbers, it is easier to understand Hex in terms of decimal numbers. The following table shows how each number in decimal has an equivalent number in Hex.
There’s no way we can remember this table or draw it every time we are using Hex system, but we can easily convert from decimal system to Hex and vice versa. If you know how to convert from binary to decimal or from decimal to binary, Hex conversion will be very easy for you because it is similar to binary conversion.
Lets’ start by converting a Hex number (4FD in this case) to a decimal number. For this, we will use place values. Starting from the right hand side, D is the lowest number and 4 is the highest number. So, we will multiply the lowest number with the lowest power of 16. The lowest power of 16 is 0. Then multiply the next number (F in this case) with the next highest power of 16 (which is 1). Lastly, multiply the highest number (4 in this case) with the highest power of 16 (which is 2 here). Then add all the products to find the decimal equivalent of 4FD. It comes out to be 1277. We Also have age calculator, which you should check out to know your exact age.
4FD = (4 x 162) + (F x 161) + (D x160)
= (4 x 256) + (15 x 16) + (13 x 1)
= 1024 + 240 + 13
Let’s convert the decimal number 1277 back to Hex. We will also know for sure if our conversion is correct because we know that it should be 4FD. We will use synthetic division for conversion from decimal to Hex. This means that we will continuously divide the number by 16 unless our number becomes less than 16. This process is a little complicated so we will divide it into steps.
Once, we are clear on conversions, we will move towards arithmetic operations on Hex numbers. Addition of Hex numbers is quite similar to how we do it in case of decimal numbers.
Multiplication in Hex is same as multiplication in decimal.
Long division in Hex is same as long division in decimal except that subtraction and addition is done in Hex.