previous | start | next

Converting Hex to Decimal

Converting hex to decimal requires knowing the position value of each hex digit.

The right most hex digit is again position 0:

For the 3 hex digit value 0x1AC

           Hex:      1  A  C
      Position:      2  1  0
Position Value:    256 16  1
   

The value of hex position k is 16k: (162 = 256)

The decimal value of hex 0x1AC is the sum of the positions values of the non-zero hex multipllied by the value of the hex digit at that position: 256 * 1 + 16 * 10 + 1 * 12 + 1 = 428

(0x1 = 1, 0xA = 10 , 0xC = 12)



previous | start | next