Computer Science Notes (3.1-3.6)

Topic 3.1 — Fundamentals of algorithms

1. What is an algorithm?

Algorithm: A finite, ordered sequence of instructions designed to solve a problem or complete a task.

Algorithms describe the logic of a solution before, or independently of, the programming language used to implement it.

For example, an algorithm for calculating the average of three numbers would:

  1. Input three numbers.

  2. Add the numbers together.

  3. Divide the total by three.

  4. Output the average.

Key characteristics of an algorithm:

  • It has a clear purpose.

  • Its instructions are unambiguous.

  • It follows a logical order.

  • It should terminate rather than continue indefinitely.

  • It should produce the required output for valid inputs.

2. Computational thinking

Computational thinking involves approaching problems in a way that allows them to be solved using computational methods.

Decomposition

Definition: Breaking a complex problem into smaller, more manageable sub-problems.

Example: Designing a school management system could be decomposed into:

  • Student registration.

  • Attendance recording.

  • Timetable management.

  • Report generation.

Advantages:

  • Each part is easier to understand.

  • Different parts can be developed and tested separately.

  • Errors are easier to locate.

  • Complex problems become more manageable.

Abstraction

Definition: Removing unnecessary details and concentrating on the information relevant to solving a problem.

Example: A school timetable needs lesson times, rooms and subjects, but it does not need to include the colour of every classroom wall.

Advantages:

  • Reduces complexity.

  • Makes the problem easier to understand.

  • Helps identify the essential information.

  • Allows a general solution to be developed.

Exam distinction: Decomposition breaks a problem into smaller parts; abstraction removes irrelevant details.

Algorithmic thinking

Definition: Developing a logical sequence of steps to solve a problem.

It involves:

  • Identifying the inputs.

  • Identifying the required outputs.

  • Determining the processing needed.

  • Selecting suitable data structures.

  • Using sequence, selection and iteration.

  • Considering unusual or invalid inputs.


3. Representing algorithms

Algorithms can be represented using pseudocode or flowcharts.

Pseudocode

Definition: A language-independent way of describing an algorithm using structured, programming-like instructions.

Pseudocode allows the logic of a solution to be planned without committing to a particular programming language.

Example:

INPUT number

result ← number * 2

OUTPUT result

If the input is 6, the output is 12.

The arrow ← represents assignment: the value on the right is stored in the variable on the left.

Flowcharts

Definition: Diagrams that represent an algorithm using standard symbols connected by arrows.

Symbol

Meaning

Purpose

Oval

Start/end

Shows where the algorithm begins or finishes

Rectangle

Process

Represents a calculation or instruction

Parallelogram

Input/output

Represents receiving or displaying data

Diamond

Decision

Represents a condition with different possible outcomes

Arrow

Flow line

Shows the direction of execution

A decision diamond should have labelled branches, commonly Yes and No.

Advantages of flowcharts:

  • They make the order of instructions visible.

  • Decisions and loops are easy to identify.

  • They can help explain an algorithm to other people.

Disadvantages:

  • Large algorithms can become complicated diagrams.

  • Changes may require several parts of the diagram to be redrawn.

  • They can take longer to create than short pseudocode.


4. The three basic programming constructs

Algorithms are built using three fundamental constructs.

Sequence

Definition: Instructions are executed in a specific order, one after another.

INPUT price

INPUT quantity

total ← price * quantity

OUTPUT total

The inputs must be obtained before the total can be calculated.

Selection

Definition: A condition determines which instruction or group of instructions is executed.

Example:

INPUT mark

IF mark >= 50 THEN

    OUTPUT "Pass"

ELSE

    OUTPUT "Fail"

ENDIF

If the mark is 65, the program outputs Pass.

If the mark is 42, it outputs Fail.

Important: The condition mark >= 50 includes 50 itself.

Selection can use:

  • IF

  • IF ... ELSE

  • ELSEIF

  • CASE or SWITCH, depending on the language.

Iteration

Definition: Repeating a set of instructions.

There are three common forms of iteration.

FOR loop — count-controlled iteration

Used when the number of repetitions is known.

FOR count ← 1 TO 5

    OUTPUT count

ENDFOR 

Output:

1

2

3

4

5

WHILE loop — condition-controlled iteration

The condition is checked before the loop body executes.

count ← 1

WHILE count <= 5

    OUTPUT count

    count ← count + 1

ENDWHILE

A WHILE loop might execute zero times if its condition is initially false.

REPEAT … UNTIL loop

The loop body executes before the stopping condition is checked.

count ← 1

REPEAT

    OUTPUT count

    count ← count + 1

UNTIL count > 5

This outputs the numbers 1 to 5.

A REPEAT ... UNTIL loop normally executes at least once.

Common exam mistake: In WHILE, the loop continues while the condition is true. In REPEAT ... UNTIL, the loop stops when the condition becomes true.


5. Variables and constants

Variable: A named storage location whose value can change while a program runs.

Example:

score ← 10

score ← 15

The final value of score is 15.

Constant: A named value that is intended to remain unchanged during program execution.

Example:

VAT_RATE ← 0.20

If the VAT rate is fixed for the calculation, using a constant avoids repeating the value throughout the program.

Identifier: The name given to a variable, constant, procedure or function.

Good identifiers describe their purpose.

Better: totalPrice

Less clear: x


6. Arithmetic and comparison operators

Arithmetic operators

Operator

Meaning

Example

Result

+

Addition

8 + 3

11

-

Subtraction

8 - 3

5

*

Multiplication

8 * 3

24

/

Division

8 / 2

4

DIV

Integer division

17 DIV 5

3

MOD

Remainder

17 MOD 5

2

DIV returns the whole-number quotient, while MOD returns the remainder.

For example:

17 = (3 * 5) + 2

Therefore:

17 DIV 5 = 3

17 MOD 5 = 2

Comparison operators

Operator

Meaning

= or ==

Equal to, depending on the language

!= or <>

Not equal to

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

Comparison operators normally produce a Boolean result: TRUE or FALSE.

Example:

10 >= 10

Result: TRUE.

Boolean operators

Operator

Meaning

AND

True only when both conditions are true

OR

True when at least one condition is true

NOT

Reverses a Boolean value

Truth table:

A

B

A AND B

A OR B

False

False

False

False

False

True

False

True

True

False

False

True

True

True

True

True

Example:

IF age >= 16 AND hasPermission = TRUE THEN

    OUTPUT "Allowed"

ENDIF

Both conditions must be true for the message to be displayed.


7. Searching algorithms

Searching algorithms find a particular item in a collection of data.

Linear search

Definition: An algorithm that checks items individually, starting at one end of a list, until the target is found or all items have been checked.

Example list:

[12, 7, 19, 4, 15]

Search for 4.

  1. Check 12 — not found.

  2. Check 7 — not found.

  3. Check 19 — not found.

  4. Check 4 — found.

Advantages:

  • Simple to implement.

  • Works on sorted and unsorted lists.

  • Does not require preprocessing the data.

Disadvantages:

  • Can be slow for large lists.

  • May need to check every item.

Worst-case time complexity: O(n).

This means the amount of work grows approximately in proportion to the number of items.

Binary search

Definition: A searching algorithm that repeatedly compares the target with the middle item of a sorted list and discards half of the remaining search area.

Essential requirement: The list must be sorted.

Example:

[2, 5, 8, 12, 16, 23, 38]

Search for 16.

  1. The middle item is 12.

  2. Since 16 is greater than 12, discard the lower half.

  3. Search the remaining items: [16, 23, 38].

  4. The middle item is 23.

  5. Since 16 is smaller than 23, search the lower part.

  6. Find 16.

Advantages:

  • Very efficient for large, sorted lists.

  • Eliminates approximately half the remaining items each step.

Disadvantages:

  • Requires sorted data.

  • Sorting the data may itself take time.

  • The algorithm is more complex than linear search.

Worst-case time complexity: O(log n).

This grows much more slowly than O(n) as the list becomes large.

Linear search versus binary search

Feature

Linear search

Binary search

Requires sorted data?

No

Yes

Method

Checks items individually

Repeatedly halves the search area

Complexity

O(n)

O(log n)

Best suited to

Small or unsorted lists

Large, sorted lists

8. Sorting algorithms

Sorting arranges data into a particular order, such as ascending numerical order.

Bubble sort

Definition: A sorting algorithm that repeatedly compares adjacent items and swaps them if they are in the wrong order.

Example:

[5, 2, 4]

First pass:

  • Compare 5 and 2; swap: [2, 5, 4].

  • Compare 5 and 4; swap: [2, 4, 5].

The list is now sorted.

Advantages:

  • Easy to understand.

  • Relatively simple to implement.

Disadvantages:

  • Inefficient for large lists.

  • May require many comparisons and swaps.

Typical worst-case time complexity: O(n²).

Merge sort

Definition: A sorting algorithm that repeatedly divides a list into smaller sections, sorts them and merges them back together in order.

Example:

[8, 3, 6, 2]

Split:

[8, 3]   [6, 2]

Split further:

[8] [3] [6] [2]

Merge in sorted order:

[3, 8]   [2, 6]

Final merge:

[2, 3, 6, 8]

Advantages:

  • Efficient for large lists.

  • Predictable O(n log n) time complexity.

Disadvantages:

  • More complex than bubble sort.

  • Usually requires additional memory when merging.

Sorting comparison

Feature

Bubble sort

Merge sort

Method

Repeated adjacent swaps

Divide, sort and merge

Typical worst-case complexity

O(n²)

O(n log n)

Complexity of implementation

Simpler

More complex

Large datasets

Generally inefficient

Generally efficient

9. Algorithm efficiency

Time complexity: A measure of how the number of operations required by an algorithm grows as the input size increases.

Space complexity: A measure of how the memory required by an algorithm grows as the input size increases.

Common Big-O classifications:

Complexity

Meaning

Example

O(1)

Constant time

Accessing an array element by index

O(log n)

Logarithmic growth

Binary search

O(n)

Linear growth

Linear search

O(n log n)

Efficient divide-and-conquer growth

Merge sort

O(n²)

Quadratic growth

Typical bubble sort

For Grade 9, remember that the best algorithm depends on the problem and the conditions.

For example, binary search is efficient for a large sorted list, but linear search may be more appropriate for a small unsorted list.


10. Trace tables and testing algorithms

Trace table: A table that records the values of variables as an algorithm executes.

Example:

total ← 0

FOR i ← 1 TO 3

    total ← total + i

ENDFOR

Iteration

i

total

Initial

—

0

1

1

1

2

2

3

3

3

6

Final output, if total is output: 6.

Common errors:

  • Forgetting to initialise a variable.

  • Updating a variable in the wrong place.

  • Incorrect loop boundaries.

  • Using the wrong comparison operator.

  • Creating an infinite loop by failing to update the condition.

Test data categories:

  • Normal data: Typical valid input.

  • Boundary data: Values at or near the limits of the valid range.

  • Invalid data: Input that should be rejected.

For example, if valid marks are 0–100:

  • Normal: 65.

  • Boundary: 0 and 100.

  • Invalid: -1 and 101.


Topic 3.2 — Programming

1. Programming language concepts

Program: A set of instructions written in a programming language that a computer can execute.

Programming language: A formal language used to write instructions for a computer.

Syntax: The rules governing how instructions must be written in a programming language.

Semantics: The meaning of the instructions.

A program can have valid syntax but incorrect logic.

Example:

average ← total * numberOfItems

This may be syntactically valid, but it is logically incorrect if the intention is to calculate an average. The correct calculation would usually divide the total by the number of items.


2. Data types

A data type specifies the kind of value a variable can store and the operations that can be performed on it.

Data type

Definition

Example

Integer

A whole number

-4, 0, 25

Real/float

A number that can have a fractional part

3.14

Boolean

A logical value that is true or false

TRUE

Character

A single character

'A'

String

A sequence of characters

"Computer"

Why data types matter

  • They help determine how data is stored.

  • They influence which operations are valid.

  • They can prevent certain types of error.

  • They make programs easier to understand.

For example, adding two integers usually produces a numerical result. Adding strings may concatenate them, depending on the language.

"Hello" + "World"

In a language that uses + for string concatenation, the result is:

HelloWorld


3. Variables and constants

Variable: A named location used to store data that can change during program execution.

Constant: A named value that should not change during program execution.

Example:

score ← 10

score ← 20

score is a variable because its value changes.

A fixed tax rate could be represented by a constant.

Initialisation: Giving a variable its first value.

counter ← 0

Initialisation is important because using a variable before assigning a value may cause an error or an unpredictable result.


4. Casting and conversion

Type casting: Converting a value from one data type to another.

For example, converting the string "25" to the integer 25.

This matters because user input is often received as text, even when the user types a number.

If the string "25" is not converted to a numerical type, a program may be unable to perform the intended arithmetic correctly.

The exact conversion syntax depends on the programming language.


5. String handling

A string is a sequence of characters.

Common string operations include:

Operation

Meaning

Concatenation

Joining strings together

Length

Finding the number of characters

Substring

Extracting part of a string

Character access

Accessing an individual character

Conversion

Changing a string to another data type where valid

Example:

firstName ← "Alex"

surname ← "Taylor"

fullName ← firstName + " " + surname

The result is:

Alex Taylor

String indexing may begin at 0 or 1 depending on the language.

Always follow the indexing convention used in the question.


6. Arrays

Array: A data structure that stores multiple values of the same general type under one identifier, with each value accessed using an index.

Example:

scores ← [12, 15, 18, 11]

The array stores four values.

An individual element can be accessed using an index:

scores[0]

In a zero-indexed system, this returns 12.

Advantages of arrays

  • Store many related values under one name.

  • Make it easier to process data using loops.

  • Reduce the need to create separate variables.

  • Allow elements to be accessed using an index.

Disadvantages

  • The index must be valid.

  • An incorrect index can cause an error or access the wrong element.

  • Arrays may have a fixed size in some languages.

Traversing an array

Traversal: Visiting each element of a data structure, usually to process or examine it.

Example:

scores ← [12, 15, 18, 11]

FOR i ← 0 TO 3

    OUTPUT scores[i]

ENDFOR

This outputs each score.

Finding a total

total ← 0

FOR i ← 0 TO 3

    total ← total + scores[i]

ENDFOR

OUTPUT total

The total is 56.

Exam tip: Check whether the question uses zero-based or one-based indexing. Do not assume the first index is always 0.


7. Records

Record: A data structure that groups related fields, potentially of different data types, into one unit.

For example, a student record might contain:

  • Student ID: integer.

  • Name: string.

  • Date of birth: string or date type.

  • Average mark: real.

An array generally stores multiple elements of the same type, whereas a record groups different fields belonging to one entity.


8. Subroutines

Subroutine: A named block of code designed to perform a particular task and be called when required.

Subroutines include procedures and functions.

Procedure

Definition: A subroutine that performs a task but does not necessarily return a value to the calling code.

Example:

PROCEDURE showWelcome()

    OUTPUT "Welcome"

ENDPROCEDURE

Calling the procedure executes its instructions.

Function

Definition: A subroutine that returns a value to the part of the program that called it.

Example:

FUNCTION double(number)

    RETURN number * 2

ENDFUNCTION

Calling double(5) returns 10.

Parameters and arguments

Parameter: A named variable in a subroutine definition that receives data.

Argument: The actual value or expression supplied when calling the subroutine.

Example:

FUNCTION double(number)

    RETURN number * 2

ENDFUNCTION

In the call:

double(5)

number is the parameter and 5 is the argument.

Local and global variables

Local variable: A variable accessible only within its relevant local scope, such as a particular function.

Global variable: A variable accessible from multiple parts of a program, depending on the language and scope rules.

Advantages of local variables:

  • Reduce accidental interference between subroutines.

  • Make code easier to test.

  • Improve modularity.

Global variables can be convenient, but excessive use can make programs harder to understand and maintain.

Advantages of subroutines

  • Code reuse.

  • Reduced duplication.

  • Easier testing.

  • Easier debugging.

  • Improved readability.

  • Easier maintenance.

  • Complex programs can be divided into manageable modules.


9. Validation

Validation: Checking whether input data satisfies specified rules or is sensible and acceptable to the program.

Validation does not guarantee that data is factually correct.

For example, a range check may confirm that an entered age is between 0 and 120. It cannot establish whether the person really is that age.

Types of validation

Check

Definition

Example

Range check

Checks that a value falls within specified limits

Mark must be 0–100

Presence check

Checks that a required field is not empty

Name must be entered

Length check

Checks the number of characters

Password must be at least 8 characters

Type check

Checks that data is of the required type

Age must be an integer

Format check

Checks that data follows a required pattern

A code must match a specified format

Lookup check

Checks that a value appears in an approved list

Subject must be one of the available subjects

Range check example

INPUT mark

WHILE mark < 0 OR mark > 100

    OUTPUT "Invalid mark"

    INPUT mark

ENDWHILE

This keeps requesting input while the mark is outside the permitted range.

Important: The exact logic of the condition matters. Using AND instead of OR here would be incorrect because a number cannot simultaneously be below 0 and above 100.


10. Verification

Verification: Checking that data has been copied, entered or transferred accurately.

It checks accuracy of transcription, not whether the data itself is reasonable.

Double-entry verification

Data is entered twice, and the two versions are compared.

If they differ, the system flags the discrepancy.

Advantage: Helps identify typing errors.

Disadvantage: Takes additional time and effort.

Visual checking

A person compares entered data with the original source.

Advantage: Can identify discrepancies.

Disadvantage: A person may overlook an error.

Validation versus verification

Validation

Verification

Checks whether data meets rules

Checks whether data has been copied accurately

Example: age must be 0–120

Example: compare entered age with the original form

Cannot prove data is correct

Cannot prove original data is correct

Both can be used together.


11. Testing

Testing: Executing a program with selected test data to check whether it behaves as expected.

Normal test data

Typical valid input.

Example: A mark of 65 where valid marks are 0–100.

Boundary test data

Values at the limits of the valid range, and sometimes immediately outside those limits.

For marks between 0 and 100:

  1. 0.

  2. 100.

  • -1.

    1. 101.

Invalid test data

Input that should be rejected.

Examples:

  • Entering text when an integer is required.

  • Entering a negative mark.

  • Leaving a mandatory field empty.

Test plans

A test plan may contain:

Test

Input

Expected result

Actual result

Pass/fail

Normal

65

Accepted

Accepted

Pass

Lower boundary

0

Accepted

Accepted

Pass

Upper boundary

100

Accepted

Accepted

Pass

Invalid

101

Rejected

Rejected

Pass

Important: Testing can reveal errors, but successful tests do not prove that a program contains no errors.


12. Errors in programs

Syntax error

Definition: An error caused by breaking the grammatical rules of a programming language.

Example: Missing a closing bracket.

It may prevent a program from compiling or running.

Logic error

Definition: An error in the algorithm or reasoning that causes incorrect results.

Example: Multiplying by the number of items instead of dividing when calculating an average.

The program may still run.

Runtime error

Definition: An error that occurs while a program is executing.

Examples:

  • Attempting to divide by zero.

  • Trying to open a file that does not exist.

  • Attempting an invalid operation on data.

Debugging

Definition: Finding, identifying and correcting errors in a program.

Debugging techniques include:

  • Trace tables.

  • Breakpoints.

  • Stepping through code.

  • Displaying variable values.

  • Testing with carefully selected inputs.


13. Defensive design

Defensive design: Designing software to anticipate unexpected inputs, mistakes and other situations that could cause failure.

Methods include:

  • Input validation.

  • Clear error messages.

  • Checking that files exist before opening them.

  • Preventing invalid operations.

  • Setting sensible initial values.

  • Handling unexpected situations safely.

Example: Before performing a division, check that the divisor is not zero.

This prevents a predictable runtime error.


14. Maintainability

Maintainability: How easily a program can be understood, corrected, modified and improved.

Ways to improve maintainability:

  • Use meaningful identifiers.

  • Use consistent indentation.

  • Divide code into subroutines.

  • Avoid unnecessary repetition.

  • Use comments where they explain complex logic or design decisions.

  • Keep instructions organised and readable.

Comment: An explanatory note in code that helps a programmer understand it. Comments do not normally affect the program’s execution.


15. File handling

Programs may need to store data permanently in files.

Common operations:

  • Open a file.

  • Read data.

  • Write data.

  • Append data.

  • Close the file.

Read: Retrieve data from a file.

Write: Store data in a file, often replacing existing contents depending on the mode used.

Append: Add data to the end of an existing file.

Close: Finish using a file and release the associated resource.

Closing a file is important because it helps ensure that resources are released and buffered data is properly handled.


Topic 3.3 — Fundamentals of data representation

1. Binary, denary and hexadecimal

Binary

Binary: A base-2 number system using only the digits 0 and 1.

Computers use binary because electronic circuits can represent two states, commonly interpreted as off/on or low/high.

Denary

Denary: The base-10 number system used in everyday counting, with digits 0–9.

Hexadecimal

Hexadecimal: A base-16 number system using digits 0–9 and letters A–F.

Hex digit

Denary value

0–9

0–9

A

10

B

11

C

12

D

13

E

14

F

15

Hexadecimal is a compact way to represent binary values.


2. Bits, bytes and units

Bit: A single binary digit, either 0 or 1.

Nibble: Four bits.

Byte: Eight bits.

An 8-bit byte can represent 2^8 = 256 different bit patterns.

For an unsigned 8-bit number, the range is 0–255.

Number of possible patterns

For n bits:

\text{Number of possible patterns}=2^n

Examples:

  • 1 bit: 2^1=2 patterns.

  • 4 bits: 2^4=16 patterns.

  • 8 bits: 2^8=256 patterns.

  • 16 bits: 2^{16}=65,536 patterns.

A bit pattern can represent a number, character, colour or other kind of data depending on the encoding used.


3. Converting binary to denary

Binary place values are powers of 2.

For an 8-bit number:

Place value

128

64

32

16

8

4

2

1

Example:

Convert 00101101 to denary.

Bit

0

0

1

0

1

1

0

1

Place value

128

64

32

16

8

4

2

1

Add the place values where the bit is 1:

32+8+4+1=45

Therefore:

00101101_2=45_{10}

Converting denary to binary

Convert 45 to binary using the place values.

  • 45 contains 32 → write 1; remainder 13.

  • 13 contains 16 → write 0.

  • 13 contains 8 → write 1; remainder 5.

  • 5 contains 4 → write 1; remainder 1.

  • 1 contains 2 → write 0.

  • 1 contains 1 → write 1.

The result is:

45_{10}=00101101_2

Exam tip: Always check that the binary place values you have selected add up to the original denary number.


4. Converting binary and hexadecimal

Each hexadecimal digit represents exactly four binary bits.

Binary

Hexadecimal

0000

0

0001

1

0010

2

0011

3

0100

4

0101

5

0110

6

0111

7

1000

8

1001

9

1010

A

1011

B

1100

C

1101

D

1110

E

1111

F

Example:

Convert 11011010 to hexadecimal.

Split the binary number into groups of four:

1101 1010

Convert each group:

  • 1101 = D.

  • 1010 = A.

Therefore:

11011010_2=DA_{16}

Why hexadecimal is useful

  • It is shorter than binary.

  • It is easier for humans to read.

  • It is useful for representing memory addresses and machine code.

  • It is commonly used for colour codes.


5. Binary addition

Binary addition follows the same basic principles as denary addition, but only uses 0 and 1.

Calculation

Result

0 + 0

0

0 + 1

1

1 + 0

1

1 + 1

10

1 + 1 + 1

11

Example: 

    0011

+ 0010

------

  0101

This is:

3+2=5

Overflow

Overflow: When a calculation produces a value that cannot be represented using the available number of bits.

For example, adding 1 to the maximum unsigned 8-bit value of 255 produces 256, which cannot be represented as an unsigned 8-bit number.

If only eight bits are available, the result cannot be stored correctly without changing the representation or increasing the number of bits.


6. Binary shifts

A logical shift moves bits left or right, filling the vacated positions with zeroes.

Left shift

A left shift by one place generally multiplies an unsigned binary number by 2, provided no significant bit is lost.

Example:

00000101

Value = 5.

Shift left one place:

00001010

Value = 10.

Right shift

A right shift by one place generally divides an unsigned binary number by 2, discarding any remainder.

Example:

00001010

Value = 10.

Shift right one place:

00000101

Value = 5.

Important: Bits shifted out of the available space may be lost, and overflow can affect the result.


7. Character sets: ASCII and Unicode

Character set: A defined collection of characters, each associated with a numerical code.

Computers store text by representing character codes in binary.

ASCII

ASCII: A character encoding traditionally based on 7-bit codes, representing 128 possible values.

It covers basic English letters, digits, punctuation and control characters.

Limitation: Standard ASCII does not provide enough codes to represent all the characters used in every language.

Some extended encodings use eight bits, but these are not all the same character set.

Unicode

Unicode: A character standard designed to represent characters from many languages and writing systems, along with symbols and emoji.

UTF-8 is a common Unicode encoding that uses a variable number of bytes for a character.

Advantages of Unicode:

  • Supports a much wider range of characters.

  • Enables text from different languages to be represented.

  • Supports symbols and emoji.

Storage consideration: UTF-8 characters can require different numbers of bytes, so the storage required depends on the characters being encoded.


8. Bitmap images

Bitmap image: An image represented as a grid of individual pixels.

Pixel: The smallest addressable element of a bitmap image.

Resolution

Resolution: The number of pixels in an image, often expressed as width × height.

Example:

An image with a resolution of 800 × 600 contains:

800\times600=480,000\text{ pixels}

Higher resolution usually allows more detail to be represented.

However, it also increases storage requirements if other properties remain unchanged.

Colour depth

Colour depth: The number of bits used to represent the colour of each pixel.

If the colour depth is n bits, the number of possible colour values is:

2^n

Examples:

  • 1 bit: 2 possible values.

  • 8 bits: 256 possible values.

  • 24 bits: 16,777,216 possible values.

A higher colour depth can represent more colours, but requires more bits per pixel.

Calculating image file size

For an uncompressed bitmap:

\boxed{\text{Size in bits}=\text{width}\times\text{height}\times\text{colour depth}}

Example:

A 100 × 100 image uses 8-bit colour depth.

100\times100\times8=80,000\text{ bits}

Convert to bytes:

80,000\div8=10,000\text{ bytes}

The uncompressed pixel data requires 10,000 bytes.

Actual file size may also include metadata and headers, and compression can reduce it.

What increases image file size?

  • Higher resolution.

  • Greater colour depth.

  • Additional metadata.

  • Less effective compression.

Exam tip: Do not forget to divide by 8 when converting bits into bytes.


9. Digital sound

Analogue sound: Sound represented by a continuously varying wave.

Digital sound: Sound represented using discrete numerical samples.

An analogue-to-digital converter (ADC) samples the analogue signal and converts the measurements into digital values.

Sampling

Sampling: Measuring the amplitude of an analogue signal at regular time intervals.

Sample rate

Sample rate: The number of samples taken each second, measured in hertz (Hz).

A higher sample rate captures changes in the signal more frequently.

Bit depth

Bit depth: The number of bits used to represent each sample.

A higher bit depth allows more possible amplitude values, improving the precision of each sample.

Channels

  • Mono: one audio channel.

  • Stereo: two audio channels.

Stereo can represent differences between the left and right channels.

Calculating sound file size

For uncompressed digital sound:

\boxed{\text{Size in bits}=\text{sample rate}\times\text{bit depth}\times\text{duration}\times\text{channels}}

Example:

A 10-second recording has:

  • Sample rate = 44,000 Hz.

  • Bit depth = 16 bits.

  • Channels = 2.

44,000\times16\times10\times2
=14,080,000\text{ bits}

Convert to bytes:

14,080,000\div8
=1,760,000\text{ bytes}

This excludes headers and compression.

What increases sound file size?

  • Higher sample rate.

  • Greater bit depth.

  • Longer duration.

  • More channels.


10. Compression

Compression: Reducing the amount of data needed to represent a file.

Compression can reduce storage requirements and the time needed to transmit files.

Lossless compression

Definition: Compression that allows the original data to be reconstructed exactly.

Examples of techniques include run-length encoding and dictionary-based methods.

Advantages:

  • No data is permanently lost.

  • The original can be reconstructed exactly.

  • Suitable for files that must remain unchanged.

Disadvantages:

  • Often achieves a smaller reduction than lossy compression for photographs or audio.

Suitable uses include:

  • Text documents.

  • Program files.

  • Data files.

  • Images where exact reconstruction is required.

Lossy compression

Definition: Compression that permanently removes some data to reduce file size.

It is often used for photographs, audio and video.

Advantages:

  • Can produce much smaller files.

  • Reduces storage requirements.

  • Can reduce transmission time.

Disadvantages:

  • Some original information is lost.

  • Repeated compression can reduce quality further.

  • The exact original cannot be reconstructed from the compressed data.

Comparison

Feature

Lossless

Lossy

Data permanently removed?

No

Yes

Exact reconstruction possible?

Yes

No

Typical reduction

Depends on data; often more limited for media

Can be substantial

Suitable for

Text, program files, exact data

Photos, music and video where some loss is acceptable

Topic 3.4 — Computer systems

1. The CPU

Central Processing Unit (CPU): The component that executes program instructions and processes data.

The CPU includes several important components.

Control Unit (CU)

Definition: The component that coordinates CPU operations and controls the execution of instructions.

It decodes instructions and sends control signals to other components.

Arithmetic Logic Unit (ALU)

Definition: The component that performs arithmetic calculations and logical operations.

Examples:

  • Addition.

  • Subtraction.

  • Comparisons.

  • Boolean operations.

Registers

Register: A small, very fast storage location inside the CPU used to hold instructions, addresses or data during processing.

Important registers include:

Register

Definition

Program Counter (PC)

Stores the address of the next instruction to be fetched

Memory Address Register (MAR)

Stores the address of the memory location being accessed

Memory Data Register (MDR)

Stores data or an instruction being transferred to or from memory

Current Instruction Register (CIR)

Holds the current instruction while it is decoded and executed

Accumulator (ACC)

Stores intermediate results of calculations and ALU operations

Cache

Cache: Small, fast memory that stores frequently or recently used data and instructions so the CPU can access them more quickly than from RAM.

Cache reduces the time spent waiting for data to arrive from main memory.

Generally, cache is faster and smaller than RAM.


2. The fetch–decode–execute cycle

Fetch–decode–execute cycle: The repeated process through which the CPU retrieves instructions, interprets them and carries them out.

Fetch

  1. The Program Counter contains the address of the next instruction.

  2. That address is copied to the Memory Address Register.

  3. The instruction at that memory address is retrieved.

  4. The instruction is transferred through the Memory Data Register.

  5. The instruction is copied into the Current Instruction Register.

  6. The Program Counter is updated to point to the next instruction, unless execution changes the flow.

Decode

The Control Unit interprets the instruction to determine what operation is required.

It identifies the relevant operation and any necessary data or addresses.

Execute

The instruction is carried out.

For example:

  • The ALU performs a calculation.

  • A value is transferred between registers.

  • Data is read from or written to memory.

  • A conditional instruction changes which instruction will be executed next.

Exam tip: Learn the order of the cycle and the function of each register separately.


3. Factors affecting CPU performance

Clock speed

Clock speed: The number of clock cycles the CPU performs per second, measured in hertz.

A CPU running at a higher clock speed may complete more processing cycles per second.

However, clock speed alone does not determine performance because instructions can require different numbers of cycles, and CPUs may have different architectures.

Number of cores

Core: An individual processing unit within a CPU.

A multi-core CPU can execute tasks in parallel where the software and workload allow it.

More cores can improve multitasking and performance for suitable applications.

However, some programs cannot effectively use all available cores.

Cache size

A larger cache may allow more frequently used data and instructions to be stored close to the CPU.

This can reduce slower accesses to RAM.

Cache performance also depends on factors such as cache organisation and whether the required data is present.

RAM

More RAM allows more programs and data to remain in main memory rather than requiring data to be moved to secondary storage.

This can improve performance when a system is short of memory.

RAM capacity is different from CPU clock speed.


4. Primary memory

RAM

Random Access Memory (RAM): Main memory used to hold programs and data currently in use.

Characteristics:

  • Read and write access.

  • Volatile.

  • Faster than most secondary storage.

  • Stores the operating system, applications and their working data while in use.

Volatile: Memory that loses its contents when power is removed.

More RAM can allow a computer to run more applications simultaneously.

ROM

Read Only Memory (ROM): Non-volatile memory used to store instructions or data that must be retained without power.

ROM is commonly associated with firmware.

Non-volatile: Storage that retains its contents when power is removed.

RAM versus ROM

Feature

RAM

ROM

Volatile?

Yes

No

Typical use

Programs and data currently in use

Firmware and persistent instructions

Normally rewritten during everyday operation?

Yes

Depends on the type of ROM and technology

Contents lost when power is removed?

Yes

No

Cache and registers

Cache stores frequently used instructions and data.

Registers hold values needed immediately by the CPU.

Registers are generally smaller and faster than cache.


5. Secondary storage

Secondary storage: Non-volatile storage used to keep data and programs for long-term use.

Examples include:

  • Hard disk drives.

  • Solid-state drives.

  • Optical discs.

  • USB flash drives.

Magnetic storage

Example: Hard disk drive (HDD).

An HDD stores data using magnetised regions on spinning platters.

Advantages:

  • Often offers high capacity.

  • Often has a low cost per gigabyte.

Disadvantages:

  • Moving parts can wear out.

  • More vulnerable to physical shocks than solid-state storage.

  • Mechanical operation can make it slower than an SSD.

Optical storage

Examples: CD, DVD and Blu-ray.

Optical storage uses a laser to read data from a disc, and compatible writable media can also be written using a laser.

Advantages:

  • Portable.

  • Useful for distributing software or media.

  • Can be stored offline.

Disadvantages:

  • Discs can be scratched or damaged.

  • Access is generally slower than modern SSDs.

  • Capacity is limited compared with many modern drives.

Solid-state storage

Examples: SSDs and USB flash drives.

Solid-state storage stores data electronically using flash memory.

Advantages:

  • No moving parts.

  • Fast access.

  • Generally resistant to physical shock.

  • Often uses less power than an HDD.

Disadvantages:

  • Often costs more per gigabyte than an HDD.

  • Flash memory has a finite number of write/erase cycles, although controllers manage wear.

Comparing storage devices

Requirement

Possible suitable choice

Reason

Fast operating-system drive

SSD

Fast access and no moving parts

Large, lower-cost storage

HDD

Often good capacity per pound

Portable transfer of files

USB flash drive

Small and portable

Distribution of certain media

Optical disc

Can be distributed physically and stored offline

The best choice depends on capacity, speed, cost, portability, durability and intended use.


6. Embedded systems

Embedded system: A computer system built into a larger device to perform a specific function.

Examples:

  • Washing machine controller.

  • Microwave oven controller.

  • Car braking system.

  • Digital thermostat.

  • Traffic-light controller.

Advantages:

  • Designed for a specific task.

  • Can be efficient and reliable.

  • Often has low hardware requirements.

  • Can operate automatically.

Disadvantages:

  • Usually less flexible than a general-purpose computer.

  • May be difficult to upgrade.

  • Hardware or software failure can affect the larger device.


7. Operating systems

Operating system (OS): System software that manages hardware and software resources and provides services for applications.

Main functions include:

User interface

Allows users to interact with the computer.

Examples include graphical user interfaces and command-line interfaces.

Memory management

Allocates and manages memory for running programs.

Processor management

Schedules processes and allocates CPU time.

File management

Organises files and folders and manages operations such as creating, reading, saving and deleting files.

Peripheral management

Manages devices such as printers, keyboards and storage devices, often using device drivers.

Security and user management

Controls accounts, authentication and permissions.

Multitasking

Allows multiple applications or processes to make progress through processor scheduling and other resource-management techniques.


8. Utility software

Utility software: Software designed to maintain, protect or optimise a computer system.

Utility

Purpose

Anti-malware

Detects and helps remove malicious software

Backup software

Creates copies of data so it can be restored

Encryption software

Protects data by converting it into an encoded form

Compression software

Reduces file size

Defragmentation utility

Rearranges fragmented data on suitable magnetic drives to improve access efficiency

Defragmentation is mainly relevant to HDDs; it is not generally recommended as a routine performance measure for SSDs.


9. Translators

Computers ultimately execute machine code.

A translator converts source code or assembly language into a form that the processor can execute.

Compiler

Compiler: A translator that converts a program, or a compilation unit, into machine code or another lower-level representation before execution.

Advantages:

  • The compiled program can run without translating the source code on every execution.

  • Compilation can allow optimisation.

  • Distribution of a compiled executable can be convenient.

Disadvantages:

  • Compilation takes time.

  • Source changes generally require recompilation.

  • Errors may need to be corrected before a successful executable can be produced.

Interpreter

Interpreter: A translator that executes source code by translating and processing instructions as the program runs.

Advantages:

  • Useful for testing and interactive development.

  • Can make debugging easier because execution can stop when an error is encountered.

  • Source code can be changed without a separate compilation stage.

Disadvantages:

  • Execution may be slower because translation and execution happen together.

  • The source code and appropriate interpreter are generally needed at runtime.

Assembler

Assembler: A translator that converts assembly-language instructions into machine code.

Assembly language uses mnemonic instructions closely related to the processor’s instruction set.

High-level versus low-level languages

High-level language

Low-level language

Easier for humans to read and write

More closely related to hardware

Usually easier to maintain

Can offer detailed control over hardware

Often portable across platforms with suitable translators

Often processor-specific

May hide hardware details

Requires more knowledge of the processor

10. Logic gates

Logic gate: An electronic circuit that performs a Boolean operation on one or more inputs to produce an output.

NOT gate

Reverses the input.

Input

Output

0

1

1

0

AND gate

Outputs 1 only when both inputs are 1.

A

B

Output

0

0

0

0

1

0

1

0

0

1

1

1

OR gate

Outputs 1 if at least one input is 1.

A

B

Output

0

0

0

0

1

1

1

0

1

1

1

1

XOR gate

Outputs 1 when the inputs are different.

A

B

Output

0

0

0

0

1

1

1

0

1

1

1

0

Exam tip: For a circuit containing multiple gates, work from the inputs towards the output, calculating intermediate results one gate at a time.

TOPIC 3.5 — FUNDAMENTALS OF COMPUTER NETWORKS

1. What is a computer network?

Definition: A computer network is a collection of two or more computing devices connected together to communicate and share resources.

Devices on a network can share:

  • Files and data.

  • Printers and other hardware.

  • An internet connection.

  • Applications and other resources.

Example: Computers in a school are connected to a network so that students can access shared files and printers.

Key terminology

Keyword

Definition

Computer network

Two or more computing devices connected to communicate and share resources.

Node

A device connected to a network.

Server

A computer that provides services or resources to other computers.

Client

A computer or device that requests services or resources from a server.

Network interface card (NIC)

Hardware that allows a device to connect to a network.

Network protocol

A set of rules governing communication between devices on a network.

Network traffic

Data travelling across a network.

Bandwidth

The maximum amount of data that can be transferred over a connection per unit of time.

2. Advantages and disadvantages of networks

Advantages

1. Resource sharing

  • Multiple users can share printers, storage and other hardware.

  • This reduces the cost of buying separate equipment for every user.

2. File sharing

  • Users can access shared files.

  • Files can be updated centrally, making collaboration easier.

3. Centralised management

  • User accounts and permissions can be managed centrally.

  • Administrators can control access to files and resources.

4. Communication

  • Users can communicate through email, messaging and video calls.

5. Centralised backups

  • Files stored on a central server can be backed up centrally.

  • This can make it easier to recover lost data.

Disadvantages

1. Security risks

  • If an attacker gains access to the network, they may access sensitive information.

  • Malware may spread between connected devices.

2. Dependence on network infrastructure

  • If a critical server or network component fails, users may lose access to shared resources.

3. Setup and maintenance costs

  • Networks require equipment, installation and administration.

4. Network congestion

  • Many users transferring data simultaneously may reduce performance.

5. Privacy risks

  • Poorly configured permissions may allow unauthorised users to access confidential files.

Exam technique

If asked to explain an advantage, make the consequence clear.

Weak answer:

Networks allow files to be shared.

Stronger answer:

Networks allow users to access centrally stored files, making collaboration easier because multiple authorised users can access the same information.

Remember: State the advantage and explain why it is beneficial.


3. Types of networks

AQA requires knowledge of three network types:

  • PAN

  • LAN

  • WAN

A. PAN — Personal Area Network

Definition: A Personal Area Network (PAN) connects devices over a very short distance around an individual.

For AQA, you need to know about Bluetooth.

Example: A smartphone connected to wireless headphones using Bluetooth.

Characteristics:

  • Covers a very small geographical area.

  • Usually connects an individual’s personal devices.

  • Bluetooth provides a short-range wireless connection.

Advantages:

  • Convenient for connecting nearby devices.

  • Usually requires little physical infrastructure.

  • Allows devices to communicate without cables.

Disadvantages:

  • Limited range.

  • Connections may be affected by interference.

  • Wireless connections can introduce security risks.

B. LAN — Local Area Network

Definition: A Local Area Network (LAN) connects devices within a relatively small geographical area.

Examples include:

  • A school.

  • A home.

  • An office.

  • A single building.

Characteristics:

  • Usually covers a small geographical area.

  • Often owned and managed by one person or organisation.

  • Can use wired or wireless connections.

  • Can share files, printers and internet access.

Advantages:

  • Fast communication between devices.

  • Resources can be shared.

  • Centralised security and user management are possible.

Disadvantages:

  • Installation and maintenance cost money.

  • Network failures can disrupt users.

  • Security must be managed carefully.

C. WAN — Wide Area Network

Definition: A Wide Area Network (WAN) connects devices or networks across a large geographical area.

Examples include networks connecting offices in different cities or countries.

The internet is the largest example of a WAN.

Characteristics:

  • Covers a large geographical area.

  • May connect multiple LANs.

  • Often involves infrastructure owned and managed by multiple organisations.

Advantages:

  • Allows communication across large distances.

  • Enables organisations to connect geographically separated offices.

  • Supports worldwide access to services and information.

Disadvantages:

  • Can be expensive to establish and maintain.

  • Data may travel through infrastructure outside an organisation’s control.

  • Performance depends on the connections and infrastructure used.

  • Security is more complex because data travels across interconnected networks.

PAN vs LAN vs WAN

Feature

PAN

LAN

WAN

Full name

Personal Area Network

Local Area Network

Wide Area Network

Geographical area

Very small

Small

Large

Example

Bluetooth headphones and phone

School network

Internet

Typical ownership

Individual

Individual or organisation

Often distributed across organisations

Main purpose

Connect personal devices

Connect devices locally

Connect devices and networks over large distances

Exam tip: Do not confuse the internet with the World Wide Web. The internet is a global network of interconnected networks. The World Wide Web is a service that operates over the internet.


4. Wired and wireless networks

Networks can use wired or wireless connections.

Wired networks

Definition: A wired network uses physical cables to transmit data between devices.

Two important cable types are copper and fibre-optic.

Copper cables

Transmit data using electrical signals.

Advantages:

  • Often cheaper than fibre-optic cables.

  • Widely available.

  • Suitable for many local network connections.

Disadvantages:

  • Electrical interference can affect transmission.

  • Generally less suitable than fibre for very high bandwidth over long distances.

Suitable use: Connecting computers to a local network in an office.

Fibre-optic cables

Transmit data using pulses of light.

Advantages:

  • Can support very high data-transfer rates.

  • Suitable for long-distance transmission.

  • Resistant to electromagnetic interference.

Disadvantages:

  • Installation and equipment can be more expensive.

  • Physical installation and repairs may require specialist equipment.

Suitable use: High-speed internet connections between buildings or across long distances.

Wireless networks

Definition: A wireless network transmits data without a physical data cable between the communicating devices, using technologies such as radio waves.

Examples include Wi-Fi and Bluetooth.

Advantages of wireless networks over wired networks

  • Mobility: Devices can move around while remaining connected, provided they stay within range.

  • Convenience: No data cables are needed for each device.

  • Flexibility: New devices can often be connected without installing additional network cabling.

  • Installation: May be easier to establish in buildings where installing cables is difficult.

Disadvantages of wireless networks compared with wired networks

  • Interference: Radio signals may be affected by walls, other devices or competing wireless networks.

  • Security: Signals may be intercepted if the network is poorly secured.

  • Range: Devices must remain within the coverage area.

  • Performance: Speed and reliability may vary with distance and interference.

Wired vs wireless

Feature

Wired

Wireless

Connection

Physical cable

Radio waves or another wireless transmission method

Mobility

Limited by cable

Greater mobility within range

Interference

Copper can suffer electromagnetic interference

Radio signals can suffer interference

Security

Physical access to cables may be needed to intercept them, but wired networks still require security

Signals may extend beyond the building, so encryption and authentication are important

Installation

Cabling may be expensive or difficult to install

Often easier to add mobile devices

Reliability

Can provide a stable connection

Can be affected by distance and interference

Important: Wireless does not automatically mean slower or less secure. Actual performance depends on the technology, equipment, configuration and environment.


5. Network protocols

Definition: A network protocol is a set of agreed rules that determines how devices communicate and exchange data over a network.

Protocols allow devices and software from different manufacturers to communicate consistently.

Without agreed protocols, devices might interpret transmitted data differently.

A. TCP — Transmission Control Protocol

Purpose: Helps provide reliable communication between devices.

TCP:

  1. Establishes a connection between communicating hosts.

  2. Splits data into segments for transmission.

  3. Numbers segments so they can be put back into the correct order.

  4. Uses acknowledgements to identify successfully received data.

  5. Retransmits data when necessary.

  6. Reassembles the data at the receiving end.

Example: TCP helps ensure that a file transferred across a network arrives complete and in the correct order.

Remember: TCP focuses on reliable delivery. IP handles addressing and routing.

B. IP — Internet Protocol

Purpose: Addresses data packets and helps route them towards their destination.

IP:

  • Uses IP addresses to identify network interfaces.

  • Places data into packets for transmission.

  • Allows routers to forward packets across interconnected networks.

Example: When you request a webpage, IP helps packets travel towards the web server and back.

Important: IP alone does not guarantee that every packet arrives or that packets arrive in order.

C. HTTP — Hypertext Transfer Protocol

Purpose: Transfers web resources between web browsers and web servers.

Example: A browser uses HTTP to request a webpage from a server.

Security limitation: HTTP does not provide the encryption that HTTPS provides.

D. HTTPS — Hypertext Transfer Protocol Secure

Purpose: Provides secure communication for HTTP using encryption through TLS.

It helps protect data against interception and tampering while it travels between a browser and a server.

Example: A website uses HTTPS to help protect login details and payment information during transmission.

Remember: HTTPS encrypts data in transit, but it does not guarantee that a website itself is trustworthy.

E. SMTP — Simple Mail Transfer Protocol

Purpose: Sends outgoing email and transfers email between mail servers.

Example: When you send an email, SMTP is used to send the message towards the recipient’s mail server.

Exam trap: SMTP is used for sending email, not retrieving messages from a mailbox.

F. IMAP — Internet Message Access Protocol

Purpose: Allows an email client to access and manage email stored on a mail server.

It allows messages and mailbox changes to be synchronised across devices.

Example: You read an email on your phone and later see it marked as read on your laptop.

Protocol summary table

Protocol

Full name

Main purpose

TCP

Transmission Control Protocol

Reliable delivery of data

IP

Internet Protocol

Addressing and routing packets

HTTP

Hypertext Transfer Protocol

Transferring web resources

HTTPS

Hypertext Transfer Protocol Secure

Secure, encrypted HTTP communication

SMTP

Simple Mail Transfer Protocol

Sending email

IMAP

Internet Message Access Protocol

Accessing and managing email on a mail server

6. The TCP/IP four-layer model

Definition: The TCP/IP model is a layered model that describes how data is communicated across networks.

It divides networking functions into four layers.

Layer 1: Application layer

Purpose: Provides network services to applications.

Examples of applications include web browsers and email clients.

Protocols operating at this layer in the AQA specification:

  • HTTP

  • HTTPS

  • SMTP

  • IMAP

Example: A browser uses HTTP or HTTPS to request a webpage.

Layer 2: Transport layer

Purpose: Manages communication between hosts and the delivery of application data.

It can:

  • Divide data into segments.

  • Manage the communication process.

  • Support reliable delivery and reassembly when TCP is used.

AQA protocol: TCP.

Example: TCP helps ensure that all the data required for a file is received in the correct order.

Layer 3: Internet layer

Purpose: Addresses packets and routes them between networks.

It:

  • Uses IP addresses.

  • Places data into packets.

  • Allows routers to forward packets towards their destination.

AQA protocol: IP.

Layer 4: Link layer

Purpose: Handles communication over the local network link.

It involves network hardware and the transmission of data over the local connection.

Relevant components include:

  • Network interface cards.

  • Network media, such as copper or fibre cables.

  • Wireless network interfaces.

TCP/IP layer summary

Layer

Main function

Relevant protocols or components

Application

Provides network services to applications

HTTP, HTTPS, SMTP, IMAP

Transport

Manages host-to-host communication and data delivery

TCP

Internet

Addresses and routes packets between networks

IP

Link

Transfers data over the local network link

NIC and network media

How the layers work together

Imagine requesting a webpage.

  1. Application: The browser creates an HTTP or HTTPS request.

  2. Transport: TCP manages the transport of the data.

  3. Internet: IP addresses the packets and helps route them.

  4. Link: The network interface and transmission medium send the data over the local link.

At the receiving end, the process is reversed as the data moves up the layers.

Exam tip: Learn the layers in order:

Application → Transport → Internet → Link

Remember the protocol mappings:

  • HTTP, HTTPS, SMTP and IMAP = Application.

  • TCP = Transport.

  • IP = Internet.


7. Network security

Definition: Network security involves protecting a network and its data against unauthorised access, misuse and attacks.

A network needs security because unauthorised users might steal information, change data or disrupt services.

A. Authentication

Definition: Authentication is the process of verifying the identity of a user or device.

Examples include:

  • Entering a username and password.

  • Using a fingerprint.

  • Entering a one-time code.

How it improves security: It helps prevent unauthorised users from accessing a network.

Limitation: Weak or stolen credentials may allow an attacker to authenticate successfully.

B. Encryption

Definition: Encryption transforms readable data (plaintext) into an encoded form (ciphertext) using an encryption algorithm and a key.

The ciphertext can be converted back into readable data by an authorised party with the necessary key.

How it improves security: If encrypted data is intercepted, it should be difficult to understand without the appropriate key.

Example: HTTPS uses encryption to help protect information travelling between a browser and a website.

Limitation: Encryption does not prevent someone from accessing an account using stolen credentials, and it does not automatically protect data after it has been decrypted.

C. Firewall

Definition: A firewall monitors incoming and outgoing network traffic and allows or blocks traffic according to security rules.

A firewall can:

  • Block traffic from suspicious sources.

  • Restrict connections to particular services.

  • Allow legitimate network traffic.

  • Help prevent unauthorised network access.

Limitation: A firewall may not stop every attack, particularly if traffic is allowed by the rules or a device is compromised in another way.

D. MAC address filtering

Definition: MAC address filtering allows or blocks devices based on the MAC address of their network interface.

A MAC address is a hardware-level address associated with a network interface.

For example, a router could be configured to permit only listed device addresses to connect.

Advantage: Adds a further access-control measure.

Limitation: MAC addresses can be spoofed, so MAC filtering should not be relied upon as the only security measure.

How the methods work together

A school might:

  1. Use a firewall to restrict unwanted network traffic.

  2. Require users to authenticate before accessing school accounts.

  3. Use encryption to protect data in transit.

  4. Apply MAC filtering as an additional restriction on network access.

Key principle: Multiple security measures can provide stronger protection than relying on a single measure.


TOPIC 3.5 — ESSENTIAL KEYWORDS

Learn these definitions accurately.

  • Network: Connected devices that communicate and share resources.

  • PAN: A network connecting personal devices over a very short distance.

  • LAN: A network covering a relatively small geographical area.

  • WAN: A network covering a large geographical area.

  • Protocol: Rules governing communication between devices.

  • TCP: Protocol that supports reliable data delivery.

  • IP: Protocol responsible for addressing and routing packets.

  • HTTP: Protocol for transferring web resources.

  • HTTPS: Secure version of HTTP using encryption through TLS.

  • SMTP: Protocol used to send email.

  • IMAP: Protocol used to access and manage email stored on a server.

  • Authentication: Verifying identity.

  • Encryption: Transforming readable data into ciphertext to protect its confidentiality.

  • Firewall: Monitors network traffic and allows or blocks it according to rules.

  • MAC address filtering: Controls network access based on device network-interface addresses.

  • TCP/IP model: A four-layer model describing network communication.


TOPIC 3.6 — CYBER SECURITY

1. What is cyber security?

Definition: Cyber security consists of the processes, practices and technologies used to protect computers, networks, programs and data against attacks, damage and unauthorised access.

Cyber security aims to protect:

  • Confidential information.

  • Personal data.

  • Computer systems.

  • Networks.

  • The availability and integrity of services.

Why is cyber security important?

Without effective security:

  • Personal information could be stolen.

  • Accounts could be compromised.

  • Data could be changed or deleted.

  • Systems could become unavailable.

  • Organisations could suffer financial losses.

  • Users could lose trust in a service.


2. Cyber security threats

AQA identifies several important threats:

  1. Social engineering.

  2. Malware.

  3. Pharming.

  4. Weak and default passwords.

  5. Misconfigured access rights.

  6. Removable media.

  7. Unpatched or outdated software.

You should understand how each threat works and how it can be prevented or reduced.


3. Social engineering

Definition: Social engineering is the manipulation of people into revealing confidential information or performing actions that compromise security.

Instead of attacking a computer directly, an attacker exploits human behaviour.

Social engineering may exploit:

  • Trust.

  • Fear.

  • Curiosity.

  • Urgency.

  • A person’s desire to help.

A. Phishing

Definition: Phishing is a fraudulent attempt to obtain private information, often through email or SMS, by pretending to be a legitimate person or organisation.

Example: Someone receives a message pretending to be from a bank. It asks them to click a link and enter their login details on a fake website.

How it works:

  1. The attacker sends a convincing-looking message.

  2. The message encourages the victim to click a link or provide information.

  3. The victim enters confidential information.

  4. The attacker uses the information to attempt to access an account or commit fraud.

Warning signs:

  • Unexpected requests for sensitive information.

  • Suspicious links or attachments.

  • Unusual sender addresses.

  • Urgent threats or unrealistic offers.

  • Unexpected requests to confirm login details.

Prevention:

  • Check the sender carefully.

  • Avoid clicking unexpected links.

  • Navigate to services using a known, trusted address or official app.

  • Never share passwords or authentication codes in response to an unsolicited message.

  • Report suspicious messages.

B. Blagging (pretexting)

Definition: Blagging is creating and using an invented scenario to persuade a person to reveal information or perform an action they would not normally perform.

It is also called pretexting.

Example: An attacker pretends to be an IT technician and claims they need a user’s password to fix an urgent problem.

How it works:

  1. The attacker invents a believable identity or situation.

  2. The victim believes the story.

  3. The victim provides information or access.

  4. The attacker uses this to compromise security.

Prevention:

  • Verify the person’s identity independently.

  • Follow official procedures.

  • Never disclose passwords.

  • Contact the organisation using a trusted contact method.

C. Shouldering (shoulder surfing)

Definition: Shouldering is observing someone entering or viewing confidential information, such as a password or PIN.

Example: Someone watches another person enter their PIN at a cash machine.

Prevention:

  • Shield the keypad.

  • Be aware of people nearby.

  • Avoid displaying sensitive information unnecessarily.

  • Use privacy screens where appropriate.

Social engineering comparison

Threat

Meaning

Example

Prevention

Phishing

Fraudulent message designed to obtain private information

Fake bank email

Check messages and avoid suspicious links

Blagging

Invented scenario used to persuade someone

Fake IT technician

Verify identity independently

Shouldering

Observing confidential information being entered or viewed

Watching someone enter a PIN

Shield the keypad and protect the screen

Exam tip: If the question describes a fake email or text message, phishing is usually the relevant term. If the attacker invents a story and impersonates someone, think of blagging.


4. Malware

Definition: Malware is malicious software designed to damage, disrupt, exploit or gain unauthorised access to a computer system.

Malware is an umbrella term covering different types of malicious software.

AQA specifically requires knowledge of:

  • Viruses.

  • Trojans.

  • Spyware.

A. Computer virus

Definition: A computer virus is malware that attaches itself to a file or program and can spread when the infected file or program is executed.

A virus may:

  • Corrupt files.

  • Delete data.

  • Modify programs.

  • Disrupt system operation.

Example: A user runs an infected program, allowing the virus to execute and potentially infect other files.

Prevention:

  • Use reputable anti-malware software.

  • Keep software updated.

  • Avoid suspicious attachments and downloads.

  • Scan removable media where appropriate.

B. Trojan

Definition: A Trojan is malware disguised as legitimate or useful software.

A Trojan tricks a user into installing or running it.

It may then:

  • Give an attacker access to the system.

  • Install additional malware.

  • Steal information.

  • Damage or disrupt the computer.

Example: A program advertised as a useful utility secretly performs malicious actions.

Important distinction: A Trojan relies on disguising itself as legitimate software. Unlike a virus, it is not defined by attaching itself to other files.

C. Spyware

Definition: Spyware is malware that secretly monitors a user’s activities or collects information about them.

It may collect:

  • Browsing activity.

  • Personal information.

  • Login details.

  • Other sensitive data.

Example: Spyware records information about a user’s activities and sends it to an attacker.

Prevention:

  • Use reputable anti-malware software.

  • Avoid untrusted downloads.

  • Keep operating systems and applications updated.

  • Review application permissions.

Virus vs Trojan vs spyware

Malware type

Defining characteristic

Possible consequence

Virus

Attaches to files or programs and can spread when executed

File corruption or data loss

Trojan

Disguises itself as legitimate software

Unauthorised access or installation of other malware

Spyware

Secretly monitors activity or collects information

Loss of privacy or stolen information

Remember: Malware is the general category. A virus, Trojan and spyware are different types of malware.


5. Pharming

Definition: Pharming is a cyber attack intended to redirect a user from a legitimate website to a fraudulent website.

The fraudulent website may look very similar to the genuine website.

An attacker may attempt to steal:

  • Login details.

  • Personal information.

  • Payment information.

Pharming may involve manipulating how a domain name is resolved to an IP address, for example through compromised DNS settings or a modified hosts file.

Example

A user enters the address of a legitimate banking website, but a technical manipulation redirects them to a fake website designed to collect their credentials.

Prevention

  • Use reputable security software.

  • Keep systems and routers updated.

  • Use secure connections and pay attention to browser security warnings.

  • Avoid entering sensitive details if the website appears suspicious.

  • Use trusted bookmarks or official apps for important services.

Phishing vs pharming

Phishing

Pharming

Often uses fraudulent messages to persuade users to visit a fake site

Redirects users towards a fake site

Relies heavily on deception through communication

May exploit technical manipulation of redirection or name resolution

Example: Fake email containing a login link

Example: A legitimate address is redirected to a fraudulent site

Exam tip: Phishing commonly tricks someone into clicking a link. Pharming involves redirecting the user to a fake website.


6. Weak and default passwords

Definition: A weak password is a password that is relatively easy to guess or crack.

Definition: A default password is a password supplied or set by a manufacturer or administrator before the user changes it.

Why are they security risks?

Weak passwords may be:

  • Easily guessed.

  • Based on public personal information.

  • Reused across multiple accounts.

  • Vulnerable to automated guessing attacks.

Default passwords may be widely known or documented, allowing attackers to attempt access using the original credentials.

Prevention

  • Use long, unique passwords.

  • Avoid predictable information.

  • Do not reuse the same password across important accounts.

  • Change default passwords.

  • Use a password manager where appropriate.

  • Enable multifactor authentication when available.

Exam explanation: Changing a default password reduces the chance that an attacker can access a system using publicly known manufacturer credentials.


7. Misconfigured access rights

Definition: Access rights are permissions that determine which users can access particular resources and what actions they can perform.

Examples of permissions include:

  • Read.

  • Write.

  • Edit.

  • Delete.

  • Execute.

Misconfigured access rights occur when permissions are set incorrectly, potentially allowing users to access resources or perform actions they should not be allowed to.

Example

A school gives every student permission to edit a file containing confidential staff information.

This could allow students to view or change information without authorisation.

Prevention

  • Apply the principle of least privilege.

  • Give users only the permissions they need.

  • Review permissions regularly.

  • Remove access when it is no longer required.

  • Use role-based permissions where appropriate.

Principle of least privilege: Users should receive only the minimum access rights necessary to perform their tasks.


8. Removable media

Definition: Removable media is portable storage that can be connected to and disconnected from a computer.

Examples:

  • USB flash drives.

  • External hard drives.

  • Memory cards.

Security risks

Removable media may:

  • Carry malware between computers.

  • Introduce infected files into a network.

  • Be lost or stolen, exposing stored information.

  • Be used to copy confidential data without permission.

Prevention

  • Scan removable media using reputable security software.

  • Avoid using unknown or untrusted devices.

  • Restrict the use of removable media where necessary.

  • Encrypt sensitive information stored on portable devices.

  • Keep devices physically secure.

Exam explanation: An infected USB drive could introduce malware into an otherwise secure network when connected to a computer.


9. Unpatched and outdated software

Definition: A software patch is an update that fixes bugs, improves functionality or addresses security vulnerabilities.

Unpatched software is software that has not had relevant patches applied.

Outdated software is software that is no longer current and may lack important security fixes.

Why is this a threat?

  • Known vulnerabilities may remain exploitable.

  • Attackers may use published information about weaknesses.

  • Malware may exploit unpatched systems.

  • Older software may no longer receive security support.

Prevention

  • Install security updates promptly.

  • Enable automatic updates where appropriate.

  • Replace unsupported software.

  • Maintain an inventory of systems that need updating.

Exam explanation: Installing security patches reduces the number of known vulnerabilities that attackers could exploit.


10. Penetration testing

Definition: Penetration testing is authorised testing in which a tester attempts to gain access to a computer system or its resources to identify security weaknesses.

Its purpose is to find vulnerabilities so that an organisation can fix them before malicious attackers exploit them.

Penetration testing should be conducted with appropriate permission and a defined scope.

Two types of penetration testing

A. Testing with knowledge of the target system

The tester has some knowledge of the system and may have basic credentials.

This can simulate an attack from inside the organisation, such as a malicious insider.

Example: A tester has a basic user account and attempts to identify whether it can access resources it should not be able to access.

B. Testing without knowledge of credentials

The tester has no knowledge of the target system’s credentials.

This simulates an external attacker attempting to gain access without existing login details.

Example: A tester assesses whether an organisation’s exposed systems have weaknesses that could permit unauthorised access.

Benefits of penetration testing

  • Identifies vulnerabilities.

  • Helps organisations prioritise security improvements.

  • Tests whether security controls work as intended.

  • Can reveal weaknesses that ordinary checks miss.

Limitations

  • Does not guarantee that every vulnerability will be discovered.

  • Can be costly and time-consuming.

  • Findings only reflect the systems and conditions tested.

  • Systems may develop new vulnerabilities after testing.

Exam tip: Penetration testing is an authorised attempt to identify weaknesses. A real attacker attempts to exploit weaknesses without permission.


11. Methods to detect and prevent cyber security threats

AQA specifically requires these methods:

  • Biometric measures.

  • Password systems.

  • CAPTCHA.

  • Email confirmations.

  • Automatic software updates.

A. Biometric measures

Definition: Biometrics use measurable biological or behavioural characteristics to help verify a person’s identity.

Examples:

  • Fingerprint recognition.

  • Facial recognition.

Advantages:

  • Convenient for users.

  • Difficult for another person to reproduce accurately in many circumstances.

  • Can reduce reliance on manually entered passwords.

Disadvantages:

  • Sensors may fail to recognise an authorised user.

  • Some biometric systems may be fooled.

  • Biometric data is sensitive and must be protected.

  • A compromised biometric characteristic cannot be changed as easily as a password.

Example: A smartphone uses fingerprint recognition to authenticate its owner.

B. Password systems

Definition: A password system uses a secret sequence of characters to authenticate a user.

A secure password system should:

  • Encourage strong, unique passwords.

  • Store passwords securely, typically using salted cryptographic hashes.

  • Limit repeated login attempts where appropriate.

  • Avoid exposing passwords to other users.

Advantages:

  • Relatively inexpensive.

  • Widely supported.

  • Users can change a compromised password.

Disadvantages:

  • Passwords can be guessed, stolen or reused.

  • Users may choose predictable passwords.

  • Users may be tricked into revealing them.

C. CAPTCHA

Definition: CAPTCHA is a test designed to help distinguish human users from automated programs.

It may require users to:

  • Identify objects in images.

  • Complete another challenge designed to be difficult for automated systems.

Purpose: Helps reduce automated abuse, such as bots submitting forms or creating accounts.

Advantages:

  • Can reduce automated activity.

  • Can make certain automated attacks more difficult.

Disadvantages:

  • Can inconvenience legitimate users.

  • Some challenges are difficult for people with disabilities.

  • Automated systems may sometimes bypass them.

Important: CAPTCHA is not a complete method of proving identity. It is mainly used to distinguish likely human activity from automated activity.

D. Email confirmations

Definition: Email confirmation is a process in which a service sends a message to an email address to help verify control of that address or confirm an action.

For example, a service sends a confirmation link when someone creates an account.

Advantages:

  • Helps verify that the user can access the email account.

  • Can help detect unauthorised account changes.

  • Can support password-reset procedures.

Disadvantages:

  • The email account itself could be compromised.

  • Messages may be intercepted or redirected.

  • A user may be tricked into clicking a fraudulent link.

E. Automatic software updates

Definition: Automatic software updates install available software updates without requiring the user to initiate every update manually.

They can:

  • Fix security vulnerabilities.

  • Correct software bugs.

  • Improve compatibility.

  • Reduce the period during which known vulnerabilities remain unpatched.

Advantages:

  • Helps keep systems secure.

  • Reduces reliance on users remembering to update software.

  • Can improve reliability.

Disadvantages:

  • Updates may introduce compatibility problems.

  • An update may occasionally contain a bug.

  • Updates may require a restart or use network bandwidth.

Security methods summary

Method

Main purpose

Main limitation

Biometrics

Verify identity using biological or behavioural characteristics

May fail or be vulnerable to spoofing

Password systems

Authenticate users using secret credentials

Passwords can be guessed or stolen

CAPTCHA

Help distinguish humans from automated programs

Does not establish a user’s identity

Email confirmation

Verify access to an email address or confirm an action

Email accounts can be compromised

Automatic updates

Fix vulnerabilities and keep software current

Updates may introduce compatibility issues

TOPIC 3.6 — ESSENTIAL KEYWORDS

  • Cyber security: Protecting computer systems, networks and data against attacks and unauthorised access.

  • Threat: Something capable of causing harm to a system or its data.

  • Vulnerability: A weakness that could be exploited.

  • Social engineering: Manipulating people into revealing information or performing actions.

  • Phishing: Fraudulent messages used to obtain private information.

  • Blagging: Using an invented scenario to persuade a victim to reveal information or perform an action.

  • Shouldering: Observing someone’s confidential information, such as a PIN, over their shoulder.

  • Malware: Malicious software.

  • Virus: Malware that attaches to files or programs and can spread when executed.

  • Trojan: Malware disguised as legitimate software.

  • Spyware: Malware that secretly monitors activity or collects information.

  • Pharming: Redirecting a user towards a fraudulent website.

  • Access rights: Permissions controlling access to resources and actions.

  • Patch: A software update that fixes bugs or vulnerabilities.

  • Penetration testing: Authorised testing to identify security weaknesses.

  • Biometrics: Authentication using biological or behavioural characteristics.

  • CAPTCHA: A challenge designed to help distinguish human users from automated programs.