one will do it. This is a just a simple, two item code. On means 1, and off means 0.
As a comment here, there seems to be a trend among the appliance manufacturers of the world to replace the obsolete and old-fashioned terms of on and off with the modern 0 and 1. On many power switches they put a 0 by the off position, and a 1 by the on position. The first place I saw this was on a personal computer, and I thought that it was a cute novelty, being on a computer, but now this practice has spread to cell phones, coffee makers and automobile dashboards. But I think that this is a mistake. Do you understand that the code could just as easily have been defined as “off means 1 and on means 0?” The computer would work exactly the same way, only the printing in the technical manuals that describe what is happening inside the computer would change.
When you see one of these 0/1 switches, you have to translate it back from this very commonly used computer code into what it really means, on or off. So why bother? You don’t want to turn your coffee machine ‘1’, you want the power ON so you can get your java and wake up already. Imagine putting these symbols on a waffle maker back in 1935. Nobody would have had any idea of what it meant. It is probably just so that manufacturers don’t have to have switches printed in different languages. Or maybe this trend comes from an altruistic desire to educate the public into the modern ‘fact’ that a 1 is the same as on, but it isn’t a fact, it’s an arbitrary code.
Eight Is Enough
In order to be able to represent something more than simple yes/no matters, what we are going to do is to stack up eight bits in a single package, and use them as a single unit. Here is a diagram of how it is done. We have taken eight of our memory bits, each one still has its own data input ‘i’ and its own output ‘o,’ but we have wired all eight of the set inputs ‘s’ together. Thus when the single ‘s’ gets turned on and then off again, all eight of these ‘M’s will capture the states of their corresponding ‘i’s at the same time. The picture on the left shows all eight ‘M’s, the one on the right is the same thing, just a little simpler.
This assembly has a name; it is called a byte, thus the “B” in the diagram. There are several conflicting explanations of exactly where this word came from, but since it sounds just like the word “bite,” you can just think of it as a whole mouthful compared with a smaller unit, a bit. Just to show you that computer designers do have a sense of humor, when they use four bits as a unit, they call it a nibble. So you can eat a tiny bit of cherry pie, or have a nibble or take a whole byte.
When we had a bit, we would just say that its state was either 0 or 1. Now that we have a byte, we will write the contents of the byte like this: 0000 0000, and you can see why we switched from using off/on to 0/1. That shows the contents of each of the eight bits, in this case they are all zeros. The space in the middle is just there to make it a little easier to read. The left hand 0 or 1 would correspond to the top bit in our byte, and the rightmost 0 or 1 would represent the bottom bit.
As you had better know by now, a bit has two possible states that it can be in — on or off. If you have two bits, there are four possible states that those two bits can be in. Do you remember the chart we drew for the inputs of the NAND gate? There were four lines on the chart, one for each possible combination of the two input bits to the gate, 0-0, 0-1, 1-0 and 1-1.
Notice that the order of the bits does matter – that is, if you look at two bits and only ask how many bits are on, there are only three possibilities: no bits on, one bit on or two bits on. That would be calling the 1-0 and 0-1 combinations the same thing. For the purpose of using multiple bits to implement a code, we definitely care about the order of the bits in a byte. When there are