J277 1: Inside the CPU

OCR GCSE COMPUTER SCIENCE · J277 · PAPER 1

Inside the CPU

What the processor is made of, and how it fetches, decodes and executes every instruction.

Paper 1 · Lesson 1

1 / 20
next
Slide 1: Slide
New lesson editorComputer ScienceUpper Secondary (Key Stage 4)GCSE

This lesson contains 20 slides, with interactive quizzes and text slides.

time-iconLesson duration is: 60 min
Report this lesson

Introduction

OCR GCSE Computer Science (J277), Paper 1, lesson 1 of 26. Students learn the purpose of the CPU, what von Neumann architecture means, and the jobs of the ALU, CU, cache and the registers PC, MAR, MDR and accumulator. They then follow instructions step by step through the fetch–execute cycle with a click-through diagram and a register trace, put the steps in order, spot the mistakes in a student answer and finish with an exam-style question and mark scheme. This lesson was created with AI assistance.

Items in this lesson

OCR GCSE COMPUTER SCIENCE · J277 · PAPER 1

Inside the CPU

What the processor is made of, and how it fetches, decodes and executes every instruction.

Paper 1 · Lesson 1

Welcome the class. This is the first lesson of the J277 Paper 1 course (1.1 Systems architecture). Say: today we open up the processor and follow one instruction all the way through it.

Device-free: show the cover on the board.

Cover photo: Brecht Corbeel / Unsplash, shown as a hologram.

01 · LEARN · MISSION BRIEFING

By the end of this lesson you can…

01

Describe the purpose of the CPU and von Neumann architecture

02

Explain the jobs of the ALU, CU, cache, PC, MAR, MDR and accumulator

03

Describe each step of the fetch–execute cycle

SYSTEM VOICE

System online. Today's mission: get inside the CPU. Find out what each part does, then follow one instruction through the fetch, decode, execute cycle.

Play the system voice (round play button), then read the three outcomes aloud.

Voice script: "System online. Today's mission: get inside the CPU. Find out what each part does, then follow one instruction through the fetch, decode, execute cycle."

Device-free: read the briefing aloud and ask students to copy the three outcomes as headings.

1

I could explain what a CPU does

2

I know the name but not the job

3

I know some parts, like cache or cores

4

This is brand new to me

What do you already know about the CPU?

A quick starting-point check instead of a do-now. Leave the results on screen and say that every option is fine: by the end everyone should be able to explain the CPU's job and its parts.

Follow-up question: where in a computer do you think the CPU sits, and what might it need to talk to? (Memory, which comes up in this lesson.)

Device-free: hands up for each option, or students hold up 1–4 fingers.

01 · LEARN · THE CPU

The CPU processes data and instructions

The central processing unit (CPU) carries out the instructions of a program and processes data.

Its purpose is to run the fetch–execute cycle: fetch an instruction from memory, decode it, execute it, and repeat.

Say: the CPU is the part of the computer that does the processing. Everything else, memory, storage, input and output, either feeds it or receives its results.

Key definition for books: the purpose of the CPU is to process data and instructions by carrying out the fetch–execute cycle.

Misconception: the CPU is not the whole tower or box under the desk. It is one chip on the motherboard.

Device-free: students write the definition in their books. Image credit: Brian Kostiuk / Unsplash

01 · LEARN · VON NEUMANN ARCHITECTURE

One memory for instructions and data

Most computers follow the von Neumann architecture, described by John von Neumann in 1945.

The stored program concept: program instructions and data are stored together in the same main memory.

CPU

MEMORY

instructions + data

SYSTEM VOICE · KEY DEFINITION

Von Neumann architecture. Program instructions and data are stored together, in the same memory. The CPU fetches them one at a time, and carries them out in order.

Play the system voice for the key definition, then point at the diagram: one memory holds both the program and its data, and the CPU fetches from it.

Voice script: "Von Neumann architecture. Program instructions and data are stored together, in the same memory. The CPU fetches them one at a time, and carries them out in order."

Why it matters: before stored-program computers, changing the task often meant rewiring the machine. Storing the program in memory means a new program can simply be loaded.

OCR J277 links von Neumann architecture to the registers MAR, MDR, PC and accumulator, which come next.

Device-free: students copy the definition and sketch the two-box diagram.

What is the key idea of von Neumann architecture?

A

Instructions are kept inside the ALU

B

Every instruction has its own processor

C

Data is kept in the CPU, instructions in RAM

D

Data and instructions are kept in the same memory

Answer: data and instructions are kept in the same memory (the stored program concept).

Why the others are wrong: the ALU does calculations, it does not store the program; a von Neumann computer has one processor fetching one instruction at a time; data is not kept separately from instructions.

Device-free: students write A, B, C or D on mini whiteboards. Image credit: Maxence Pira / Unsplash

01 · LEARN · PARTS OF THE CPU

Four parts, four jobs

ALU · arithmetic logic unit

Does arithmetic (such as adding and subtracting) and logic operations (such as comparing two values: is A greater than B?).

CU · control unit

Decodes instructions and sends control signals that direct how data moves around the CPU and the computer. It runs the fetch–execute cycle.

Cache

A small amount of very fast memory in the CPU. It keeps frequently used data and instructions close by, so the CPU waits less for slower RAM.

Registers

Tiny, extremely fast storage locations inside the CPU. Each holds one item (an address, an instruction or a piece of data) while it is being used.

Go through the four cards. Ask a student to rephrase each one in their own words before moving on.

Analogy if useful: the CU is the conductor of an orchestra, the ALU is the calculator, cache is the notes on the desk, registers are what is in your hands right now.

Misconceptions: the ALU does not decide what happens next (the CU does). Cache is memory, not storage: it is emptied when the power goes off.

Device-free: students draw a CPU box with the four parts inside and one line on each.

01 · LEARN · THE REGISTERS

Four registers you must know

PC · program counter

Holds the address of the next instruction to be fetched. It goes up by 1 every cycle.

MAR · memory address register

Holds the address of the memory location about to be read from or written to.

MDR · memory data register

Holds the data or instruction just fetched from memory, or about to be written to memory.

ACC · accumulator

Holds the results of calculations done by the ALU, until they are needed or stored.

Memory hook: the A registers (PC, MAR) hold addresses; the D register (MDR) holds data.

These four are named in the OCR J277 specification and come up in almost every Paper 1. Stress the difference between an address (where something is) and data (what is stored there).

Analogy: an address is a house number; the data is who lives there.

Misconception: the PC does not count how many programs are running, and it does not hold the instruction itself, only its address.

Device-free: students make a four-row table: register, full name, what it holds.

Which register holds the address of the next instruction to be fetched?

A

PC

B

MAR

C

MDR

D

Accumulator

Answer: the PC (program counter).

Common wrong answer: MAR. The MAR holds the address of the location currently being accessed; the PC holds the address of the next instruction. In the fetch stage the PC's address is copied into the MAR.

Device-free: students write the answer on mini whiteboards. Image credit: Vishnu Mohanan / Unsplash

Drag each job to the part of the CPU that does it.

ALU

CU

CACHE

MAR





Keeps frequently used data close, so the CPU waits less

Holds the address about to be read or written

Decodes instructions and sends control signals

Adds numbers and compares values

Answers: ALU = adds numbers and compares values. CU = decodes instructions and sends control signals. Cache = keeps frequently used data close, so the CPU waits less. MAR = holds the address about to be read or written.

Ask: which register would hold the data that was read from that address? (MDR.)

Device-free: students match the four descriptions to the four names by drawing lines in their books.

01 · LEARN · THE CYCLE

Fetch, decode, execute… repeat

Fetch the next instruction from memory.

Decode it, so the CPU knows what to do.

Execute it: do the calculation, load or store the data.

Then start again. A modern CPU repeats this billions of times every second.

Say: every program you have ever used, a game, a browser, a calculator app, is just a long list of instructions going through this cycle one after another.

OCR calls it the fetch–execute cycle; many books say fetch–decode–execute. Both are fine in the exam.

Device-free: students write the three words in a circle with arrows. Image credit: Adi Goldstein / Unsplash

01 · LEARN · STEP BY STEP

Follow one instruction through the CPU

CPU

PC

program counter

MAR

memory address register

CU

control unit

MDR

memory data register

ALU

arithmetic logic unit

ACC

accumulator

MEMORY

10 LDA 20

11 ADD 21

..

20 7

21 5

1 FETCH · The address in the PC is copied into the MAR.

2 FETCH · The PC is incremented by 1, ready for the next instruction.

3 FETCH · The instruction at that address goes into the MDR.

4 DECODE · The CU decodes the instruction in the MDR.

5 EXECUTE · The instruction is carried out, e.g. the ALU adds and the result goes into the accumulator.

Click five times. Each click lights up one step on the diagram and adds its sentence.

1 Fetch: the address held in the PC is copied into the MAR. 2 Fetch: the PC is incremented by 1 so it points at the next instruction. 3 Fetch: the instruction stored at the address in the MAR is copied from memory into the MDR. 4 Decode: the CU decodes the instruction in the MDR. 5 Execute: the instruction is carried out. For an ADD, the ALU does the sum and the result goes into the accumulator. Then the cycle starts again.

Some textbooks increment the PC after the instruction reaches the MDR; OCR mark schemes accept either order, as long as the PC is incremented during the fetch.

Device-free: students copy the five steps as a numbered list, with the register names underlined.

01 · LEARN · WORKED EXAMPLE

Trace the registers

▮ TERMINAL // register_trace

PROGRAM  10: LDA 20   11: ADD 21

DATA     20: 7        21: 5

STAGE      PC   MAR  MDR      ACC

start      10   -    -        0

fetch 1    11   10   LDA 20   0

execute 1  11   20   7        7

fetch 2    12   11   ADD 21   7

execute 2  12   21   5        12

LDA 20 = load the value at address 20 into the accumulator.

ADD 21 = add the value at address 21 to the accumulator.

Watch the MAR: in a fetch it holds an instruction's address; in an execute it holds a data address.

A made-up mini instruction set, just for tracing. Click four times; each click adds one row. Before each click ask the class to predict the row.

Fetch 1: the PC (10) is copied into the MAR, so MAR = 10. The PC is incremented to 11. The instruction at address 10, LDA 20, is copied into the MDR. Execute 1: LDA 20 needs the data at address 20, so MAR = 20, the MDR receives 7 and the accumulator is loaded with 7. Fetch 2: MAR = 11 (from the PC), PC becomes 12, MDR = ADD 21. Execute 2: MAR = 21, MDR = 5, the ALU adds 7 + 5 and the accumulator becomes 12.

Check: 7 + 5 = 12. The PC always points one instruction ahead.

Device-free: draw the trace table on the board and fill it in together.

1

The instruction is executed

2

The CU decodes the instruction

3

The PC is incremented by 1

4

The address in the PC is copied into the MAR

5

The instruction is copied from memory into the MDR

Put the steps of the fetch–execute cycle in order.

Correct order: 1 the address in the PC is copied into the MAR; 2 the PC is incremented by 1; 3 the instruction is copied from memory into the MDR; 4 the CU decodes the instruction; 5 the instruction is executed.

Steps 2 and 3 are accepted either way round by OCR mark schemes; this order matches the diagram used today.

Device-free: students write the steps on five sticky notes and order them on the desk.

03 · DEBUG · SPOT THE MISTAKES

Kofi's answer has two mistakes

▮ TERMINAL // kofi_answer.txt

1  The PC holds the address of the next instruction.

2  That address is copied into the MDR.

3  The PC is incremented by 1.

4  The instruction is fetched into the MDR.

5  The ALU decodes the instruction.

Find both mistakes first. Then tap each marker to check.

Exam tip: name the register precisely. "It goes to a register" earns nothing.

Give a minute in pairs, then tap the markers.

Mistake 1 (line 2): the address from the PC is copied into the MAR, not the MDR. Mistake 2 (line 5): the CU decodes the instruction, not the ALU.

Lines 1, 3 and 4 are correct.

Device-free: read the five lines aloud; students write the numbers of the wrong lines and the corrections.

Complete the summary.

Von Neumann architecture stores data and instructions in the same memory. The PC holds the address of the next instruction. The MAR holds the address being read from or written to. The MDR holds the data or instruction that was fetched. Results from the ALU are stored in the accumulator.

memory
PC
MAR
MDR
ALU
accumulator
cache
CU

Answers in order: memory, PC, MAR, MDR, ALU, accumulator. Distractors: cache and CU.

If students choose cache for the first blank: cache is part of the CPU, but the stored program concept is about main memory.

Device-free: write the paragraph on the board with gaps; students fill them in their books.

Exam practice: describe the role of the PC and the MAR in the fetch–execute cycle. [4 marks]

Give six minutes. Remind students: 4 marks means four separate, accurate points.

Mark scheme (1 mark each, max 4): The PC holds the address of the next instruction to be fetched. The address in the PC is copied into the MAR. The PC is incremented (by 1) so it points to the following instruction. The MAR holds the address of the memory location to be read from or written to. The instruction at the address in the MAR is then fetched (into the MDR).

Do not accept: "the PC holds the instruction" or "the MAR holds the data".

Device-free: students answer in their books; model answer on the next slide.

04 · EXAM · MODEL ANSWER

What a 4-mark answer looks like

The PC holds the address of the next instruction to be fetched (1).

At the start of the fetch, this address is copied from the PC into the MAR (1).

The PC is then incremented, so it points to the next instruction (1).

The MAR holds the address of the memory location to be read from, so the instruction there can be fetched into the MDR (1).

Examiner checklist

Says address, not "instruction", for the PC and MAR.

Gives the copy from PC to MAR.

Mentions the PC being incremented.

Uses the full register names at least once.

Click once for the model answer and once for the checklist. Students mark their own answer in a different colour pen, one mark per pink (1).

Common lost marks: saying the PC "holds the next instruction" (it holds its address) and forgetting that the PC is incremented.

Device-free: read the model answer aloud and let students tick matching points.

1

I can explain it to someone else

2

I can describe it with my notes

3

I know the parts but not the steps

4

I need to go over it again

How confident are you with the fetch–execute cycle now?

Exit check. Compare with the opening poll. Students who choose the last two options: point them at the Keep going links and the trace table worked example.

Device-free: thumbs up, sideways or down.

04 · EXAM · KEEP GOING

Keep going

Isaac Computer Science

Free GCSE topic pages and questions. Search for "fetch-execute cycle" and "CPU components".

BBC Bitesize

GCSE Computer Science, OCR: read the systems architecture pages, then try the test.

OCR past papers

J277/01 Computer systems: find the questions on the CPU and check them against the mark scheme.

Next lesson: what makes one CPU faster than another, and the computers hidden inside everyday devices.

Point students to independent practice. Past papers and mark schemes are on the OCR website under J277 assessment materials.

Homework idea: draw the fetch–execute cycle as a five-step comic strip with the registers as characters.

Device-free: write the three resources on the board.