Let's use light bulbs to represent when a wire in the computer is carrying electrical current (the bulb is lit) and when it is not (the bulb is dark). A lit bulb means '1' and a dark bulb means '0', like this:
A computer with one bulb can represent two values, '0' and '1'. We could
choose to interpret these values as 'FALSE' and 'TRUE' as we discussed
earlier. Suppose a computer had two light bulbs to work with. What could
we do with that? What are all the possible combinations of on and off?
The table below shows them, and binary numbers that go with them.
Light Bulbs | Binary Number Represented |
|
|
|
|
|
|
|
In fact every time we add a light, we double the number of combinations. With 3 light bulbs, we get 8 combinations representing the numbers from 0 to 7.. With 4 light bulbs, 16 combinations representing the numbers 0 to 15. There is a definite pattern here, and it is important to remember it.
For any bit field of width n the following is true:
Historically, bits have been grouped together in groups of 8. An 8-bit field is called a byte. A byte can represent 256 different bit patterns, which is a number range from 0 to 255.
Now that we are working with larger bit fields, we need to learn some more terminology. Each bit in the bit field has a different significance. That is, some bits contribute more to the number being represented than others. Think about it. Which makes the biggest difference: a '1' appearing in the 2's place, or in the 8's place? The 8's place, of course! A one appearing in the 8's place adds 8 to the total number, which is more significant than adding just 2.
The rule is that bits on the left are more significant than bits on the right. We call the left-most bit the most significant bit or the high bit. We call the right-most bit the least significant bit or the low bit. If one bit is to the left of another, we say the first bit is more significant than the second, or that the second is less significant than the first.
Create a table that lists all the possible bit patterns and the equivalent decimal numbers for the following.
How many bit patterns are there, and what is the range of numbers that can be represented with the following?