Hexadecimal number representation

Representation of  a number in the hexadecimal number system involves the same sequence of steps that we have used in representation of numbers in decimal, binary and hexadecimal number system, the main difference here is the weights used in hexadecimal number system are powers of 8 and the values that are assigned to these positional hexadecimal weights range from 0 to F. In this system it is not permitted to use the digits beyond 9 and alphabets beyond F.

nNote: In hexadecimal number system 10 is not equal to ten but its equal to 16 in decimal.

Let us take a simple example 8226 in decimal number system and ( 2022 ) its equivalent number in the hexadecimal number system, we will not worry much about how we obtained hexadecimal equivalent of the decimal number at this point.


Step 1: ( 2 0 2 2 )16
Here subscript 16 indicates the number is in hexadecimal number system

We also represent numbers in the hexadecimal number system as ( 2 0 2 2 )H
Here H means hexadecimal number system.

We will now write down the weights in the form of table without assigning the values as shown below


  163     162      161      16 0                 ← Weights in hexadecimal number system
                                  
    ↑                             ↑
MSD                          LSD


Step 2 : The values for the hexadecimal weights are assigned beginning from LSD to MSD, the right most digit in the given example is LSD and the left most digit is MSD as done below :


   163      162      161      16 0                 ← Weights in hexadecimal number system
   2      0       2      2    
    ↑                             ↑
MSD                          LSD

Step 3: Determine the weight-value product by multiplying the values and the corresponding weights according to the position as shown below 

Beginning from LSD to MSD

2 x 16 0    LSD             ← (1)
2 x 16 1                                  ← (2)
0 x 16 2                                  ← (3)
2 x 16 3   ← MSD             ← (4)



Step 4: Sum the individual products (1), (2), (3), (4) from step 3 as illustrated below

       2 x 16 + 0 x 16 + 2 x 16 + 2 x 16 0

 =    2 x 16 + 0 x 16 + 2 x 16 + 2 x 16 0
        ↑                                          ↑
      MSD                                    LSD

=    2 x 4096 + 0 x 256 + 2 x 16 + 2 x 1


=    8192 + 0 + 32 + 2


=    ( 8226 )16 


comments powered by Disqus