answersLogoWhite

0


Best Answer

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).

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to convert base 16 to base 10?
Write your answer...
Submit
Still have questions?
magnify glass
imp