Now that you understand binary, let’s move onto hexadecimal, or base 16. This is the numbering system most programmers use, because it translates easily to and from binary. Also, 2 hexadecimal digits make up a byte, or 8 bits.
How do we have 16 digits? Simple, hexadecimal uses the digits 0-9 and the letter A-F. 0-9 is the same in hexadecimal as decimal. The digits A-F in hexadecimal are 10-15 in decimal. Here is a conversion chart of single digit hexadecimal:
Hexadecimal, sometimes simply called hex, is very easy to translate to and from binary. This is because each digit in hex is 4 digits in binary. All you have to do is replace the hexadecimal digit with the binary equivalent. For instance, the number FF16 is 111111112.
Converting a binary number to hex works just slightly different. When you convert a number from hex to binary, you can work from left to right or right to left. When you convert a number from binary to hex, you must work from right to left. This is because a binary number might not be the correct length to work from left to right.
That’s all for today, check back Friday for Octal, or base 8. Here’s some homework:
Convert the following hexadecimal numbers to binary and decimal: