top of page

Hexa Decimal System

What is it?

  • At the very beginning of the computer development, there were many problems when working with binary numbers. 

  • For this reason, a new numeric system, using 16 different symbols was established and called a hexadecimal numeric system.

  • It is comprised of ten digits we are used to (0, 1, 2, 3,... 9) and six letters of alphabet A, B, C, D, E, and F.

  • In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0 and place an "h" at the end of the number to denote the number base.

Base = 16 or 'H' or 'Hex'

It uses 16 letters   { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}

Example : AB12, 876F, FFFF, 83F6h 

1    0   0   1    0   1   0   1   1    0    0   1   1    1   1   0

Binary

9

9

5

E

( 959E )

16

Conversation

  • Here are the 4-bit binary nos. with decimal and a binary value.

Converting Decimal to Hex :

  • Divide the decimal number by 16. Treat the division as an integer division.

  • Write down the remainder (in hexadecimal).

  • Divide the result again by 16. Treat the division as an integer division.

  • Repeat step 2 and 3 until the result is 0.

  • The hex value is the digit sequence of the remainders from the last to first.

10

16

(213)  = ( ? )

Divide-by-16

Quotient

Remainder

Hex digit

213 / 16

13 / 16

​

13

0

5

13

Lower digit = 5

Second digit = D

(213)  = (D5)

16

10

Decimal

Hexadecimal

Converting Hexadecimal to Decimal :

  • To convert from Hex to Decimal, multiply the value in each position by its hex weight and add each value. 

(FACE)  = (  ?  )

10

16

Hexadecimal

Decimal

F     A     C     E

( F * 16  )

( A * 16  )

( E * 16  )

( C * 16  )

3

2

0

1

+

+

+

61440   +       2560   +      192    +      14

= 64206

(64206)

10

Binary

( 15 * 4096 ) + ( 10 * 256 ) + ( 12 * 16 ) + ( 14 * 1 )

Converting Hexadecimal to Binary :

  • Each hexadecimal digit can be directly converted to its four-bit binary equivalent, using this table if necessary.

(FACE)  = (  ?  )

2

16

Hexadecimal

Binary

F     A     C     E

1010

1100

1110

1111

(1111101011001110)

2

Binary

Application

  • Often used in computing as a compacter representation of binary (1 hex digit per 4 bits).

  • Easier for a human to read hexadecimal rather than binary.

  • . I.e. in HTML programming colors can be represented by a 6-digit hexadecimal number: FFFFFF represents white, 000000 represents black, and so on.

bottom of page