The video above from Khan Academy gives a good overview of yet another number system. This one has 16 characters! Remember, we learnt that the number system we always count in is called denary (decimal), or base-10, which means it has 10 characters (0,1,2,3,4,5,6,7,8,9,0) and then we learnt about the binary number system, or base-2. Which means it has 2 characters (0,1).
Today we learn about hexadecimal number system... 16 characters (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
But why?
We learnt in the earlier lesson that humans created the decimal (denary) system because we have ten fingers (and ten toes!). Then when humans created computers, it runs on electricity. We learnt in the last lesson that binary is base on two characters, an on or an off.
It took up too much space to keep just using on's and off's.
Remember, in the original binary video, we learnt that you need 8 whole wires just to count to 255!
We need to group things together to make things more efficient. In the beginning, we grouped them into groups of 3. This was called octal, but it wasn't quite efficient enough.
Then computers got faster and bigger very quickly. It became more convenient to group into groups of 4.
Digital Technology Glossary Alert!
Four bits (four characters!) grouped together is called a nibble.
Two nibbles is called a byte.
We are all familiar with the word byte, modern computers' speeds are measured in mega, giga and terabytes!
We have already learnt how to convert from decimal to binary. Today, we will convert from decimal to hexadecimal.
Let's do it with a worked example (it's always the easiest way!)
Let's take the decimal number 167.
Step 1: First we convert that to binary (in all the ways you've learnt already): 10100111
Step 2: Split that binary into groups of 4, or nibbles (from the right, remember, if you fill in zeroes on the left, it doesn't change the number)
1010
0111
Step 3: Then you temporarily switch it back to decimal, but pretending each nibble is a 4-bit binary number in its own right
1010 = 10
0111 = 7
Step 4: Using the following table convert to hexadecimal
So as you can see:
10 = A
7 = 7
Conclusion:
So the number 167 in decimal (base-10, denary) is 10100111 in binary (base-2) or A7 in hexadecimal (base-16)
Now you can see the efficiency.
Even in base-10 (which a computer cannot 'record') it takes 3 characters to depict 167, but in hexadecimal (base-16) it only takes 2 characters (A7)
Note
You can completely omit step 3 if you have a table that can convert straight from the binary nibble to the hexadecimal.
The reason we normally add step 3 in is because the students can use the first conversion table easier than the second one.