Each place value column in hexadecimal (base 16) is 16 times the column to the right;
Also, letters a-f are used to represent decimal numbers 10-15 which can be placed in a single place value column.
To convert base 16 to base 10: add up the place value digits multiplied by their place value columns.
Example convert 0x2a5 to decimal:
0x2a5 = 2 × 16² + 10 × 16 + 5 = 512 + 160 + 5 = 677
If you want an algorithm to convert any whole number from hexadecimal to decimal:
1) set the result to zero
2) start by considering the left most digit of the hexadecimal number
3) multiply the result by 16 and add the digit of the hexadecimal number under consideration
4) move to the next digit of the hexadecimal number
5) if not run out of digits go back to step 3
6) result is the number in decimal.
eg to convert 0x2a5:
1) result = 0
2) starting with the 2
3) 0 × 16 + 2 = 2 → result
4) next digit is 'a' (which is 10)
5) have a digit, repeat from step 3
3) 2 × 16 + 10 = 32 + 10 = 42 → result
4) next digit is 5
5 have a digit, repeat from step 3
3) 42 × 16 + 5 = 672 + 5 = 677 → result
4) no next digit
5) not got a digit, so continue onto step 6
6) 0x2a5 in decimal is 677 (the value of result).
Chat with our AI personalities
Assuming the original number is written in base 10, there is no need to convert this to base 10 as it is already there. The hexadecimal number represented as 601 in base 16 is represented in decimal as 1537.
26
16 and 3/10 = 16.3
Convert the base 10 numeral to a numeral in the base indicated. 503 to base 5
The binary representation of 16 is "10000" in base two.