Sales Toll Free No: 1-855-666-7446

Top
 Sub Topics Hexadecimal system of numbers is widely used along with binary and octal numbers in computer science. Hexadecimals include the 10 digits 0 to 9, the letters A, B, C, D, E and F to represent the numbers from 10 to 15. In computer coding, two hexadecimal representation ranging from 00 to FF can efficiently replace a byte consisting of 8 binary bits. Hexadecimal coding is also considered to be relatively human friendly, when compared to long strings of binary coding.

Hexadecimal numbers are base 16 numbers whose digits are the remainders given by 16 division. The digits used in hexadecimal system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The letters A, B, C, D, E and F are representative digits correspondingly for the numbers 10, 11, 12, 13, 14 and 15. The places values in hexadecimal system are powers of 16 and the fractions are separated by a dot with negative powers of 16 as place values.

The place value chart for Hexadecimal system of numbers is given below:

The place value of each position in hexadecimal system is 16 times the place value of the immediate position to its right.

Let us look into how the decimal numbers are represented in Hexadecimal system. Each digit of the number is multiplied by its place value and the products are added to get the number in decimal system. For letters A, B, C, D, E and F, the corresponding numbers are used for multiplication.

The correspondence between the digits and the face value are as follows:
5 F 2 3 A
164 163 162 161 160.
Thus, 5F23A = 5 x 164 + 15 x 163 + 2 x 162 + 3 x 161 + 10 x 1 = 327,680 + 61,440 + 512 + 48 + 10
5F23A16 = 389,69010.
The hexadecimal system provides more compact representation for larger numbers than the decimal system.

## How to Convert Hexadecimal to Decimal?

The decimal form of a hexadecimal representation is the sum of the products of its digits and their corresponding place values. Let us look at the example.

Let us write B13F16 into its Decimal form.
Each digit is multiplied by its place value and the products are added to get the decimal equivalent of the number.
B13F16 = B x 163 + 1 x 162 + 3 x 161 + F x 160
= 11 x 4096 + 256 + 48 + 15
= 45,37510

## How to Convert Decimal to Hexadecimal?

The method applied to convert a decimal to hexadecimal is similar to that which is followed to convert a binary number to a decimal. Divide the number and the successive quotients by 16. Arrange the remainders got in reverse order to get the hexadecimal number.

Let us find the hexadecimal equivalent for 187510.

The remainders in each step of division are 3, 5 and 3, reversing the order of which, we get the hexadecimal representation as 753.
187510 = 75316

While adding hexadecimal numbers, the sums exceeding 16 are carried over as 1.

Let us add A6B16 and 34C16

      1     <-- Carried over digit
A 6 B
+ 3 4 C
---------
D B 7
---------

As B and C correspond to 11 and 12, we essentially add 11 + 12 = 23 for adding B + C. 16 is subtracted from 23 and carried over as 1 to the next place and the difference 7 is written below.

Similar borrowing rules are applied in subtraction. 16 is borrowed from left, if the digit subtracted is greater.

Let us subtract 4A316 from 2B516
  16 16   <-- Borrowed numbers
34 9A 3
- 2 B 5
---------
1 E E
---------


As 5 is greater than 3, to perform subtraction, 16 is borrowed from left. 16 + 3 - 5 = 14 which is written as E. After the borrow, digit 9 is left in the place of A. So, to subtract B, 16 is again borrowed from the the left. 16 + 9 - B = 25 - 11 = 14 which is again E. As 1 is used for borrow, 3 is left in the place of 4. 3 - 2 = 1.

Multiplication is carried out digit wise and the products are added as done with decimal numbers.

Let us multiply A216 and 1B16.

First, each digit in A2 is multiplied by B. 2 x B = 2 x 11 = 22, which is 16 in hexadecimal form. The digit 1 is carried over and added to the product A x B = 110 + 1 = 111, which is written as 6F. Addition rules are followed as explained earlier.