increase our computing model’s level of complexity, we’ll see this structure repeated at every level.
The Stored-Program Computer
All computers consist of at least three fundamental types of structures
needed to carry out the read-modify-write sequence:
Storage
To say that a computer “reads” and “writes” numbers implies that
there is at least one number-holding structure that it reads from and
4
Chapter 1
writes to. All computers have a place to put numbers—a storage
area that can be read from and written to.
Arithmetic logic unit (ALU)
Similarly, to say that a computer “modifies” numbers implies that the
computer contains a device for performing operations on numbers. This
device is the ALU, and it’s the part of the computer that performs arith-
metic operations (addition, subtraction, and so on), on numbers from
the storage area. First, numbers are read from storage into the ALU’s
data input port. Once inside the ALU, they’re modified by means of an
arithmetic calculation, and then they’re written back to storage via the
ALU’s output port.
The ALU is actually the green, three-port device at the center of
Figure 1-1. Note that ALUs aren’t normally understood as having a code
input port along with their data input port and results output port. They
do, of course, have command input lines that let the computer specify
which operation the ALU is to carry out on the data arriving at its data
input port, so while the depiction of a code input port on the ALU in
Figure 1-1 is unique, it is not misleading.
Bus
In order to move numbers between the ALU and storage, some means of
transmitting numbers is required. Thus, the ALU reads from and writes
to the data storage area by means of the data bus , which is a network of transmission lines for shuttling numbers around inside the computer.
Instructions travel into the ALU via the instruction bus , but we won’t cover how instructions arrive at the ALU until Chapter 2. For now, the data bus
is the only bus that concerns us.
The code stream in Figure 1-1 flows into the ALU in the form of a
sequence of arithmetic instructions (add, subtract, multiply, and so on).
The operands for these instructions make up the data stream, which flows
over the data bus from the storage area into the ALU. As the ALU carries
out operations on the incoming operands, the results stream flows out of the
ALU and back into the storage area via the data bus. This process continues
until the code stream stops coming into the ALU. Figure 1-3 expands on
Figure 1-1 and shows the storage area.
The data enters the ALU from a special storage area, but where does
the code stream come from? One might imagine that it comes from the
keypad of some person standing at the computer and entering a sequence
of instructions, each of which is then transmitted to the code input port of
the ALU, or perhaps that the code stream is a prerecorded list of instruc-
tions that is fed into the ALU, one instruction at a time, by some manual or
automated mechanism. Figure 1-3 depicts the code stream as a prerecorded
list of instructions that is stored in a special storage area just like the data stream, and modern computers do store the code stream in just such a
manner.
Basic Computing Concepts
5
Storage Area
ALU
Figure 1-3: A simple computer, with an ALU
and a region for storing instructions and data
NOTE
More advanced readers might notice that in Figure 1-3 (and in Figure 1-4 later) I’ve separated the code and data in main memory after the manner of a Harvard architecture level-one cache. In reality, blocks of code and data are mixed together in main memory, but for now I’ve chosen to illustrate them as logically separated.
The modern computer’s ability to store and reuse prerecorded sequences
of commands makes it fundamentally different from the simpler calculating
machines that preceded it. Prior to the invention of the first stored-program