Chapter 8 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!).  (See pages 2, 242.)

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. (See pages 243-244.)

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. (See page 244.)

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. (See page 244.)

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. (See page 244.)

f. The instruction INC requires a parameter to say which register is being incremented.
False. The INC instruction increments the value in the accumulator. (See page 245.)

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. (See page 246.)

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. (See page 246.)

i. The buffer is used in the instruction INP, but not in OUT.
False. The buffer is used in all inputs and outputs. (See page 246.)

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. (See page 247.)

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. (See page 248.)

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. (See page 248.)

m. STO and RCL involve direct access to a register; ISTO and IRCL involve indirect access. (See page 252.)
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. (See page 256.)

n. 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. (See page 256.)

o. Boolean circuits are certain electric circuits that were invented by George Boole.
False. Boolean circuits are abstract, while electric circuits are concrete. (See page 259.)

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. (See page 259.)

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. (See page 259.)

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. (See page 260.)

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. (See pages 255-260.)

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. (See pages 260-262.)

u. Most, but not all, RM’s can be realized as boolean circuits.
False. All RM’s can be realized as boolean circuits. (See pages 264-271.)

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. (See pages 269-270.)

w. The truth-table for even a very small RM would be pretty enormous.
True. In fact ‘pretty enormous’ is an understatement! (See page 271.)