STRUCTURED
COMPUTER ORGANIZATION
FIFTH EDITION
PROBLEM SOLUTIONS
ANDREW S. TANENBAUM
Vrije Universiteit
Amsterdam, The Netherlands
PRENTICE HALL
UPPER SADDLE RIVER, NJ 07458
PROBLEM SOLUTIONS 1
SOLUTIONS TO CHAPTER 1 PROBLEMS
1. a. A translator converts programs in one language to another.
b. An interpreter carries out a program instruction by instruction.
c. A virtual machine is a conceptual machine, one that does not exist.
2. An interpreter executes a program by fetching the first instruction, carrying it
out, then fetching the next one, and so on. A translator first converts the original
program into an equivalent one in another language and then runs the
new program.
3. It is possible, but there are problems. One difficulty is the large amount of
code produced. Since one ISA instruction does the work of many microinstructions,
the resulting program will be much bigger. Another problem is
that the compiler will have to deal with a more primitive output language,
hence it, itself, will become more complex. Also, on many machines, the
microprogram is in ROM. Making it user-changeable would require putting it
in RAM, which is much slower than ROM. On the positive side, the resulting
program might well be much faster, since the overhead of one level of
interpretation would be eliminated.
4. During the detailed design of a new computer, the device and digital logic
levels of the new machine may well be simulated on an old machine, which
puts them around level 5 or 6.
5. Each level of interpretation slows down the machine by a factor of n /m.
Thus the execution times for levels 2, 3, and 4 are kn /m, kn 2 /m2, and
kn 3 /m3, respectively.
6. Each additional level of interpretation costs something in time. If it is not
needed, it should be avoided.
7. You lose a factor of n at each level, so instruction execution times at levels 2,
3, and 4 are kn, kn 2, and kn 3, respectively.
8. Hardware and software are functionally equivalent. Any function done by
one can, in princi