Question bank › IB Computer Science › A1 Computer fundamentals

CPU, GPU, primary memory and the fetch–decode–execute cycle

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core4 marks

Describe the fetch stage of the fetch–decode–execute cycle, referring to the program counter (PC), memory address register (MAR), memory data register (MDR) and instruction register (IR). [4]

2Standard3 marks

A research team trains a neural network using a GPU. Explain why the architecture of a GPU makes it well suited to this task. [3]

3Standard3 marks

Explain how cache memory reduces the time the CPU spends waiting for data. [3]

Stuck on CPU, GPU, primary memory and the fetch–decode–execute cycle?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Core3 marks

(a) State the function of the arithmetic logic unit (ALU). [1]

(b) Outline two functions of the control unit (CU). [2]

5Standard4 marks

A smart thermostat contains an embedded processor with both RAM and ROM. When it is switched on, it runs a start-up program and then records the current room temperature every minute.

(a) Explain why the start-up program is stored in ROM. [2]

(b) Explain why the temperature readings are stored in RAM rather than ROM. [2]

6Standard5 marks

A program makes 2000 memory accesses while it runs. 1840 of these are cache hits. Reading from cache takes 2 ns. On a cache miss, the cache is checked first (2 ns) and then the data is read from RAM (80 ns).

(a) Calculate the cache hit rate as a percentage. [1]

(b) Calculate the total time, in ns, taken for all 2000 memory accesses. [2]

(c) Describe what happens when a cache miss occurs. [2]

7Standard5 marks

The diagram shows how a CPU is connected to main memory by three buses, X, Y and Z. Arrowheads show the direction(s) in which each bus carries information.

(a) Identify bus X, giving a reason based on the diagram. [2]

(b) During the fetch stage, an instruction travels from RAM to the CPU along bus Y. Identify bus Y and the register that first receives the instruction. [2]

(c) Bus Z is the control bus. State one signal that it carries. [1]

CPUControl unit (CU)ALURegistersPC MAR MDR IR ACMainmemory(RAM)Bus XBus YBus Z
8Hard6 marks

A simple CPU has the registers PC, MAR, MDR, IR and an accumulator (AC). Part of main memory is shown.

AddressContents
20LOAD 50
21ADD 51
22STORE 52
507
515
520

LOAD copies the value at the given address into AC; ADD adds the value at the given address to AC; STORE copies AC to the given address. Each instruction that refers to memory places that address in the MAR and passes the data through the MDR during the execute stage.

At the start, PC = 20 and AC = 0.

Copy and complete the table to show the contents of each register at the end of the execute stage of each instruction. [6]

InstructionPCMARMDRIRAC
LOAD 50
ADD 51
STORE 52
9HardHL only6 marks

A video-editing application exports a 4K video after applying colour-correction filters to every frame. The application uses both the CPU and the GPU.

(a) Explain how the CPU and the GPU divide the work and coordinate during the export. [4]

(b) Explain one difference between the way the CPU and the GPU access memory. [2]

10StretchHL only6 marks

The diagram shows three instructions, I1 to I3, passing through a four-stage instruction pipeline in a single CPU core. Each stage takes one clock cycle.

(a) State the stage that instruction I2 is in during clock cycle 3. [1]

(b) Calculate the number of clock cycles needed to complete 10 instructions (i) without pipelining and (ii) with this pipeline. [3]

(c) A quad-core processor has this pipeline in each core. 40 independent instructions are divided equally between the cores. Calculate the number of clock cycles needed, and state why the cores can work in this way. [2]

Clock cycle123456I1FDEWI2FDEWI3FDEWF = fetch, D = decode, E = execute, W = write-back

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session