Originally Posted by
Matticus
The least significant bit (the right most, bit zero) has a "weight" of 20.
The next one, going left (bit one) has a "weight" of 21.
The next one, going left (bit two) has a "weight" of 22.
This continues on.
If there is a "one" in a position, you add the corresponding "weight" to the total. If a "zero", you don't.
So, for instance, let's look at 1001.
That would be: 23 + 22 + 21 + 20
Since the middle two are zeros, we can ignore them.
23 + 0 + 0 + 20
23 = 8
20 = 1
So 1001 is equal to 8 + 1 = 9.