# Hexadecimal Numbers and Hexadecimal Numbering System

**Hexadecimal Numbers**

In the Hexadecimal number often shortened “hex”, is a number system which is made up of 16 symbols it means the base of this number system is 16.

The standard number system is called decimal number system; it uses 10 symbols for representation and the 10 symbols are 0,1,2,3,4,5,6,7,8,9. That means in decimal number system the base is 10. Using this number system we can’t represent values greater than 9. In hexadecimal number system letters taken from English alphabet, specifically A, B, C, D, E and F. Hexadecimal “A” represent the decimal number 10, and hexadecimal “ F” is equal to the decimal number 15.

Humans mostly use decimal number probably because of having ten fingers on their hand. But computer however have only on and off, called a binary digit. A binary number is just combination of 0s and 1s.

**Hexadecimal value**

Hexadecimal number is mostly similar to the octal number system. This number system uses four-bit binary coding. It means each digit in hexadecimal number is the same as four digit binary number.

In the decimal number system, the first digit is the *one’s* place, the next digit to the left of first digit is the *ten’s* place, the next is the *hundred’s* place, etc. But in hexadecimal number system, each digit can be 16 values, not 10. So we can say the digits have the *one’s* place, the *sixteen’s* place, and the next one is the *256’s* place. So 1hexadecimal = 1 decimal, 10hexadecimal = 16 decimal, and 100hexadecimal = 256 in decimal.

Hex | Binary | Octal | Decimal |

0 | 0 | 0 | 0 |

1 | 1 | 1 | 1 |

2 | 10 | 2 | 2 |

3 | 11 | 3 | 3 |

4 | 100 | 4 | 4 |

5 | 101 | 5 | 5 |

6 | 110 | 6 | 6 |

7 | 111 | 7 | 7 |

8 | 1000 | 10 | 8 |

9 | 1001 | 11 | 9 |

A | 1010 | 12 | 10 |

B | 1011 | 13 | 11 |

C | 1100 | 14 | 12 |

D | 1101 | 15 | 13 |

E | 1110 | 16 | 14 |

F | 1111 | 17 | 15 |

10 | 1 0000 | 20 | 16 |

11 | 1 0001 | 21 | 17 |

24 | 10 0100 | 44 | 36 |

5E | 101 1110 | 136 | 94 |

100 | 1 0000 0000 | 400 | 256 |

3E8 | 11 1110 1000 | 1750 | 1000 |

1000 | 1 0000 0000 0000 | 10000 | 4096 |

FACE | 1111 1010 1100 1110 | 175316 | 64206 |

**Hexadecimal to decimal conversion**

There are two common ways to convert a number from hexadecimal numbers to decimal, there are two common ways.

The first approach is more ordinarily done when it is manually conversion:

- At first have to use the decimal value for each hexadecimal digit. It is the same for the number 0 to 9, but the values of A, B, C, D, E, F are 10, 11, 12, 13, 14, 15 respectively.
- Keep a sum of the products changed at each step below.
- Start with the least significant hexadecimal digit, digit on the right end. In a sum this will be the first item. This item will be the first item in a sum.
- Take the second-least significant digit, next to the digit on the right end. Multiply the decimal number digit by 16. Add the number to the sum.
- Do the same for the third-least vital digit, but multiply it by 16
^{2}(that is, 16 squared, or 256). Add it to the sum. - Continue for each digit, adding each place by another power of 16. (4096, 65536, etc.)

Location | ||||||

5 | 4 | 3 | 2 | 1 | ||

Value | 65536 (16^{4}) |
4096 (16^{3}) |
256 (16^{2}) |
16(16^{1}) |
1 (16^{0}) |

In the time converting a number in software the next method is more commonly done. It does not require to know how many numbers has before when it starts, and it never multiplies by more than 16, but it looks longer on paper.

- At first have to use the decimal value for each hexadecimal digit. It is the same for the number 0 to 9, but the values of A, B, C, D, E,F are 10, 11, 12, 13, 14, 15 respectively
- Keep a sum of the numbers changed at each step below.
- Start among the various important digit (the digit on the far left). This is the first item in the sum.
- If there is another digit, multiply the sum by 16 and then add the decimal value of the next digit.
- Repeat the high step until there are no more digits.

**Example:** 5F hexadecimal to decimal, method 1

(5F)_{16 }= (5 x 16) + (15 x 1)

= 80 + 15

= (95)_{10}

**Example:** 5F hexadecimal to decimal, method 2

Sum= (5 x 16) + 15

= 80 + 15

= (95)_{10}

**Binary to Hexadecimal conversion **

There are some steps for converting one binary number system to hexadecimal number system:-

- At first we have to underline each pair of the digits from right side to left. If any bit is left in the left side of the digit this will be the last set of pair.
- After that convert the each 4 digit set in to equivalent hexadecimal number.
- Then rewrite the digit which we get after the conversion.

**Example: **Convert (1010010100)_{2 }to equivalent hexadecimal number.

0010 1000 0100

2 8 4

Ans. (284)_{16}

**Advantages and Disadvantages**

The major advantage of using Hexadecimal numbers is that we can store more numbers using less memory. Hexadecimal number system is also used to representing the Computer memory addresses. In hexadecimal form inputs and outputs are easier to handle. In data science field, artificial intelligence and machine learning the advantage is wide.

The major disadvantage is that it is not easy to read and write for people, and it is difficult to perform operations like multiplications, divisions using this number system.

## Leave a Reply