Decimals
To understand Binary and Hexadecimal numbers, it is best to know how Decimal Numbers work.
Every digit in a decimal number has a "position", and the decimal point helps us to know which position is which.
The position just to the left of the point is the "Units" position. Every position further to the left is 10 times bigger, and every position further to the right is 10 times smaller:
The Decimal Number System is also called "Base 10". Because it is based on the number 10.
And there are 10 symbols (0,1,2,3,4,5,6,7,8 and 9), but notice something interesting: there is no symbol for "ten". "10" is actually two symbols put together, a "1" and a "0":
       In decimal you count "0,1,2,3,4,5,6,7,8,9,..." but then  you  run out of symbols!
So you add 1 on the left and then start again at 0: 10,11,12, ...
      
So you add 1 on the left and then start again at 0: 10,11,12, ...
See how to count dots using Bases from 2 to 16 in this little demonstration:
128 = 27
0
64 = 26
0
32 = 25
0
16 = 24
0
8 = 23
0
4 = 22
0
2 = 21
0
1 = 20
| Try this: select a Base, watch it count for a while, then press "||" (Pause). Now see if it has tallied the right number of dots, as in this example using base 2: | |
| Example: | 1×16 + 1×8 + 1×1 = 16+8+1 = 25 | 
 Count up until just before the "Base", then start at 0 again, but first you add  1 to the number on your left.
Binary Numbers
Like this:
| 
000 | ||||||
| 
001 | ||||||
| 
010 | there is no "2" in binary, so start back at 0 ... ... and add one to the number on the left | |||||
| 
011 | ||||||
| 
100 | start back at 0 again, and add one to the number on the left... ... but that number is already at 1 so it also goes back to 0 ... ... and 1 is added to the next number on the left | |||||
| 
101 | ||||||
| 
110 | etc... | 
Hexadecimal Numbers
They look the same as the decimal numbers up to 9, but then there are the letters ("A',"B","C","D","E","F") in place of the decimal numbers 10 to 15.
So a single Hexadecimal digit can show 16 different values instead of the normal 10 like this:
| Decimal: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Hexadecimal: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | 
 
No comments:
Post a Comment