name='Ham' said:
Because binary is a two base number system?
You mean "base two"
If you're interested in how it works mathematically speaking...
In the decimal system, which we are all used to each column is a power of 10. By column I mean the place a digits occupies. Each digit in a number occupies a single column. The first (right most) column has a value of 1, each digit in this column represents how many 1s are combined to give the value of the number, eg 9 is 9x1, 8 is 8x1, etc
Likewise the numbers 10, 20, 30, are made up of 2 columns, the 10s and 1s columns. The digit in the 10s column represents how many 10s are combined to give the value of the number, eg 10 is 1x10, 20 is 2x10, etc.
So a number like 58 is a combination of the 10s and 1s columns, eg 5x10 + 8x1
This pattern continues for each column, eg 100s, 1000s, 10000s, ... The actual value of the column is not randomly selected, it is determined by another pattern, taking a base number (10 for decimal) to the power of 0, 1, 2, 3, etc. eg 10 TTPO (to the power of) 0 is 1, 10 TTPO 1 is 10, 10 TTPO 2 is 100, and so on giving these values for the columns 1, 10, 100, 1000...
Note; TTPO means simply how many times a number is multiplied by itself, eg 5 TTPO 3 is 5 * 5 * 5 and equals 125.
This pattern, and the resulting values of the columns are why when you multiply a number by 10, eg 521 x 10, all you have to do is shift all the digits to the left and add a zero. What you have effectively done is raised the power of each column by one, so your 5 100s, 5 x 100 (10 TTPO 2) becomes 5 1000s, 5 x 1000 (10 TTPO 3), the power of 2 becomes a power of 3. The same is true for all the columns used in the number and because you have not added any 1s to the value the digit added in the 1s column is always 0.
Decimal is known as "base ten" because the base number used is 10, 10 gets raised to the power of 0, 1, 2, etc to give the value of each column.
Now, binary is known as "base two" because the base number used is 2. So each column is 2 TTPO 0, 1, 2, 3 or in other words the values of the columns are 1, 2, 4, 8, 16, 32 ... 256, 512, 1024, 2048, 4096, etc.
In binary, as in decimal, multiplication by the base (2) is easy, just do exactly what you do in base 10, shift everything left and add a 0. Likewise division is easy as you do the opposite, shift right (removing the rightmost digit).
Something you may have noticed is that the base and subsequent values of the columns determine the largest digit allowed in any one column. Lets use octal as an example.
Octal is base 8, meaning it has columns of 1, 8, 64, 512. Because the second column has a value of 8, you never need to use the digits 8 or 9 in the first column. To represent a number with the value 8 in octal you would write:
10
which you you and I used to base ten this looks like ten but it's not, it's 8, in octal, typically we prefix octal numbers with a zero to make it more obvious:
010
So, the base of the system determines the highest digit in each column, it's value is always 1 less than the base (think of base 10, the highest digit is 9).
So what happens when the base exceeds ten? i.e. hexdecimal. In this case we need to invent digits with values of 10, 11, thru to 15 (one less than the base) in hexdecimal we use a, b, thru to f. We also prefix hexdecimal with "0x" (zero x) eg.
0x10
So, who can tell me the value of the hex number 0x10?