Decimal to Hexadecimal Equivalent ?

Does anyone know a easy way of converting Decimal Numbers to Hexadecimal ?

I know some what of the table

0 0 0x16 0
1 1 1x16 1
10 A Ax16 A=10

The examples are 8, 57, 166 and 3,416 to Decimal Numbers

So how do I do this ? Is 57 5x16^5 + 7x16^4 = 848 ???

and the Binary value will be 1100.0000 ?

http://www.stcsc.edu/ocl/hex_to_decimal_conversion.htm

its pretty simple. I always write it out.

take 3A for example.

A is in the 16^0 place. 16^0 is 1, and A = 10, so 10x1 is 10.

3 is in the 16^1 place. 16^1 is 16, 3x16 is 48.

so, 48+10 is 58.

Complex? not at all! you do the same thing in base 10. take 42 for example.

2 is in the 10^0 place. 10^0 is 1, and 2 is 2, so 2x1 is 2.

4 is in the 10^1 place. 4 is 4, and 10^1 is 10. 4x10 is 40

40 + 2 is 42.

this method works for any arbitrary number as a base, as long as you increase the exponent as you move to the left.

so 57 will be 87 or 87^16 ? I don’t understand where you got the 10 from ?

I’m wimpy. I use the windoze calculator to do that.

It’s really easy:

you just count from the left starting at 0:
so eg 27516 becomes:

#2 #1 #0
 2  7  5

you then take 16^whatever number:

256 16  1
 2   7   5

then multiply and add:
2x256 + 7x16 + 5x1 = 512 + 112 + 5 = 629

It works the same in any base:
say 42637:

#3 #2 #1 #0
 4  2  6  3
343 49  7   1
 4   2   6   3

4x343 + 2x49 + 6x7 + 3x1 = 1372 + 98 + 42 + 3 = 1515

To go the other way, use this handy trick:
say we wanted to convert 629 into hex (we should get 275, from above)
divide 629 by 16, get 39 remainder 5
divide 39 by 16, get 2 remainder 7
divide 2 by 16, get 0 remainder 2
read remainders upwards, get 27516, which is our answer!

this also works for other bases, eg 1515 into base 7:
divide 1515 by 7, get 216 remainder 3
divide 216 by 7, get 30 remainder 6
divide 30 by 7, get 4 remainder 2
divide 4 by 7, get 0 remainder 4
read upwards, get 42637, which is our answer!

easy, once you get the hang of it!
just remember:
binary [>] base 2
octal [>] base 8
decimal [>] base 10
hex [>] base 16 (use A-F for 10-15)

Well, the base is a little clearer, is there a program that transfer files to binary txt and txt to file again ?