I haven\'t learned this in programming class before, but now I need to know it. What are some good resources for learning these numbers and how to convert them? I pretty much am
Converting between binary, octal, and hex is pretty easy.
binary <=> octal: three binary digits <=> one octal digit
binary <=> hex: four binary digits <=> one hex digit
octal <=> hex: four octal digits <=> three hex digits
(by way of binary, if necessary)
These are easy because the radixes for binary, octal, and hex are all powers of 2. The trick is going between decimal and the other three, because 10 (the radix for decimal) has that pesky factor of 5.
Several other answers show how to convert from binary, octal, and hex to decimal. The algorithm I was taught to go from decimal to another radix is to continually divide by the radix and read off the remainders as the answer going right to left. For instance, here's how to express 227 in hex:
n n / 16 remainder
--- ------ ---------
227 14 3
14 0 14 (=E)
so the answer is E3.