3

Hexadecimal

Last Update Unknown

Hexadecimal

Hexadecimal numbers are a base-16 system as there are 16 digits. The first ten digits are 0 to 9, and the remaining 6 digits are represented by the letters A, B, C, D, E and F.


Hexadecimal is used as a short hand for writing out long binary numbers. It is much easier for humans to read and understand than binary!


We use the same systems as before, except the columns are now worth 1, 16, 16^2 (256), 16^3 (4096) and so on.

Convert Decimal to Hexadecimal

Method:

  • If the decimal number is bigger than 16, divide it by 16. Take the hexadecimal equivalent of this result - this represents the first digit. Take the hexadecimal equivalent of the remainder - this represents the second digit.
  • If the decimal number is smaller than 16, take the hexadecimal equivalent of the decimal number.


Example Question: 

Convert 138 to hexadecimal

138 รท 16 = 8 remainder 10

8 = hex 8

10 = hex A

Result is 8A


Alternatively:

Convert the decimal number into binary and then perform the steps for the binary-to-hexadecimal conversion



Convert Hexadecimal to Decimal

Method:

  1. Split the hex number into individual values.
  2. Convert each hex value into its decimal equivalent.
  3. Next, multiply each decimal digit by the value of the column
  4. Add all the results together to find the decimal number.


Example Question:

Convert AC7 to decimal

A = decimal 10

C = decimal 12

7 = decimal 7

(10 x 16^2) + (12 x 16^1) + (7 x 16^0) 

= 2560 + 192 + 7

Result is 2759



Convert Binary to Hexadecimal

Group binary digits into groups of 4, then look for the corresponding pattern

Example Questions:

Convert the binary value 00111010 to hexadecimal

0011 1010

    3     A


Convert the binary value 1001001001111111 to hexadecimal

1001  0010  0111  1111

    9       2        7       F



Convert Hexadecimal to Binary

Method:

  1. Split the hex number into individual values.
  2. Convert each hex value into its decimal equivalent.
  3. Next, convert each decimal digit into binary, making sure to write four digits for each value.
  4. Combine all four digits to make one binary number.


Example Question:

Convert the hex value FC to binary

F = decimal 15         C = decimal 12

15 = binary 1111       12 = binary 1100

Result is 11111100