Click here to purchase the entire book in PDF format.
|
|
So, the binary number 10011 represents the same quantity as the decimal number 19. Remember, all we've done is to change the method by which we're writing down the same thing. ``19'' in base 10 and ``10011'' in base 2 both mean ``nineteen.''
This would be a good time to point out that if we add an extra digit to our binary number, we increase the number of quantities we can represent by a factor of two. For example: if we have a three-digit binary number, we can represent a total of eight different numbers (000 - 111 or zero to seven). If we add an extra digit and make it a four-digit number we can represent sixteen different quantities (0000 - 1111 or zero to fifteen).
There are a lot of reasons why this system is good. For example, let's say that you had to send a number to a friend using only a flashlight to communicate. One smart way to do this would be to flash the light on and off with a short ``on'' corresponding to a ``0'' and a long ``on'' corresponding to a ``1'' - so the number nineteen would be ``long - short - short - long - long.'' Some less-than-smart ways would be to bang your flashlight on a table nineteen times - or you could write the number ``19'' on the flashlight and throw it at your friend...
In the world of digital audio we typically use slightly different names for things in the binary world. For starters, we call the binary digits bits (get it? binary digits). Also, we don't call a binary number a ``number'' - we call it a binary word. Therefore ``1011010100101011'' is a sixteen-bit binary word.
Just like in the decimal system, there are a couple of quick math tasks that can be accomplished by shifting the bits (programmers call this bit shifting but be careful when you're saying this out loud to use it in context, thereby avoiding people getting confused and thinking that you're talking about dogs...)
If we take a binary word and bit shift it one place to the left (i.e. 111 becoming 1110) we are multiplying by two (in the previous example, 111 is seven, 1110 is fourteen).
Similarly, if we bit shift to the right, removing the right-most bit, we are dividing by two quickly, but frequently inaccurately. (i.e. 111 is seven, 11 is 3 - nearly half of seven) Note that, if it's an even number (therefore ending in a ``0'') a bit shift to the right will be a perfect division by zero (i.e. 1110 is fourteen, 111 is seven - half of fourteen). So if we bit shift for division, half of the time we'll get the correct answer and the other half of the time we'll wind up ignoring a remainder of a half.