In the decimal numbering system, we think of the number 255 as being the sum of 200 + 50 + 5. While it is tempting to think of 255 being comprised of two times 100 plus 5 times 10 plus five times 1, this somewhat misleading. Each successive place holder increases by the base of the numbering system. Therefore, it is more accurate to think of the number 255 as being comprised of two times ten to the second power plus 5 times ten to the first power plus 5 times ten to the zero power.
Following the same logic, the number 0x123 (the 0x signifies that the number is in hexadecimal notation) evaluates to one times 16 to the second power plus 2 times 16 to the first power plus three times 16 to the zero power (a number raised to the zero power is equal to one). Therefore, the number 0x123, in decimal, is equal to (1 * 256) + (2 * 16) + (3 * 1), or 291.
The process of converting from hexadecimal to decimal, then, is comprised of three steps: separating the two hex numbers, converting from the alphabetical representations of the numbers 10-16 into their decimal equivalents and then multiplying the first digit by 16 to the first power, and then adding that to the result of multiplying the second digit with 16 to the zero power.