Chapter 5 review. Are the following statements true or false? Explain why or why not.
a) A virtual machine is a machine that seems to exist, but really doesn’t.
True. It is a simulation of a machine, run on another machine (which
may itself be a virtual machine, also!).
b. A register machine (RM) has a lot in common with a cash register.
False. About all the two have in common is a collection of “compartments”; while
a cash register's operations only let it perform a specific set of tasks, an
RM's operation make for general purpose programmability.
c. In an RM, the accumulator accumulates the results of all the computations
performed so far.
False. The accumulator is the central storage unit in which computations are
performed.
d. The instruction STO copies the contents of the accumulator into all the
registers.
False. The instruction STO requires a parameter, which specifies which register
the contents of the accumulator are to be copied to.
e. The instruction RCL 5 moves the contents of register 5 to the accumulator.
True. The function of the recall instruction RCL is to copy the contents of
a register to the accumulator.
f. The instruction INC requires a parameter to say which register is being
incremented.
False. The INC instruction increments the value in the accumulator.
g. The instruction DEC always subtracts 1 from the contents of the accumulator.
False. Almost correct, but not quite; DEC subtracts 1 from the contents of the
accumulator unless the value is zero, in which case an underflow results.
h. The instruction sequence INC DEC leaves the contents of the accumulator
unchanged.
False. Again, that’s generally true, but INC may result in an overflow if the
accumulator is full.
i. The buffer is used in the instruction INP, but not in OUT.
False. The buffer is used in all inputs and outputs.
j. The instruction register holds the number of the next instruction
to be performed.
True. Generally this register holds the very next instruction of the program,
unless a branching instruction is executed, in which case a different value
may be entered into the instruction register.
k. After each instruction is executed, the RM increments the instruction register.
True. As a result, the instruction register is ready to load the next instruction
in a program from memory. A branching instruction may cause quite a different
value to be entered into the accumulator.
l. An RM instruction set has three branching instructions.
False. Usually there are only two branching instructions--branch on zero (BRZ)
and branch on non-zero (BRN). But in fact, this is just for convenience--we
could get by with either one by itself. Some machines have several different
branching instructions.
m. STO and RCL involve direct access to a register; ISTO and IRCL involve indirect
access.
True. For example, STO 5 copies the accumulator value directly into register
5; ISTO 5 copies the value indirectly into the register whose address is stored
in register 5.
n. Direct access uses registers
called pointers.
False. Indirect access uses pointers, where a pointer is the address of an intermediate
register, which contains another register address, called the stored address.
o. Boolean circuits are certain electric circuits that were invented
by George Boole.
False. Boolean circuits are abstract, while electric circuits are concrete.
p. The three basic building blocks of boolean circuits are and, xor,
and not.
False. The standard three building blocks are and, or, and not,
where the or is inclusive rather than exclusive or.
q. An or-gate represents the exclusive sense of the word ‘or’.
False. An or-gate represents the inclusive sense of the word ‘or’--one,
or the other, or both.
r. An or-gate can be constructed from an and-gate and two not-gates.
False. Three not-gates are needed--one before each of the two inputs
to the or-gate, and one after the output.
s. The overall behavior of any boolean circuit can be represented by a truth-table.
True. An input column is needed for each input to the circuit. Then, for each
combination of boolean values assigned to the inputs, one or more boolean output
values result, and those values go in the output columns.
t. Any truth-table can be realized as the behavior of a boolean circuit.
True. It’s sometimes a bit complicated, but it can be done.
u. Most, but not all, RM’s can be realized as boolean circuits.
False. All RM’s can be realized as boolean circuits.
v. All the RM instructions except STO and RCL can be realized as boolean circuits.
False. (This follows from the previous answer!) All the RM instructions can
be realized as boolean circuits.
w. The truth-table for even a very small RM would be pretty enormous.
True. In fact ‘pretty enormous’ is an understatement!
x) Cache memory is the fastest part of register memory.
False. Registers are faster than cache, but cache memory is faster than RAM
or hard drives. So processors try to use data in cache memory instead of RAM
when possible.
y) A bus is a special part of the CPU which carries data to and from registers.
False. A bus carries data between the CPU and peripheral devices (and possibly
other CPUs).
z) SISD, MISD, and MIMD architectures are really just different names for the
same thing.
False. SISD (single insturction stream, single data set is a single uni-processors,
whereas MISD and MIMD are two possible architectures for multiprocessor systems,
the first with a single data set and the latter with multiple data sets.
More questions:
In a spreadsheet application, each
cell is in effect a register.
True. Something is stored in each cell, although computations can be performed
in the cells of a spreadsheet, without having to use an accumulator.