Skip to the page
Year 11 · Computer Science · Spring 2 – Summer 1 · Final revision and the exams

The most-missed questions, whole class

Exam practicePresent ▶

What this lesson covers

3.1 Computer architecture

Cambridge IGCSE Computer Science 0478 · Topic 3: Hardware · Paper 1

2.2 Methods of error detection

Cambridge IGCSE Computer Science 0478 · Topic 2: Data transmission · Paper 1

7.9 Writing and amending algorithms

Cambridge IGCSE Computer Science 0478 · Topic 7: Algorithm design and problem-solving · Paper 2

You will learn to

  • Identify why most pupils lost marks on the five most-missed mock questions.
  • Write a full-mark answer to each question, using the mark-scheme words.
  • Explain the difference between your mock answer and the full-mark answer.

Success criteria

  • I can say what the examiner wanted in each of the five questions.
  • I can rewrite my own mock answer to earn full marks.
  • I can name one habit I will change in the final exam.
The syllabus points for these sections
  • Describe the role of the CPU and what a microprocessor is.
  • Name the parts of the von Neumann architecture: ALU, CU, registers and buses.
  • Describe the fetch–decode–execute cycle, step by step.
  • Explain how cores, cache and clock speed affect performance.
  • Explain what an instruction set is.
  • Describe embedded systems and how they differ from general-purpose computers.
  • Explain why errors happen during transmission.
  • Use odd and even parity, a parity byte and a parity block.
  • Describe checksum and echo check.
  • Calculate and use a check digit, such as ISBN-13.
  • Describe automatic repeat query (ARQ) with acknowledgements and timeouts.
  • Write algorithms precisely, with the exact comparison the problem needs.
  • Amend a given algorithm to do a new job.
  • Plan and answer a 15-mark scenario question.
  • Explain how the scenario question is marked.

Key words

Say each word, then read what it means. Every one is in the glossary too.

CPU
The central processing unit, which processes instructions and data by fetching, decoding and executing them.
Microprocessor
A CPU made as an integrated circuit on a single chip.
Von Neumann architecture
A computer design where instructions and data are stored together in the same memory.
ALU
Arithmetic logic unit: does calculations and logical comparisons.
Control unit
Manages the fetch–decode–execute cycle and sends control signals.
Register
A tiny, very fast store inside the CPU that holds one item.
Bus
A set of parallel wires that carries addresses, data or control signals.
Cache
Small, very fast memory in or near the CPU that holds frequently used data and instructions.
Clock speed
The number of cycles the CPU does each second, measured in hertz.
Core
A complete processing unit; a multi-core CPU can process several instructions at once.
Instruction set
The list of all the instructions a particular CPU can carry out.
Embedded system
A computer system inside a larger device that does one dedicated job.
Sensor
An input device that measures a physical property and sends the reading to a computer.
NIC
Network interface card: the hardware that connects a device to a network.
MAC address
A unique 48-bit address given to a NIC at manufacture, written in hex.
IP address
An address given to a device on a network so data can be sent to it.
Packet
A small piece of data sent across a network, with a header, payload and trailer.
Packet switching
Sending each packet separately, possibly by different routes, then reordering them at the destination.
Interference
Unwanted outside signals that can corrupt data on the way.
Parity bit
An extra bit that makes the number of 1s in a byte odd or even.
Checksum
A value calculated from a block of data, recalculated by the receiver to check for errors.
Echo check
The receiver sends the data back so the sender can compare it with the original.
Check digit
An extra digit calculated from the other digits, used to catch typing errors.
ARQ
Automatic repeat query: acknowledgements and timeouts make the sender re-send data that is wrong or lost.
Algorithm
A precise, ordered set of steps that solves a problem.
Program development life cycle
The four stages of making a program: analysis, design, coding and testing.
Structure diagram
A top-down diagram that shows how a system is split into sub-systems.
Pseudocode
A structured, code-like way of writing an algorithm that is not tied to one language.
Totalling
Adding values into a running total, for example Total ← Total + Value.
Counting
Adding 1 to a counter each time something happens.
Bubble sort
Sorting by comparing neighbouring items and swapping them if they are in the wrong order, pass after pass.
Validation
An automatic check that input data is reasonable and follows set rules.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

3.1 Computer architecture

The CPU and the microprocessor

The CPU (central processing unit) is the part of the computer that processes instructions and data. It carries out the instructions of every program.

It does this by fetching an instruction from memory, decoding it, then executing it. Then it repeats, billions of times a second.

A microprocessor is a CPU built as an integrated circuit on a single chip. An integrated circuit is a whole electronic circuit made on one small piece of silicon.

e.g.Example
The chip inside a laptop, a phone or a games console is a microprocessor. A microprocessor also sits inside a microwave oven, running its timer.

Von Neumann architecture

Most computers follow the von Neumann architecture. Its key idea is the stored program: instructions and data are both stored in the same main memory.

The CPU has a control unit (CU). The CU manages the fetch–decode–execute cycle. It decodes instructions and sends control signals to the other parts.

The CPU has an arithmetic logic unit (ALU). The ALU does calculations (such as add and subtract) and logic operations (such as comparing two numbers).

The CPU also has registers: very small, very fast stores inside the CPU. The CPU is joined to memory by three buses (sets of wires).

?Why?

Keeping instructions and data in one memory means the computer can run any program you load. Change the program in memory and the same hardware does a new job.

There is a diagram for this step in the IGCSE library.

The five registers

A register holds one item at a time: an address, an instruction or a piece of data.

An address is the number of a location in memory, like a locker number in a school corridor.

RegisterFull nameWhat it holds
PCProgram counterThe address of the next instruction to be fetched
MARMemory address registerThe address of the memory location about to be read from or written to
MDRMemory data registerThe data or instruction that has been fetched from memory, or about to be written to memory
CIRCurrent instruction registerThe instruction that is being decoded and executed right now
ACCAccumulatorThe result of calculations done by the ALU
!Watch out

PC and MAR hold addresses. MDR and CIR hold instructions or data. Mixing these up is the most common error in FDE answers.

The three buses

The address bus carries addresses from the CPU (the MAR) to memory. It is one-way (unidirectional), because only the CPU chooses addresses.

The data bus carries data and instructions between the CPU (the MDR) and memory. It is two-way (bidirectional), because data is both read and written.

The control bus carries control signals from the control unit, such as 'read', 'write' and the clock signal. It is two-way, because devices also send signals back.

!Watch out

Exam answers often say 'the address bus carries data'. It carries addresses only. Data and instructions travel on the data bus.

The fetch–decode–execute cycle

Every instruction goes through the same three stages. Learn the fetch stage in order: it is worth most marks.

Fetch: the address in the PC is copied to the MAR, using the address bus. The PC is incremented (1 is added), so it points to the next instruction. The instruction at that address is sent along the data bus to the MDR. It is then copied from the MDR to the CIR.

Decode: the control unit decodes the instruction in the CIR. It works out what the instruction means and what needs to happen.

Execute: the instruction is carried out. The control unit sends signals on the control bus. If there is a calculation, the ALU does it and the result goes in the ACC. Then the cycle starts again.

e.g.Example
PC = 100. The instruction at address 100 is LOAD 105 (put the value at address 105 into the ACC). Fetch: 100 is copied from PC to MAR → PC becomes 101 → LOAD 105 travels from address 100 to the MDR → copied to the CIR. Decode: the CU sees 'load the value at address 105'. Execute: 105 goes into the MAR → the value at 105 (say 7) comes back on the data bus to the MDR → it is copied to the ACC. ACC = 7. Try it in the toy: its tiny program starts at address 0 (LOAD 5, ADD 6, STORE 7, HALT). Press Step and watch each register change. Notice when the PC goes up by 1.
?Why?

The PC is incremented during fetch, so the CPU always knows where the next instruction is, even while it is busy with the current one.

There is something to try for this step in the IGCSE library.

The instruction set

An instruction set is the list of all the instructions (commands) that a particular CPU can understand and carry out.

Each instruction is a binary code, called machine code. Examples are load, add, store, compare and jump.

The CU decodes instructions using this set. Different CPU families have different instruction sets.

e.g.Example
Most laptops use x86 processors. Most phones use ARM processors. A program compiled for one will not run directly on the other, because their instruction sets are different.

Cores, cache and clock speed

Clock speed is the number of fetch–decode–execute cycles the CPU can do per second, measured in hertz (Hz). A 3.5 GHz CPU has 3,500,000,000 clock ticks per second. Higher clock speed means more instructions per second.

Cache is a small amount of very fast memory inside or next to the CPU. It stores instructions and data that are used often, so the CPU does not have to wait for slower RAM. More cache means fewer slow trips to RAM.

A core is a complete processing unit (with its own ALU, CU and registers). A quad-core CPU has four cores, so it can process four instructions at the same time.

?Why?

All three let the CPU get through more instructions in a given time. That is what 'better performance' means.

!Watch out

Doubling the cores does not double the speed. Cores must communicate with each other, and some programs cannot be split into parts. Raising clock speed also makes the CPU hotter, and cache is expensive, so there are limits.

Embedded systems

An embedded system is a small computer system built inside a larger device, to do one dedicated job.

It uses a microprocessor (or a microcontroller) and usually runs one fixed program stored in ROM.

A general-purpose computer, like a laptop, can run many different programs and do many jobs.

Embedded system examplesWhat it controls
Washing machineWater level, temperature, drum speed for each wash programme
Microwave ovenTimer and power level
Central heatingTurns the boiler on and off using a temperature sensor
Car engine managementFuel and air mix, using many sensors
Traffic lightsThe light sequence and timing
?Why?

Embedded systems are small, cheap to mass-produce and use very little power, because they only do one job. The drawbacks: they are hard to update or change, and they can only do the task they were built for.

2.2 Methods of error detection

Why errors happen

Bits travel as electrical pulses, light or radio waves. These can be disturbed on the way.

Interference is unwanted signal from outside, such as from a motor, a microwave oven or lightning.

Because of interference, data can suffer data loss (bits go missing), data gain (extra bits appear) or data change (a 1 becomes a 0, or a 0 becomes a 1).

?Why?

One wrong bit can change a whole number. If 01000001 (65) becomes 01000011 (67), a bank amount or a letter changes. So the receiver must be able to spot errors.

Parity check: odd and even

A parity check adds one extra bit, the parity bit, to each byte. Usually it is the leftmost bit.

In even parity, the total number of 1s in the byte must be even. In odd parity, the total must be odd.

The sender and receiver agree the type first. The receiver counts the 1s. If the count is wrong, there is an error.

e.g.Example
Data bits (7): 1011001. Count the 1s: 1+0+1+1+0+0+1 = 4. Even parity: 4 is already even, so the parity bit is 0 → 01011001 Odd parity: 4 is even, so the parity bit is 1 to make 5 → 11011001 Try it in the toy: choose Even parity, then press Send with noise (1 bit flips). The count becomes odd and the error is found. Then try Send with 2 bits flipped.
!Watch out

Parity cannot find an error if two bits flip. The count changes by 2, so it stays even (or odd). It also cannot say which bit is wrong.

There is something to try for this step in the IGCSE library.

Parity byte and parity block

To find which bit is wrong, we send a block of bytes, each with its own parity bit.

Then we add a parity byte at the end. Each bit of the parity byte gives parity for one column.

If one bit flips, one row fails and one column fails. The wrong bit is where they cross, so the receiver can even correct it.

e.g.Example
Even parity. Four bytes, parity bit first: Byte 1: 0 1 0 1 1 0 0 1 Byte 2: 0 1 1 0 0 0 1 1 Byte 3: 1 0 1 1 0 1 0 0 Byte 4: 0 1 0 0 1 1 1 0 Parity byte: 1 1 0 0 0 0 0 0 (each column now has an even number of 1s) Now bit 5 of byte 3 flips from 0 to 1: byte 3 becomes 1 0 1 1 1 1 0 0. Row check: byte 3 has five 1s (odd) → error in row 3. Column check: column 5 has three 1s (odd) → error in column 5. The error is at row 3, column 5. Flip it back.
?Why?

Rows and columns work like grid references on a map. One wrong row plus one wrong column points to a single square.

Checksum

A checksum is a value calculated from all the data in a block, using an agreed method.

The sender calculates the checksum and sends it with the data.

The receiver calculates the checksum again from the data it received. If the two values match, the data is probably correct. If not, it asks for the data again.

e.g.Example
One simple method: add the byte values, and keep the remainder after dividing by 256 (so it fits in one byte). Data bytes: 150, 200, 75, 30 Total: 150 + 200 + 75 + 30 = 455 455 ÷ 256 = 1 remainder 199 → checksum = 199 If 75 arrives as 77, the receiver gets 457 → remainder 201. 201 ≠ 199, so there is an error.
!Watch out

Cambridge does not ask for one exact checksum method. In the exam, describe the process: calculate at the sender, send, recalculate at the receiver, compare.

Echo check

In an echo check, the receiver sends a copy of the data straight back to the sender.

The sender compares the copy with the original. If they are the same, the data arrived correctly. If not, the sender sends it again.

!Watch out

An echo check doubles the traffic. Also, if the copies differ, you cannot tell if the error happened on the way there or on the way back.

Check digits

A check digit is an extra digit added to the end of a number, such as an ISBN (book number) or a supermarket barcode.

It is calculated from the other digits. It catches data entry errors: a digit typed wrongly, or two digits swapped (transposed).

This is different from parity and checksums. Those catch errors in transmission; a check digit catches human errors when a number is typed or scanned.

e.g.Example
ISBN-13 for the first 12 digits 978030640615: Step 1: multiply digits by 1, 3, 1, 3, … in turn 9×1=9, 7×3=21, 8×1=8, 0×3=0, 3×1=3, 0×3=0, 6×1=6, 4×3=12, 0×1=0, 6×3=18, 1×1=1, 5×3=15 Step 2: add them: 9+21+8+0+3+0+6+12+0+18+1+15 = 93 Step 3: 93 MOD 10 = 3 Step 4: 10 − 3 = 7 → check digit is 7. Full ISBN: 9780306406157 Check: weighted total of all 13 digits = 93 + 7 = 100, and 100 MOD 10 = 0, so it is valid. Try it in the toy: the first 12 digits above are already filled in. Under Check a full ISBN-13, press Make a typo or change one digit yourself, and see the check fail.
?Why?

The weights 1 and 3 mean that swapping two neighbouring digits usually changes the total. So swaps are caught as well as wrong digits.

!Watch out

If the remainder in step 3 is 0, the check digit is 0, not 10. That is why the rule is (10 − remainder) MOD 10.

There is something to try for this step in the IGCSE library.

Automatic repeat query (ARQ)

ARQ uses an error check (such as a checksum) plus messages back to the sender.

If the data arrives correctly, the receiver sends a positive acknowledgement. If it finds an error, it sends a negative acknowledgement and the sender sends the data again.

The sender also starts a timeout: a set time to wait. If no acknowledgement arrives before the time runs out, the sender re-sends the data automatically.

e.g.Example
Packet 7 is sent. The sender starts a 2-second timer. Case A: packet arrives fine → receiver sends a positive acknowledgement → sender sends packet 8. Case B: checksum fails → receiver sends a negative acknowledgement → sender re-sends packet 7. Case C: packet is lost → nothing comes back → after 2 seconds the timeout ends → sender re-sends packet 7.
?Why?

The timeout handles the case where the data, or the acknowledgement, is lost completely. Without it, the sender would wait forever.

7.9 Writing and amending algorithms

Be precise, and amend with care

An algorithm must say exactly what to do. 'More than 50' is `> 50`. '50 or more' is `>= 50`. These give different results for 50.

Set every total, counter, highest and lowest to a start value before the loop. Use meaningful names like `PassCount`, not `x`, and `//` comments.

An amend question asks you to change a given algorithm. Find the line that controls the behaviour and change only that line.

Example: to make the bubble sort give descending order (largest first), change `>` to `<` in the comparison.

Words in the questionPseudocode
over 18 / more than 18`Age > 18`
18 or over / at least 18`Age >= 18`
under 18 / less than 18`Age < 18`
between 1 and 21 inclusive`Days >= 1 AND Days <= 21`
not equal to -1`Value <> -1`
e.g.Example
7, 3, 9, 2, 5 sorted with the amended line: Output: 9, 7, 5, 3, 2
// Original: sorts into ascending order (smallest first)
IF Numbers[Index] > Numbers[Index + 1]

// Amended: sorts into descending order (largest first)
IF Numbers[Index] < Numbers[Index + 1]
numbers = [7, 3, 9, 2, 5]
top = 5
swap = True
while swap == True and top > 1:
    swap = False
    for index in range(top - 1):
        # amended: < instead of > gives descending order
        if numbers[index] < numbers[index + 1]:
            temp = numbers[index]
            numbers[index] = numbers[index + 1]
            numbers[index + 1] = temp
            swap = True
    top = top - 1
print(numbers)
?Why?

Rewriting the whole algorithm wastes time and can add new errors. The examiner is looking for the one or two key changes.

!Watch out

`Days >= 1 AND <= 21` is wrong. Write the variable on both sides: `Days >= 1 AND Days <= 21`.

The 15-mark scenario question: plan first

The last question on Paper 2 is a scenario worth 15 marks. Allow about 30 minutes. You may answer in pseudocode, Python, Visual Basic or Java.

Read the scenario twice. Underline every task. Make a numbered checklist and tick each item as you code it.

Sample scenario: a teacher records three tests for each of 30 students. Each test is out of 50. Names are already in `StudentName[1:30]`.

e.g.Example
Tasks in the sample scenario: 1. Input three marks per student and store them in StudentMark[1:30, 1:3]. 2. Validate each mark: 0 to 50. 3. Calculate and store each student's total in StudentTotal[1:30]. 4. Calculate each student's average, rounded to 1 decimal place. 5. Output each name with total and average. 6. Count and output the students with a total of 120 or more (a merit). 7. Output the class average total and the name of the student with the highest total. All inputs and outputs need suitable messages.
?Why?

Marks are given for meeting each requirement. A checklist stops you forgetting one, which is the most common way to lose marks here.

Model answer in pseudocode and Python

The model answer uses two nested `FOR` loops: one for students, one for tests. It reuses validation, totalling, counting, maximum and average.

Read the comments. They say what each part does, which also earns marks.

Python lists start at index 0, so the Python loops use `range(30)` and `range(3)`.

The first Python line is a stand-in for the names, so the program can run. In the exam you do not write it, because the names are already stored.

e.g.Example
If one student scores 45, 40 and 38: Total = 45 + 40 + 38 = 123. Average = 123 ÷ 3 = 41.0 123 >= 120, so MeritCount goes up by 1. If 123 is more than TopTotal, TopTotal becomes 123 and TopStudent becomes this student's index. Python sample run: Enter mark for test 1 for Student 1: 55 Error: a mark must be from 0 to 50. Enter it again: 31
// StudentName[1:30] already holds the 30 names
DECLARE StudentName : ARRAY[1:30] OF STRING
DECLARE StudentMark : ARRAY[1:30, 1:3] OF INTEGER
DECLARE StudentTotal : ARRAY[1:30] OF INTEGER
DECLARE Student : INTEGER
DECLARE Test : INTEGER
DECLARE Mark : INTEGER
DECLARE Total : INTEGER
DECLARE Average : REAL
DECLARE ClassTotal : INTEGER
DECLARE MeritCount : INTEGER
DECLARE TopTotal : INTEGER
DECLARE TopStudent : INTEGER

// set the class totals and counters to their start values
ClassTotal ← 0
MeritCount ← 0
TopTotal ← -1
TopStudent ← 1

FOR Student ← 1 TO 30
  Total ← 0
  FOR Test ← 1 TO 3
    // input one mark and validate it with a range check (0 to 50)
    OUTPUT "Enter mark for test ", Test, " for ", StudentName[Student]
    INPUT Mark
    WHILE Mark < 0 OR Mark > 50 DO
      OUTPUT "Error: a mark must be from 0 to 50. Enter it again"
      INPUT Mark
    ENDWHILE
    // store the valid mark and add it to this student's total
    StudentMark[Student, Test] ← Mark
    Total ← Total + Mark
  NEXT Test
  // store the total, work out the average and output the results
  StudentTotal[Student] ← Total
  Average ← ROUND(Total / 3, 1)
  OUTPUT StudentName[Student], " Total: ", Total, " Average: ", Average
  ClassTotal ← ClassTotal + Total
  // a total of 120 or more earns a merit
  IF Total >= 120
    THEN
      MeritCount ← MeritCount + 1
  ENDIF
  // remember the highest total so far and whose it is
  IF Total > TopTotal
    THEN
      TopTotal ← Total
      TopStudent ← Student
  ENDIF
NEXT Student

// whole-class results
OUTPUT "Class average total: ", ROUND(ClassTotal / 30, 1)
OUTPUT "Number of merits: ", MeritCount
OUTPUT "Highest total: ", StudentName[TopStudent], " with ", TopTotal
# The question says the names are already stored.
# This line is a stand-in so the program can run.
student_name = ["Student " + str(n) for n in range(1, 31)]
student_mark = [[0, 0, 0] for row in range(30)]
student_total = [0] * 30

# set the class totals and counters to their start values
class_total = 0
merit_count = 0
top_total = -1
top_student = 0

for student in range(30):
    total = 0
    for test in range(3):
        # input one mark and validate it with a range check (0 to 50)
        mark = int(input("Enter mark for test " + str(test + 1) + " for " + student_name[student] + ": "))
        while mark < 0 or mark > 50:
            mark = int(input("Error: a mark must be from 0 to 50. Enter it again: "))
        # store the valid mark and add it to this student's total
        student_mark[student][test] = mark
        total = total + mark
    # store the total, work out the average and output the results
    student_total[student] = total
    average = round(total / 3, 1)
    print(student_name[student], "Total:", total, "Average:", average)
    class_total = class_total + total
    # a total of 120 or more earns a merit
    if total >= 120:
        merit_count = merit_count + 1
    # remember the highest total so far and whose it is
    if total > top_total:
        top_total = total
        top_student = student

# whole-class results
print("Class average total:", round(class_total / 30, 1))
print("Number of merits:", merit_count)
print("Highest total:", student_name[top_student], "with", top_total)
?Why?

The Python version was run with 90 test marks, including invalid ones, to check it works. In Python, `round(total / 3, 1)` keeps one decimal place; `//` would cut off the decimals.

!Watch out

Store values in the arrays the question names. Calculating the total but not storing it in StudentTotal loses marks.

How the 15 marks are awarded

Recent mark schemes use levels, not one mark per line. AO2 (applying techniques and data structures) gives up to 9 marks. AO3 (comments, identifiers, logic and accuracy) gives up to 6 marks.

The examiner reads the whole answer and picks the band that fits best. Minor syntax errors are ignored if the logic is clear.

BandAO2: techniques and data structures (9)AO3: comments, names, accuracy (6)
Top7–9: all tasks covered with the right techniques; arrays store all the data5–6: fully commented, meaningful names, logical and accurate, meets all requirements
Middle4–6: some techniques suit the problem; some data stored correctly3–4: some comments, most names sensible, most requirements attempted
Low1–3: at least one technique used; some data stored, not well1–2: no useful comments, some sensible names, at least one requirement attempted
e.g.Example
The model answer reaches the top bands because it: - inputs with messages and validates every mark (input, iteration, selection) - stores marks in the 2D array and totals in StudentTotal (data structures) - uses totalling, counting, maximum, average and ROUND - outputs every result with a message - has a comment for every section and meaningful names like MeritCount
?Why?

Because marks come in bands, a working answer to every task beats a perfect answer to half of them. Attempt every requirement, even if one part is rough.

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.