Note: This site will be taken down July 1, 2024.
Human beings have generally settled on ten as the number to count with. No doubt it has something to do with the number of counting tools available (fingers, that is!).
There is nothing magic about ten, however, that makes it the best choice (except for those who count with those handy, dandy fingers). Some cultures have indeed used other numbers to count with. Babylon apparently used sixty, a sexagesimal numbering system, which has some calculating advantages since it divides evenly by two, three, four, five, six, ten, twelve, fifteen, twenty, and thirty.
The simplest way of writing numbers is to make one mark for each thing counted. Note that our usual way of marking four vertical strokes and then a crossing stroke forms groups of five. Hmm. Five fingers on one hand. Any connection, do you think??
Once the number of cattle you own exceeds the number of fingers you have, it becomes clear that you need a short way of writing large numbers. Our modern system uses the position of a number symbol to indicate its real value. So our cattle ranchers don't have to scratch out several feet of little marks to write down the number of cows they have.
Instead they write numbers like 4567. What that really means is 4 thousands plus 5 hundreds plus 6 tens plus 7 ones. So far so good. How does that relate to using other bases? Look at how this works.
Base 10 | ||
---|---|---|
a thousand = | 10 x 10 x 10= | 10^{3} |
a hundred = | 10 x 10= | 10^{2} |
ten = | 10= | 10^{1} |
one = | 1= | 10^{0} |
This way of writing 10 x 10 x 10 as 10^{3} names 3 as the power of 10. So we could write our number as powers of 10 this way:
(4 x 10^{3})+ (5 x 10^{2})+ (6 x 10^{1})+ (7 x 10^{0 })
Each digit is multiplied by a power of 10 to get the complete number.
We can use this same kind of notation with any base. We just need to know what the base is and what the symbols are for the numbers smaller than the base.
Computers don't have ten fingers to count with. All they have is on and off. Everything inside a computer must be represented with some combination of on and off. We humans use the digits 1 for on and 0 for off. We call this base 2 since there are only 2 symbols used.
A sequence of on off off on off on on off on is written for the benefit of humans as 100101101. This is only a little bit better but it takes less energy to write down. Such base 2 numbers are called binary numbers.
Now the number 100101101 in base 2 uses the same symbols as 100,101,101 in base ten. But the base 10 number is equal to one hundred million one hundred and one thousand one hundred and one. This is a much larger number than the base 2 number.
The 1s and 0s must be multiplied by powers of 2 to see how many cows this number represents.
100101101 in base 2 |
= in base 10 | |
---|---|---|
1 x 2^{8 }= | 1 x 256 | 256 |
0 x 2^{7} = | 0 x 128 | 0 |
0 x 2^{6} = | 0 x 64 | 0 |
1 x 2^{5} = | 1 x 32 | 32 |
0 x 2^{4} = | 0 x 16 | 0 |
1 x 2^{3} = | 1 x 8 | 8 |
1 x 2^{2} = | 1 x 4 | 4 |
0 x 2^{1} = | 0 x 2 | 0 |
1 x 2^{0} = | 1 x 1 | 1 |
Total = | 301 in base 10 |
The rules for adding base 2 numbers are simple.
0 + 0 = 0
0 + 1 = 1
1 + 1 = 10
1 + 1 + 1= 11
For example, adding the two numbers below:
(don't forget to carry a one over if the column is 1 + 1 = 10)
10101101
+ 1011110
100001011
Because people have a really hard time keeping straight numbers like those above, computer numbers are often written in yet another base - base 16. Such numbers are called hexadecimal. Hexadecimal numbers look really odd because they have more symbols than we are used to. Letters are used for the numbers from ten through fifteen: A = 10; B = 11; C = 12; D = 13; E = 14; F = 15. They can be either upper case or lower case.
The numbers we added above if written as base 16 numbers look like:
3F2
+ B37
F29
To interpret such numbers as base 10 numbers, ( for those of us who just can't quit counting on our fingers!) you need to know the powers of 16.
16^{3} = 4096
16^{2} = 256
16^{1} = 16
16^{0} = 1
So the number F29 in base 16 is equal to:
(F x 16^{2})+ (2 x 16^{1})+ (9 x 16^{0} ) =
15 x 256 = 3840
2 x 16 = 32
9 x 1 =
9
3881 in base 10
This is certainly not all that easy to do. Few people can multiply 15 by powers of 16 easily. But the really advantage for base 16 is in how easy it is to change from base 2 to base 16 and back.
Every hexadecimal digit is broken down into a 4 digit binary number. These digits are just written down in the same order as the hexadecimal number and you've got the equivalent binary (base 2) number.
For our number F29 :
F is equal to 15 which is 8 + 4 + 2 + 1. (These are
the powers of 2).
That means that F = (1 x 2^{3}) + (1 x 2^{2}) + (1 x 2^{1}) + (1 x 2^{0}).
(We'll use little numbers at the bottom, called subscripts, to show what base the number is using)
So F_{16 = }1111_{2}
Since 2_{16} is (1 x 2^{1}), then 2_{16} = 0010_{2}
Since 9_{16} is (1 x 2^{3} ) + (1 x 2^{0}), then 9_{16} = 1001_{2}
Putting this together makes F29_{16} = 111100101001_{2.}
Once you learned how to write the numbers 0 to 15 in base 2, you could whip back and forth between base 2 and base 16 rapidly. Some folks who work with computers have to do just that.
Thank goodness most of us don't have to do this all the time! One number system is enough to deal with!! But now you know a little about the numbers computers think with and how people write them down.
(Use your Back button to return to the page that sent you here or use the menu or crumbs to pick another page to view.)