ID:274889
 
Does anyone know how hex codes work. I'm talking about the numbers like FF=255. Can someone Explain this to me.
DBZ Kidd wrote:
Does anyone know how hex codes work. I'm talking about the numbers like FF=255. Can someone Explain this to me.

Certainly.
Hexadecimal is a number system just like decimal. Our decimal system has digits, 0 through 9, with each place representing a different power of 10. That is, 461 = 4×102 + 6×101 + 1×100.

Hexadecimal is similar, except the places are powers of 16, not 10. That means you need digits to represent numbers 10 through 15, so those digits are A through F. F is 15 in hexadecimal, and A is 10. So you can split up a hex number the same way.

C516 = 12×161 + 5×160 = 192 + 5 = 197

FF16 is 255 because it's 15×16+15 (240+15). The next number up would be 10016, which is 256 in decimal.

Computers don't count by 10s; they count by 2s, which is known as binary. A binary number just has 1 and 0 for its digits. Hexadecimal is basically a compact form of binary, because 16=24, which means every hexadecimal digit is exactly 4 binary digits (bits).

Lummox JR