Information Technology Reference
In-Depth Information
Take card X (from store to pad).
Take card C (from store to pad).
Compare what is on card X with what is on card C.
If the contents match, add the “Sales” to the “Total.” If not, replace both
cards and take the next one.
It would obviously be more efficient not to keep taking out and putting back
card C, the
Washington
card. If there is enough room on the scratch pad, the clerk
could store this information on the pad for the duration of the calculation. This
is an example of a trade-off in the hardware design: the balance between the
clerk having to shuffle cards in and out versus increasing the amount of stor-
age space needed on the pad. We can keep breaking down the clerk's tasks into
simpler ones until they correspond directly to basic operations that he knows
how to carry out. For example, we need to tell the clerk precisely how to com-
pare the information stored in “Location” and the name
Washington.
Let us teach the file clerk how to use the scratch pad. The instructions can
be divided into two groups. One group is a core set of simple procedures that
come with the pad - add, transfer, and so on. In a computer, these instructions,
called the
instruction set
, are the ones that have been implemented in the hard-
ware: they do not change when we change the problem. They are like the clerk's
intrinsic abilities. Then there is a set of instructions specific to the task at hand,
such as calculating the total number of sales for the state of Washington. This
set of specialized instructions is the “program.” The program's instructions can
be broken down into operations from the core set as we have seen. The pro-
gram represents the detailed instructions about how to use the clerk's intrinsic
abilities to do the specific job.
To get the right answer, the clerk must follow exactly the instructions that
constitute the “program” in precisely the right order. We can ensure this by
designating an area on the scratch pad to keep track of which steps have been
completed. In a computer, this area is called a
program counter
. The program
counter tells the clerk where he is in the list of instructions that constitute the
program. As far as the clerk is concerned, this number is just an “address” that
tells him where to look for the card with the instruction about what to do next.
The clerk goes and gets this instruction and stores it on the pad. In a computer,
this storage area is called the
instruction register
. Before carrying out the instruc-
tion, the clerk prepares for the next one by adding one to the number in the
program counter. The clerk will also need some temporary storage areas on the
pad to do the arithmetic, save intermediate values, and so on. In a computer,
these storage areas are called
registers
. Even if you are only adding two num-
bers, you need to remember the first while you fetch the second. Everything
must be done in the correct sequence and the registers allow us to organize
things so that we achieve this goal.
Suppose our computer has four registers - A, B, and X plus a special regis-
ter C that we use to store any number that we need to carry (put into another
column) as part of the result of adding two numbers. Let us now look at a pos-
sible set of core instructions, the
instruction set
, for the part of a computer cor-
responding to the scratch pad. These instructions are the basic ones that will
be built into the computer hardware. The first kind of instruction concerns
the transfer of data from one place to another. For example, suppose we have
Search WWH ::
Custom Search