A school is buying new desktop computers for its computer science classroom. The teacher explains that each computer uses the von Neumann stored program concept: the program instructions and the data are stored together in main memory, and the CPU runs each instruction by carrying out the fetch-decode-execute cycle.
Discuss the role of the control unit, the arithmetic logic unit (ALU) and registers in the fetch-decode-execute cycle.
Your answer should include:
- how an instruction is fetched from main memory and decoded
- how the ALU executes an instruction
- how registers are used during the cycle.
Mark scheme
Indicative content
Fetching and decoding an instruction
- The register that holds the address of the next instruction (the program counter) contains the address of the instruction to be fetched.
- This address is sent to main memory (RAM) and the instruction is copied from main memory into a register inside the CPU.
- The program counter is updated so that it holds the address of the next instruction in the program.
- The control unit decodes the instruction that has been fetched, working out which operation is required and which data or registers are needed.
- The control unit sends control signals to coordinate the other components as the instruction is carried out.
- The control unit decides what happens next, for example after a comparison it decides whether the next instruction is the following one or a jump.
The arithmetic logic unit (ALU) executes an instruction
- The control unit directs the arithmetic logic unit (ALU) to carry out the operation.
- The ALU performs arithmetic operations such as addition, subtraction, multiplication and division, for example adding two values in a program written by the class.
- The ALU performs logical operations such as comparing two values to see if they are equal or whether one is greater than the other.
- The result of the operation carried out by the ALU is passed back and stored in a register.
- The ALU operates on data that has been fetched from main memory; it does not fetch the instruction and it does not decide which instruction is next.
Registers
- Registers are small, very fast memory locations inside the CPU.
- They hold the data, addresses and results that the CPU is working on during the cycle.
- Registers are used in every stage of the cycle, not only when the ALU produces a result.
- Because registers are inside the CPU they can be read and written much faster than main memory during the cycle.
Levels
- Level 0 (0 marks): No rewardable content.
- Level 1 (1–2 marks): Basic, independent points are made, showing elements of understanding of key concepts/principles of computer science. (AO1) The discussion will contain basic information with little linkage between points made or application to the context. (AO2)
- Level 2 (3–4 marks): Demonstrates adequate understanding of key concepts/principles of computer science. (AO1) The discussion shows some linkages and lines of reasoning with some structure and application to the context. (AO2)
- Level 3 (5–6 marks): Demonstrates comprehensive understanding of key concepts/principles of computer science to support the discussion being presented. (AO1) The discussion is well developed, with sustained lines of reasoning that are coherent and logically structured, and which clearly apply to the context. (AO2)
- A Level 3 answer must link the roles of all three components to the fetch, decode and execute stages. An answer that links only one component to a stage, with the other points listed separately, is Level 1 (1–2 marks); an answer that links two of the components to stages is Level 2 (3–4 marks). A point repeated under more than one heading is credited once only.
- Accept 'the program counter', 'the address register' or 'a register holding the address of the next instruction' as the register that holds the address of the next instruction. Do not accept 'the control unit performs the calculations', 'the ALU controls the timing of the CPU' / 'the ALU sends the clock signal' or 'registers are in main memory (RAM)'.
Example answers and how they were marked
In the fetch stage, a register called the program counter holds the address of the next instruction and this address is sent to main memory. The instruction is copied from main memory into a register in the CPU and the program counter is updated so that it points to the next instruction. The control unit then decodes the instruction in the decode stage, working out which operation is required and which data or registers are needed, and it sends control signals to coordinate the other components. In the execute stage the control unit directs the ALU to carry out the operation the class's program needs: the ALU does arithmetic, such as adding two values, or a logical comparison, such as checking whether one value is greater than another, and it does not decide what happens next, the control unit does. The result from the ALU is stored in a register, and because registers hold the data, addresses and results at every stage, the cycle can repeat with the next instruction.
Why: Level 3: the role of each component is linked to the stage it works in (program counter and registers in fetch, control unit decoding and deciding next, ALU executing and its result stored in a register) across all three stages, with the classroom context.
The control unit decodes the instruction in the decode stage. The ALU does maths and logic, such as addition and comparing numbers. Registers store data inside the CPU. In the fetch stage the instruction is fetched from the RAM and put into the CPU.
Why: Level 1: several correct basic points that the mark scheme credits (the instruction is fetched from main memory into the CPU, the control unit decodes the instruction, the ALU does arithmetic and logical operations, registers store data) but only the control unit is linked to a stage of the cycle, so the answer is top of Level 1.
The control unit decodes instructions. The ALU controls the timing of the CPU and sends the clock signal. Registers are in the RAM and they store the program.
Why: Level 1: one basic point, that the control unit decodes instructions (1). The other statements are on the do-not-accept list (the ALU does not control the timing of the CPU or send the clock signal, and registers are in the CPU, not main memory), so they earn no credit.