posted 22 years ago
For Decimal to Hex, just divide successively by 16, keeping the whole number result but noting the remainder of each division as you go, until you get a 0 result.

Take decimal 11948

11948 / 16 = 746 rem. 12

746 / 16 = 46 rem. 10

46 / 16 = 2 rem 14

2 / 16 = 0 rem 2

Then, go backwards through your list of remainders and convert each to hex. For this example, you will get 2EAC, which is the Hex representation of Decimal 11948

Same process when you convert Decimal to Octal, only your divisor will be 8.

For Hex to Decimal:

2EAC = (2 * 16^3) + (14 * 16^2) + (10 * 16^1) + (12 * 16^0) = 11948

When converting from Octal, use powers of 8.

[This message has been edited by JUNILU LACAR (edited June 21, 2001).]