Central Processing Unit and Cooling Systems May 2016 | Page 19
Memory (working with memory and program worksheet) keeps hold of the program and passes one instruction at a time onto the CPU.
It also keeps constant track of the current values of x and y.
Display (working with display grid) responds to the plot command from the CPU by marking the screen as instructed.
Activity
The CPU begins, by asking for the first instruction from memory. Then it ‘processes’ it:
If the instruction starts with the work PLOT, the CPU needs to ask for the current value of x and the current value for y and then
passes these values on to the Display, together with the plot command.
If the instruction begins with ADD or SUB, then the CPU needs to ask the Memory for the current value of the required
variable(s). It then needs to calculate the result and tell the Memory the new value of the variable to be stored.
When the Display receives an instruction it needs to plot the value of x and the value of y on the display grid.
Example
For this example, assume that the program begins with the following instructions:
Add 4 to x
Add 6 to y
Plot (x, y)
The group should handle these instructions as follows:
CPU asks for (fetches) the instruction (add 4 to x) from the Memory
CPU asks the Memory for the value of x.
CPU adds 4 to the value of x and tells the Memory to store the new value for x.