How to turn hexadecimal into decimal using brain?

If you consider that hexadecimal is base 16, its actually quite easy:

Start from the least significant digit and work towards the most significant (right to left) and multiply the digit with increasing powers of 16, then sum the result.

For example:

0x12 = 2 + (1 * 16) = 18

0x99 = 9 + (9 * 16) = 153

Then, remember that A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15

So,

0xFB = 11 + (15 * 16) = 251


That's not the formula.. that's not even somewhat like the formula...

The formula is:

X*16^y where X is the number you want to convert and y is the position for the number (from right to left).

So.. if you want to convert DA145 to decimal would be..

(5 * 16^0) + (4 * 16^1) + (1 * 16^2) + (10 * 16^3) + (13 * 16^4)

And you have to remember that the letter are:
A - 10
B - 11
C - 12
D - 13
E - 14
F - 15

Tags:

Hex