CompTIA A_ Certification All-In-One Exam Guide, Seventh Edition - Michael Meyers [63]
Figure 5-5 Here “1” means on, “0” means off.
In the world of computers, we constantly turn wires on and off. As a result, we can use this “1 and 0” or binary system to describe the state of these wires at any given moment. (See, and you just thought computer geeks spoke in binary to confuse normal people. Ha!) There’s much more to binary numbering in the world of computing, but this is a great place to start. We will revisit the binary numbering system in greater detail in Chapter 8, “Expansion Bus.”
Registers
The Man in the Box provides good insight into the workspace inside a CPU. The EDB gives you a way to communicate with the Man in the Box so you can give him work to do. But to do this work, he needs a worktable; in fact, he needs at least four worktables. Each of these four worktables has 16 light bulbs. These light bulbs are not in pairs; they’re just 16 light bulbs lined up straight across the table. Each light bulb is controlled by a single switch, operated only by the Man in the Box. By creating on/off patterns like the ones on the EDB, the Man in the Box can use these four sets of light bulbs to work math problems. In a real computer, these worktables are called registers (Figure 5-6).
Figure 5-6 The four general-purpose registers
Registers provide the Man in the Box with a workplace for the problems you give him. All CPUs contain a large number of registers, but for the moment let’s concentrate on the four most common ones: the general-purpose registers. Intel named them AX, BX, CX, and DX.
Great! We’re just about ready to put the Man in the Box to work, but before you close the lid on the box, you must give the Man one more tool. Remember the codebook we mentioned earlier? Let’s make one to enable us to communicate with him. Figure 5-7 shows the codebook we’ll use. We’ll give one copy to him and make a second for us.
In this codebook, for example, 10000111 means Move the number 7 into the AX register. These commands are called the microprocessor’s machine language. The commands listed in the figure are not actual commands; as you’ve probably guessed, I’ve simplified dramatically. The Intel 8088 CPU, invented in the late 1970s, actually used commands very similar to these, plus a few hundred others.
Here are some examples of real machine language for the Intel 8088:
By placing machine language commands—called lines of code—onto the external data bus one at a time, you can instruct the Man in the Box to do specific tasks. All of the machine language commands that the CPU understands make up the CPU’s instruction set.
Figure 5-7 CPU codebook
So here is the CPU so far: the Man in the Box can communicate with the outside world via the external data bus; he has four registers he can use to work on the problems you give him; and he has a codebook—the instruction set—so he can understand the different patterns (machine language commands) on the external data bus (Figure 5-8).
Figure 5-8 The CPU so far
Clock
Okay, so you’re ready to put the Man in the Box to work. You can send the first command by lighting up wires on the EDB. How does he know when you’ve finished setting up the wires and it’s time to act?
Have you ever seen one of those old-time manual calculators with the big crank on one side? To add two numbers, you pressed a number key, the + key, and another number key, but then to make the calculator do the calculation and give you the answer, you had to pull down the crank. That was the signal that you had finished entering data and instructions and were ready for the calculator to give you an answer.
Well, a CPU also has a type of crank. To return to the Man in the Box, imagine there’s a bell inside the box activated by a button on the outside of the box. Each time you press the button to sound