Structure and Function of the Processor - Worksheets, Questions and Revision
10 original exam-style questions - 5 pages of questions with a full mark scheme - free printable PDF.
Structure and Function of the Processor revision guideMore A Level Computer Science practiceMock exams
This topic is chapter 1 of A Level Computer Science Topic Workbook 1 and chapter 1 of A Level Computer Science 10-Minute Tests.
1.1 Structure and Function of the Processor
i) Holds the address of the next instruction to be fetched.
ii) Holds the address currently being accessed in memory, for a read or a write.
iii) Holds data or an instruction that has just been fetched from memory, or is about to be written to memory.
iv) Holds the instruction that is currently being decoded or executed.(4)
address 100: LDD 200 (load the value directly from address 200 into the accumulator)
address 101: ADD 201 (add the value directly from address 201 to the accumulator)
address 102: STO 202 (store the value in the accumulator directly to address 202)
address 200: 15
address 201: 9
address 202: (currently empty)
The Program Counter starts at 100.
Step 1: MAR <- [PC] MAR = ?
Step 2: PC <- [PC]+1 PC = ?
Step 3: MDR <- [[MAR]] MDR = ?
Step 4: CIR <- [MDR] CIR = ?(4)
Processor X: clock speed 3.6 GHz, 4 cores, 8 MB L3 cache.
Processor Y: clock speed 4.2 GHz, 2 cores, 4 MB L3 cache.
The video editing software used is able to make use of multiple cores when rendering effects and exporting finished videos.
Discuss the factors that affect processor performance, and evaluate which of Processor X or Processor Y is likely to be more suitable for this video editing task. Justify your conclusion.
Question 1
- (a) decodes the instruction held in the CIR oeB1
- (a) generates and sends the control signals needed to coordinate/manage the components of the CPU during execution oeB1
- (a) Answer: The CU decodes instructions and generates the control signals that coordinate the CPU's components.
- (b) carries out arithmetic operations, e.g. addition, subtraction oeB1
- (b) carries out logical operations/comparisons, e.g. AND, OR, NOT, greater than oeB1
- (b) Answer: The ALU performs arithmetic operations (e.g. addition) and logical operations/comparisons.
- (c) generates regular electrical pulses/a timing signal oeB1
- (c) used to synchronise the operations of the CPU's components, controlling the rate at which instructions are processed oeB1
- (c) Answer: The clock produces regular timing pulses that synchronise the CPU's components and set the rate of processing.
Question 2
- (a) i) PC (Program Counter)B1
- (a) ii) MAR (Memory Address Register)B1
- (a) iii) MDR (Memory Data Register)B1
- (a) iv) CIR (Current Instruction Register)B1
- (a) Answer: i) PC, ii) MAR, iii) MDR, iv) CIR
- (b) Accumulator (ACC)B1
- (b) Answer: Accumulator (ACC)
- (c) the PC must hold the address of the next instruction to be fetched oeB1
- (c) incrementing it early ensures instructions are normally executed in the correct sequential order, one after another oeB1
- (c) unless the current instruction is a jump/branch instruction, in which case the PC is overwritten with a new address once that instruction is executed oeB1
- (c) Answer: The PC is incremented early so it is ready to point to the next sequential instruction, unless a jump/branch later overwrites it.
Question 3
- (a) carries the memory address of the location to be read from or written to oeB1
- (a) Answer: Carries the address of the memory location being accessed.
- (b) carries the actual data or instructions being transferred between the CPU and memory oeB1
- (b) Answer: Carries the data/instructions transferred between the CPU and memory.
- (c) carries control signals, e.g. read/write signals, clock signals or interrupt signals, that coordinate/synchronise the transfer of data between components oeB1
- (c) Answer: Carries control signals (e.g. read/write, clock, interrupt) that coordinate data transfer.
- (d) data must be able to travel from memory to the CPU, e.g. when a value is read/loaded oeB1
- (d) and from the CPU to memory, e.g. when a result is written/stored, whereas an address only ever needs to travel from the CPU to memory to specify a location oeB1
- (d) Answer: Data must flow both ways (memory to CPU on a read, CPU to memory on a write), whereas addresses only ever travel from CPU to memory.
- (e) more bits/bytes of data can be transferred between the CPU and memory in a single operation/clock cycle, improving performance/throughput oeB1
- (e) Answer: More data can be transferred per operation, improving performance.
Question 4
- (a) MAR = 100, caoB1
- (a) PC = 101, caoB1
- (a) MDR = LDD 200, cao (the instruction stored at address 100)B1
- (a) CIR = LDD 200, ft from MDRB1
- (a) Answer: MAR = 100, PC = 101, MDR = LDD 200, CIR = LDD 200
- (b) MAR <- [CIR operand] (i.e. MAR <- 200); MDR <- [[MAR]]; ACC <- [MDR], oe (any correct logic, ignore minor notation differences)M1
- (b) ACC = 15, caoA1
- (b) Answer: ACC <- [MDR] where MDR holds the value at address 200; ACC = 15
- (c) ACC <- [ACC] + [MDR], where MDR holds the value fetched from address 201 (value 9), oeM1
- (c) ACC = 24, cao (ft from part b if a different value for ACC was carried forward consistently)A1
- (c) Answer: ACC = 24
- (d) 24, cao (ft from part c)B1
- (d) Answer: 24
- (e) CA, cao (working shown, e.g. 202 = 12x16 + 10)B1
- (e) Answer: CA
Question 5
- (a) 3.2 GHz converted to Hz, i.e. 3.2 x 109 cycles per second, oeM1
- (a) 3.2 x 109 divided by 4, correct method to find instructions per second oeM1
- (a) 8 x 108 instructions per second, awrt (accept 800,000,000 or 800 million), caoA1
- (a) Answer: 8 x 108 instructions per second (800,000,000)
- (b) a higher clock speed causes the processor to generate more heat, which risks damage or errors if not adequately cooled oeB1
- (b) a higher clock speed increases power consumption, which is a particular problem for battery powered/mobile devices oeB1
- (b) there are physical limits to how fast transistors can reliably switch, and overall performance may also be limited by other bottlenecks (e.g. RAM speed), so gains are limited oeB1
- (b) Answer: Higher clock speeds increase heat and power consumption and are limited by physical switching speed and other system bottlenecks, so performance gains are not unlimited.
Question 6
- (a) a small amount of very fast memory, located on or very close to the CPU oeB1
- (a) used to store instructions and data that have recently been used, or are likely to be needed again soon, to reduce the time spent accessing slower RAM oeB1
- (a) Answer: Cache is a small, very fast memory close to the CPU that stores frequently/recently used instructions and data, reducing waiting time for RAM.
- (b) temporal locality: if a memory location/instruction has recently been accessed, it is likely to be accessed again soon oeB1
- (b) so keeping recently used items in cache means future requests for them can be served quickly from cache rather than slower RAM oeB1
- (b) spatial locality: if a memory location is accessed, nearby/neighbouring locations are also likely to be accessed soon oeB1
- (b) so when data is fetched, nearby memory locations are also copied into cache, meaning they will already be present when needed oeB1
- (b) Answer: Temporal locality: recently used items are likely to be reused soon, so cache keeps them ready. Spatial locality: nearby locations are likely to be used soon, so cache pre-loads them too.
Question 7
- (a) a single chip that contains two or more independent processing units (cores) oeB1
- (a) each core can carry out its own fetch, decode, execute cycle at the same time as the others oeB1
- (a) Answer: A processor with two or more independent cores on one chip, each able to run its own fetch, decode, execute cycle simultaneously.
- (b) limitation 1 identified: not all software is written/optimised to make use of more than one core oeB1
- (b) expansion: some tasks are inherently sequential, where each step depends on the result of the previous one, so they can only run on a single core no matter how many are available oeB1
- (b) limitation 2 identified: coordinating/communicating between cores (e.g. sharing data, avoiding conflicts) introduces overhead oeB1
- (b) expansion: this overhead, together with heat and power demands of extra cores, means performance does not increase in direct proportion to the number of cores added oeB1
- (b) Answer: Software must be written to exploit multiple cores, and sequential dependencies limit parallelism; coordination overhead and heat/power costs mean performance does not scale directly with core count.
- (c) any suitable highly parallelisable task, e.g. video rendering/encoding, running multiple independent applications at once, scientific/matrix simulations oeB1
- (c) Answer: For example, video rendering, where independent frames/effects can be processed in parallel across cores.
Question 8
- (a) FetchB1
- (a) DecodeB1
- (a) Execute (oe; must be in this order for all 3 marks, otherwise max 1 mark for the correct set of names)B1
- (a) Answer: Fetch, decode, execute
- (b) the fetch, decode and execute stages of successive instructions are overlapped, rather than one instruction fully completing before the next begins oeB1
- (b) so, once the pipeline is full, one instruction can be completed every clock cycle, increasing the overall rate/throughput of instruction processing oeB1
- (b) Answer: Pipelining overlaps the stages of successive instructions so that, once full, one instruction completes per clock cycle, increasing throughput.
- (c) (i) 400 cycles, cao (100 x 4)B1
- (c) (ii) correct method shown: (number of stages - 1) + number of instructions, i.e. 3 + 100 oeM1
- (c) (ii) 103 cycles, caoA1
- (c) Answer: (i) 400 clock cycles, (ii) 103 clock cycles
- (d) 3.88, ft from part c (400 / 103), awrtB1
- (d) Answer: 3.88 (2dp)
Question 9
- Level 3 A detailed, well-organised discussion that accurately explains at least three relevant performance factors (e.g. clock speed, number of cores, cache size, and/or software optimisation), applies them specifically to the figures given for Processor X and Processor Y, and reaches a clear, well-justified conclusion about suitability for the video editing task. Correct technical terminology is used consistently and accurately.7-9
- Level 2 A reasonable discussion covering at least two relevant performance factors, with some application to the processor specifications given, reaching a conclusion. However, the discussion may be unbalanced, an important factor may be omitted, application to the scenario may be only partial, or the justification for the conclusion may be incomplete. Mostly correct terminology.4-6
- Level 1 Basic or generic statements about one or two performance factors, with little or no application to the specific figures or scenario given. A conclusion, if present, is largely unsupported.1-3
- Level 0 No relevant content, or the response does not address the scenario.0
- Indicative content:
- Clock speed determines the number of fetch, decode, execute cycles completed per second, so Processor Y's higher clock speed (4.2 GHz vs 3.6 GHz) allows it to complete more cycles per second on a single core
- Number of cores allows work to be split and processed in parallel; Processor X has more cores (4 vs 2)
- Since the video editing software can make use of multiple cores for rendering and exporting, these tasks are highly parallelisable, so having more cores available (Processor X) is likely to be more beneficial than a higher clock speed on fewer cores
- Cache size affects how much frequently used data (e.g. video frame buffers) can be held close to the CPU; Processor X's larger 8 MB cache should reduce the time spent waiting for slower RAM more than Processor Y's 4 MB cache, which is likely to help with large video files
- A counter-argument: for any part of the software that is single threaded (e.g. certain preview or user interface operations), Processor Y's higher clock speed per core may give faster performance on that part of the workload
- Overall performance depends on the combination of these factors together with how well the specific software is optimised, not on any single figure in isolation
- A justified conclusion, e.g. Processor X is likely to be more suitable overall, because its extra cores and larger cache are better matched to a workload (rendering/exporting) that is described as multi-core optimised, outweighing Processor Y's higher clock speed
- Credit an alternative conclusion (e.g. favouring Processor Y) if it is clearly and specifically justified using the figures and factors given
Question 10
- (a) MAR <- [PC], oe (any correct logic, ignore minor differences in notation)M1
- (a) PC <- [PC] + 1, oeM1
- (a) MDR <- [[MAR]], oe (transfer via the data bus from the memory location addressed by MAR)M1
- (a) CIR <- [MDR], oeM1
- (a) Answer: MAR <- [PC]; PC <- [PC]+1; MDR <- [[MAR]]; CIR <- [MDR]
- (b) MAR <- [CIR operand] (i.e. MAR <- 300); MDR <- [[MAR]], oe (any correct logic, ignore minor syntax; fetches the value to be added)M1
- (b) ACC <- [ACC] + [MDR], oe (correctly adds the fetched operand to the current accumulator value)A1
- (b) Answer: MAR <- 300; MDR <- [[MAR]]; ACC <- [ACC] + [MDR]
Mark your answers
Check answers without an account. Some answers can be checked automatically; use the mark scheme to mark the rest.