A more general description of the procedure is to multiply the position weights by the values at the positions, then add them up. A common way of representing numbers in a C program is to use hexadecimal notation , or HEX . It uses a base of 16. Each group is called a nibble . Thus, we are dealing with the 16 values from 0 through 15, and a base of 16.
Hexadecimal notation is simple.
Just use digits for 0 through 9, and A through F for 10 through 15. The following table shows all of the combinations. The right nibble of a byte is the least significant nibble. To get the decimal value, take the value of the nibbles, multiply by the position weight values and add them up. To show a number is hexadecimal in the C language, prefix it with 0x .