This page contains questions and answers for the third quiz in CS100: Principles of Computer Science, a course based on the book The Most Comples Machine. The answers given here are sample answers only. There is always some variation in the answers that would receive full credit. The Notes contain any extra comments I happen to have; they are not parts of the answers.
Question 1: The simple model computer xComputer performs each fetch-and-execute cycle as a sequence of small steps. The first three steps, which are identical in all fetch-and-execute cycles, are as follows. Explain briefly why each step is necessary. (Don't just say what it does; explain the role it plays in the fetch-and-execute cycle.)
Answer:
Note: Step 3 depends on step 1, since the instruction is loaded from the location whose address was put into ADDR in step 1. However, steps 2 and 3 could actually be performed in either order (or even, really, at the same time, by turning on both control wires at once).
Question 2: Explain carefully (a) the purpose of the Control Circuit, and (b) how, in general terms, it carries out that purpose.
Answer: The purpose of the Control Circuit is to execute programs by carrying out each step in the fetch-and-execute cycle. It does this by turning control wires on and off.
Note: It is possible to amplify on this, of course. The Control Circuit is a logic circuit (a plain logic circuit, without feedback loops). Its input wires carry all the information necessary to determine what action needs to be taken for each step of the fetch-and-execute cycle. This information includes: the contents of the COUNT register, the instruction code from the Instruction Register, and the number in the accumulator. The outputs from the Control Circuits are connected to control wires that control the action of other components. For example, turning on a control wire might copy a number from one register to another or load the answer from the ALU into the accumulator. All the computations of the computer have to be reduced to just these sorts of simple actions.
Question 3: Define the term register as it pertains to this course.
Answer: A register is a memory unit that is part of the CPU. Registers are used to hold all the data that is being used directly in the CPU's computation.
Question 4: What role does the clock play in a computer?
Answer: The clock is the compontent of the computer that makes everything happen. As the clock "ticks," it turns an output wire on and off. Each time the wire comes on, the COUNT register is incremented by one, and the next step in the fetch-and-execute cycle is performed.
Note: Changing the number in the COUNT register changes the inputs to the Control Circuit. When this happens, its outputs will also change so that certain control wires will be turned on and others will be turned off. This in turn causes whatever action is necessary for the next step of the fetch-and-execute cycle.