Every digit is between 0 and 9 as in 01234567890 (10 different choices)

how to get the value from decimal number?

23465

5*1

6*10

4*10*10

3*10*10*10

etc

Hex:

Every "digit" is between 0 and F as in 01234567890ABCDEF (16 choices)

the value from hex number:

F3A5

5*1

A(10)*16

3*16*16

F(15)*16*16*16

etc

Binary:

every digit is between 0 and 1 as in 01 (2 digits)

value from binary number:

011001

1*1

0*2

0*2*2

1*2*2*2

1*2*2*2*2

etc

thus generalized:

digit(position)*base^posit

where positon starts with 0 at rightmost place

base is 10 for decimal, 16 for hex, 2 for binary, can be anything

See here for automatic conversion, playing -> understanding:

http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html