Gödel, Escher, Bach An Eternal Golden Braid by Douglas R. Hofstadter

(Dana P.) #1
You could call the two positions "up" and "down", or "x" and "0", or "1"
and "0" ... The third is the usual convention. It is perfectly fine, but it has
the possibly misleading effect of making people think that a computer,
deep down, is storing numbers. This is not true. A set of thirty-six bits does
not have to be thought of as a number any more than two bits has to be
thought of as the price of an ice cream cone. Just as money can do various
things depending on how you use it, so a word in memory can serve many
functions. Sometimes, to be sure, those thirty-six bits will indeed represent
a number in binary notation. Other times, they may represent thirty-six
dots on a television screen. And other times, they may represent a few
letters of text. How a word in memory is to be thought of depends entirely
on the role that this word plays in the program which uses it. It may, of
course, play more than one role-like a note in a canon.

Instructions and Data

There is one interpretation of a word which I haven't yet mentioned, and
that is as an instruction. The words of memory contain not only data to be
acted on, but also the program to act on the data. There exists a limited
repertoire of operations which can be carried out by the central processing
unit-the CPU-and part of a word, usually its first several bits-is inter-
pretable as the name of the instruction-type which is to be carried out.
What do the rest of the bits in a word-interpreted-as-instruction stand for?
Most often, they tell which other words in memory are to be acted upon. In
other words, the remaining bits constitute a pointer to some other word (or
words) in memory. Every word in memory has a distinct location, like a
house on a street; and its location is called its address. Memory may have one
"street", or many "streets"-they are called "pages". So a given word is
addressed by its page number (if memory is paged) together with its
position within the page. Hence the "pointer" part of an instruction is the
numerical address of some word(s) in memory. There are no restrictions
on the pointer, so an instruction may even "point" at itself, so that when it is
executed, it causes a change in itself to be made.
How does the computer know what instruction to execute at any given
time? This is kept track of in the CPU. The CPU has a special pointer which
points at (i.e., stores the address of) the next word which is to be interpret-
ed as an instruction. The CPU fetches that word from memory, and copies
it electronically into a special word belonging to the CPU itself. (Words in
the CPU are usually not called "words", but rather, registers.) Then the CPU
executes that instruction. Now the instruction may call for any of a large
number of types of operations to be carried out. Typical ones include:


ADD the word pointed to in the instruction, to a register.
(In this case, the word pointed to is obviously interpreted as a
number.)

Levels of Description, and Computer Systems 289

Free download pdf