posted 21 years ago
In order to convert decimal to any base (hex, octal, or binary), you can continually divide the number by the base. Let me give you an example by converting the number 95 to all 3 bases.
First, we'll do binary:
Now, write down the remainders in reverse order that you got them: 1011111. There you have it - 1011111 is the binary version of 95. Let's try that with hex:
Again, we write down the remainders in reverse order and we have 0x5F, which is the hexadecimal representation of 95. Finally, let's do octal:
That gives us a value of 137, which is the octal representation of 95.
I hope that helps,
Corey