This is a somewhat technical subject, but it is one that will come in handy when you are working with computers, so stick with me through this article and you will understand number systems. I taught this subject to Army officers when I was on active duty many years ago, hex to decimal and I still remember it well. I was able to get it across to my students, and I can do the same for you if you will concentrate on it with me. I recommend that you work the problems to fully understand the subject.
The number system we are taught and with which we deal daily in our lives is decimal. The base of this number system is 10. We are taught early that the positional values for this number system are ones, tens, hundreds, thousands, etc. We are taught this by rote, but we are not taught the rule on how to calculate them. But that is easy. Number systems always start with the ones position. The positional value to the left of one will be one times the base of the number system or ten (1 X 10 = 10). The next positional value to the left will be that positional value times the base of the system or 100 (10 X 10 = 100). This is how the ones, extreamfirearms ten, hundreds, thousands are calculated.
Each number system has one character multiplier values in it that range from zero to one less than the base of the number system. In decimal, the multipliers are 0 – 9.
When we look at the number 123,we just accept it as the decimal value, but in number system theory, it is the sum of all multipliers times the positional value for the multiplier. Follow this example:
3 X 1 = 3 2 X 10 = 20 1 X 100 = 100
Add up the numbers to the right of the equal signs (3 + 20 + 100) and you get 123.
You have heard that computers use binary. This is because in electrical circuits there is an on or on off value (two possible values). The base for binary is two (2). Follow the rule for multipliers that they will be from 0 to one less than the base of the system so the multipliers for binary are zero and one.
Follow the rule for determining the positional values for the system. Start at one and multiply it by the base (two) so the position to the left of the one position is two (1 X 2). The next position to the left is the two position times the base (2) or 4 (2 X 2). The next position to the left is the four position times two (4 X 2) or 8. Here are the first few positional values in binary:
256 – 128 – 64 – 32 – 16 – 8 – 4 – 2 – 1
Notice that each position is doubled the value to its right. This makes sense since the base is two and we are multiplying each positional value by two to get the value of the next position to the left.
Let’s look at this binary number.
10011
To convert this to decimal, we multiply the positional value by the multiplier.
1 X 1 = 1 1 X 2 = 2 0 X 4 = 0 0 X 8 = 0 1 X 16 = 16
Now add up the values to the right of the equal sign and we get 19 decimal for the binary number 10011.
What is the decimal value of 111 binary? If you got 7 decimal then you understand how binary works.
1 X 1 = 1 1 X 2 = 2 1 X 4 = 4
1 + 2 + 4 = 7
Convert one more binary number – 1000000. If you got 64 decimal, you are right.
A weakness of binary is that it takes so many positions to express a large value. To get around this, the hexadecimal base system was devised. This is the base 16. We abbreviate hexadecimal as “hex”.
Since we said earlier that the multipliers for the system were zero to one less than the base of the system (16), how can we get one position multipliers when we only have 0 – 9 as numeric numbers? Well, infomaatic we use the first six letters of the alphabet for the multipliers above nine. Here are the multipliers in hex.