previous | start | next

Converting hex to decimal

This works the same way except the value of a hex digit at position k is 16k:


Again the size is 1 byte = 8 bits = 2 hex digits

hexadecimal:                         1D

For the 2 hex digits of a 1 byte unsigned integer, the multipliers for
the two positions are
                    _  _

multiplier         16  1

For the hex value 1D, 

                    1  D
                    _  _

                   16  1


the corresponding decimal value is  16 * 1 + 1 * D = = 29

(D was replaced by its decimal value, 13)



previous | start | next