Hmmm... I can get of the hex the dex, but unfortunatly I can not calculate the other way around.
Just use the Windows calculator in scientific mode.
Anyway...
Decimal to binary:1. result is an empty string of digits
2. if the value is odd, put a "1" in front of the result, otherwise a "0"
3. divide the value by 2
4. if the value is not 0, goto step 2, otherwise you're finished.
Binary to decimal:1. the result is 0
2. add the first binary digit to the value
3. cut this first digit off; if all digits have been removed then you're finished
4. multiply the result with 2
5. goto step 2
Alternatively, use the
powers of 2:
01010 =
0 * 16 +
1 * 8 +
0 * 4 +
1 * 2 +
0 * 1 = 10
Decimal to hexadecimal:Convert the value to binary, and use groups of 4 bits (starting from right) to get the hexadecimal digits.
Example: 582 =>
1001000110 =>
246(hexadecimal digits are 0123456789ABCDEF)
Hexadecimal to decimal:1. result is 0
2. get the index of the first digit of value (e.g. "F" is 15) and add it to result
3. remove this first digit; if all digits have been removed then you're finished
4. multiply result with 16
5. goto step 2
Alternatively, use the powers of 16:
A3D4 =
10 * 4096 +
3 * 256 +
13 * 16 +
4 * 1 = 41940
EDIT: One of the methods was faulty.