Thursday, February 17, 2011

Of bits

People have heard the terms "bits" and "bytes." Many people even know that computers have 8 bits to a byte. But what is a bit, and why do bytes have 8 of them? "A bit stores either 0 or 1!" That's a pretty good answer, but I think that doesn't tell the whole story.

We'll consider later how bits are stored in a computer and how computers use them, but for now let's just talk about the mathiness of bits. A bit is a "thing" that can be in either of two states. It doesn't really matter what the "thing" that a bit takes the physical form of, and it doesn't matter what the two states are. For example, and bit could be an electrical switch, and when it is turned in one position that means "1", and when it's turned in the other position that means "0." That's probably an example you were expecting if you already knew about bits, but that's just one of many possibilities. How about a glass of water that when it's full it represents "elephant," and when it's empty it represents "pocket knife?" That's another example of a bit (assuming that the glass can only either be full or empty, of course).

The point is that a bit is a "thing with two options." It can either be one way or it can be the other way, but it must be one of those two ways. It cannot be both at the same time, and it cannot be neither. A bit only has the meaning a person gives it. In computers, a bit is most often used in one of a few ways. It can denote a single digit in the binary number system (0 or 1), it can represent "true" or "false" in logic formulas. Also, if the computer is connected to any physical switches, the way a switch is flipped will be represented in the computer as a single bit. In all of those cases, it's up to the human in charge of the computer to decide what the two states of a bit really mean, or in other words, how they're going to use the information they gain by examining the state of the bit, and what it would mean to change that state.

Next time we'll look at how sets of multiple bits can work together to represent a greater variety of things than a single bit can by itself.

No comments:

Post a Comment