Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Computer All Notes

-

Uploaded by

Radhika Ruia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Computer All Notes

-

Uploaded by

Radhika Ruia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 351

Head to www.savemyexams.

com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Number Systems
Contents
Computers & Binary
Number Systems
Converting Between Binary & Denary
Converting Between Hexadecimal & Denary
Converting Between Hexadecimal & Binary
Uses of Hexadecimal
Binary Addition
Binary Shifts
Two's Complement

Page 1 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Computers & Binary


Your notes
Why Computers Use Binary
Why does data have to be converted to binary to be
processed by a computer?
Data is processed in a computer using logic gates that only have two states
The binary number system only has two digits (1/0), which means each digit can represent a different
state (1 = on, 0 = off)
All data must be converted to binary before a computer can understand and process it
Converting data to binary allows computers to process it at an incredible speed, perform complex
calculations and store vast amounts of data efficiently

Secondary storage is a great example of the process


Magnetic hard drives use North and South polarity to represent a 1 or a 0
In Optical disks, light hitting a flat area (land) is interpreted as a 1 and light hitting a bump (pit) is
interpreted as a 0

Page 2 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Take an example of driving a car


When driving a car the accelerator pedal is used to increase the cars speed Your notes
If a car was accelerating from 50mph to 100mph the increase would be gradual
In a computer system, the car is doing either 50mph (0) or 100mph (1), there is no in-between
Trying to change the computer system so that it has more options would be less efficient and
require more complex parts for the computer to understand

Worked Example
Explain why computers process data in binary format [2]
Answer
Computers process data using logic gates... [1]
... that can only have two states (1/0) [1]

Page 3 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Number Systems
Your notes
The Denary, Binary & Hexadecimal Number Systems
What is denary?
Denary is a number system that is made up of 10 digits (0-9)
Denary is referred to as a base-10 number system
Each digit has a weight factor of 10 raised to a power, the rightmost digit is 1s (100), the next digit to the
left 10s (101) and so on
Humans use the denary system for counting, measuring and performing maths calculations
Using combinations of the 10 digits we can represent any number

In this example, (3 x 1000) + (2 x 100) + (6 x 10) + (8 x 1) = 3268


To represent a bigger number we add more digits

What is binary?
Binary is a number system that is made up of two digits (1 and 0)
Binary is referred to as a base-2 number system
Each digit has a weight factor of 2 raised to a power, the rightmost digit is 1s (20), the next digit to the
left 2s (21) and so on
Each time a new digit is added, the column value is multiplied by 2
Using combinations of the 2 digits we can represent any number

Page 4 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

In this example, Binary 1100 = (1 x 8) + (1 x 4) = 12


To represent bigger numbers we add more binary digits (bits)

32,768 16,384 8,192 4,096 2,048 1,024 512 256 128 64 32 16 8 4 2 1

215 214 213 212 211 210 29 28 27 26 25 24 23 2 2 21 20

Examiner Tips and Tricks


In the exam you are expected to be able to work with up to and including 16 bits
The largest denary number that can be represented using 16 bits is:
65,535 (Binary 1111111111111111)

What is hexadecimal?
Hexadecimal is a number system that is made up of 16 digits, 10 numbers (0-9) and 6 letters (A-F)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 2 3 4 5 6 7 8 9 A B C D E F

Hexadecimal is referred to as a base-16 number system


Each digit has a weight factor of 16 raised to a power, the rightmost digit is 1s (16^0), the next digit to
the left 16s (16^1)
In GCSE you are required to work with up to and including 2 digit hexadecimal values

Page 5 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

16s 1s
Your notes
1 3

1 x16 3x1 = 19

A quick comparison table demonstrates a relationship between hexadecimal and a binary nibble
One hexadecimal digit can represent four bits of binary data

Denary Binary Hexadecimal

0 0000 0

1 0001 1

2 0010 2

3 0011 3

4 0100 4

5 0101 5

6 0110 6

7 0111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

Page 6 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

13 1101 D
Your notes
14 1110 E

15 1111 F

Examiner Tips and Tricks


A common exam mistake is mixing up which letter matches with what number, write out the 16
hexadecimal digits at the start of the exam!

Page 7 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Converting Between Binary & Denary


Your notes
Denary to Binary Conversion
How do you convert denary to binary?
It is important to know the process of converting from denary to binary to understand how computers
interpret and process data
To convert from denary to binary you must start by writing out a binary number line
Find the first column heading with a value larger than the denary value you are converting
Write down each column heading to the right (not including the largest heading) until you reach 1

32,768 16,384 8,192 4,096 2,048 1,024 512 256 128 64 32 16 8 4 2 1

Example 1
To convert the denary number 45 to binary, start by writing out the binary number line
The first column heading larger than 45 is 64, so the number line would be:

32 16 8 4 2 1

Start at the leftmost empty column heading (32)


Divide column heading into denary number (how many times does 32 fit into 45?)
1 time with 13 remaining

13

32 16 8 4 2 1

Repeat with next column heading (how many times does 16 fit into 13?)
0 times with 13 remaining

Page 8 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

13 13
Your notes
32 16 8 4 2 1

1 0

Repeat until all columns have a binary value

13 13 5 1 1 0

32 16 8 4 2 1

1 0 1 1 0 1

Denary 45 is 101101 in binary (6 bits)

Examiner Tips and Tricks


Always read the question carefully to check for how many bits are expected in your answer
In the example above, a 6 bit answer has been given
If they question requires an 8 bit answer, add 2 extra 0s to the start of the answer
Denary 45 is 101101 in 6 bit binary and 00101101 in 8 bit binary

Example 2
To convert the denary number 3059 to binary, start by writing out the binary number line
The first column heading larger than 3059 is 4096, so the number line would be:

2,048 1,024 512 256 128 64 32 16 8 4 2 1

Start at the leftmost empty column heading (2048)


Divide column heading into denary number (how many times does 2048 fit into 3059?)
1 time with 1011 remaining

Page 9 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

1011
Your notes
2,048 1,024 512 256 128 64 32 16 8 4 2 1

Repeat with next column heading (how many times does 1024 fit into 1011?)
0 times with 1011 remaining

1011 1011

2,048 1,024 512 256 128 64 32 16 8 4 2 1

1 0

Repeat until all columns have a binary value

1011 1011 499 243 115 51 19 3 3 3 1 0

2,048 1,024 512 256 128 64 32 16 8 4 2 1

1 0 1 1 1 1 1 1 0 0 1 1

Denary 3059 is 101111110011 in binary (12 bits)

Binary to Denary Conversion


To convert from binary to denary, count how many bits make up the value
Write out the column headings for the number of bits given from right to left
Add together any column heading with a value of 1 in the column

Example 1 (4 bits)
To convert the binary number 1011 to denary, start by writing out the binary headings from right to left

8 4 2 1

Page 10 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes
Write in the binary digits under the headings from left to right

8 4 2 1

1 0 1 1

Add together any column heading with a 1 under it


(1 x 8) + (1 x 2) + (1 x 1) = 11
Binary 1011 is 11 in denary

Examiner Tips and Tricks


If you are converting from binary to denary and the binary number ends in 1, the denary answer must
be an odd number!

Example 2 (8 bits)
To convert the binary number 01100011 to denary, start by writing out the binary headings from right to
left

128 64 32 16 8 4 2 1

Write in the binary digits under the headings from left to right

128 64 32 16 8 4 2 1

0 1 1 0 0 0 1 1

Add together any column heading with a 1 under it


(1 x 64) + (1 x 32) + (1 x 2) + (1 x 1) = 99
Binary 01100011 is 99 in denary

Page 11 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Example 3 (14 bits)


To convert the binary number 01110001110100 to denary, start by writing out the binary headings from Your notes
right to left

8,192 4,096 2,048 1,024 512 256 128 64 32 16 8 4 2 1

0 1 1 1 0 0 0 1 1 1 0 1 0 0

Add together any column heading with a 1 under it


(1 x 4096) + (1 x 2048) + (1 x 1024) + (1 x 64) + (1 x 32) + (1 x 16) + (1 x 4) = 7284
Binary 01110001110100 is 7284 in denary

Page 12 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Converting Between Hexadecimal & Denary


Your notes
Denary to Hexadecimal Conversion
How do you convert denary to hexadecimal?
Method 1 (denary to binary to hexadecimal)
To convert the denary number 28 to hexadecimal, start by converting the denary number to binary

128 64 32 16 8 4 2 1

0 0 0 1 1 1 0 0

Split the 8 bit binary number into two nibbles as shown below

8 4 2 1 8 4 2 1

0 0 0 1 1 1 0 0

Convert each nibble to its denary value


0001 = 1 and 1100 = 12
Using the comparison table, the denary value 1 is also 1 in hexadecimal whereas denary value 12 is
represented in hexadecimal as C
Denary 28 is 1C in hexadecimal

Method 2 (divide by 16)


To convert the denary number 163 to hexadecimal, start by dividing the denary value by 16 and
recording the whole times the number goes in and the remainder
163 ➗16 = 10 remainder 3
In hexadecimal the whole number = digit 1 and the remainder = digit 2
Digit 1 = 10 (A)
Digit 2 = 3
Denary 163 is A3 in hexadecimal

Page 13 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Hexadecimal to Denary Conversion


Your notes
How do you convert hexadecimal to denary?
Method 1 (hexadecimal to binary to denary)
To convert the hexadecimal number B9 to denary, take each hexadecimal digit and convert it from its
denary value to 4 bit binary (nibble)

B (11) 9

8 4 2 1 8 4 2 1

1 0 1 1 1 0 0 1

Join the two nibbles to make an 8 bit number (byte)


Convert from binary to denary

128 64 32 16 8 4 2 1

1 0 1 1 1 0 0 1

(1 x 128) + (1 x 32) + (1 x 16) + (1 x 8) + (1 x 1) = 185


Hexadecimal B9 is 185 in denary

Method 2 (multiply by 16)


To convert the hexadecimal number 79 to denary, start by multiplying the first hexadecimal digit by 16
7 ✖ 16 = 112
Add digit 2 to the result
112 + 9 = 121
Hexadecimal 79 is 121 in denary

Examiner Tips and Tricks

Page 14 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Remember that the exam is non-calculator, if you are not confident multiplying and dividing by 16
then use method 1 on both conversions
Your notes

Page 15 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Converting Between Hexadecimal & Binary


Your notes
Binary to Hexadecimal Conversion
How do you convert from binary to hexadecimal?
It is important before revising how to convert from binary to hexadecimal and vice versa that you fully
understand the binary and hexadecimal number systems.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 2 3 4 5 6 7 8 9 A B C D E F

Example 1
To convert the binary number 10110111 to hexadecimal, first split the 8 bit number into 2 binary nibbles

8 4 2 1 8 4 2 1

1 0 1 1 0 1 1 1

For each nibble, convert the binary to it’s denary value


(1 x 8) + (1 x 2) + (1 x 1) = 11 (B)
(1 x 4) + (1 x 2) + (1 x 1) = 7
Join them together to make a 2 digit hexadecimal number
Binary 10110111 is B7 in hexadecimal

Example 2
To convert the binary number 00111001 to hexadecimal, first split the 8 bit number into 2 binary nibbles

8 4 2 1 8 4 2 1

0 0 1 1 1 0 0 1

For each nibble, convert the binary to it’s denary value


(1 x 2) + (1 x 1) = 3

Page 16 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

(1 x 8) + (1 x 1) = 9
Join them together to make a 2 digit hexadecimal number Your notes
Binary 00111001 is 39 in hexadecimal
Hexadecimal to Binary Conversion
How do you convert from hexadecimal to binary?
Example 1
To convert the hexadecimal number 5F to binary, first split the digits apart and convert each to a binary
nibble

8 4 2 1

0 1 0 1 =5

8 4 2 1

1 1 1 1 = 15 (F)

Join the 2 binary nibbles together to create an 8 bit binary number

128 64 32 16 8 4 2 1

0 1 0 1 1 1 1 1

Hexadecimal 5F is 01011111 in binary

Example 2
To convert the hexadecimal number 26 to binary, first split the digits apart and convert each to a binary
nibble

8 4 2 1

0 0 1 0 =2

Page 17 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

8 4 2 1
Your notes
0 1 1 0 =6

Join the 2 binary nibbles together to create an 8 bit binary number

128 64 32 16 8 4 2 1

0 0 1 0 0 1 1 0

Hexadecimal 26 is 00100110 in binary

Page 18 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Uses of Hexadecimal
Your notes
Uses of Hexadecimal
Why is hexadecimal used?
In Computer Science hexadecimal is often preferred when working with large values
It takes fewer digits to represent a given value in hexadecimal than in binary
1 hexadecimal digit corresponds 4 bits (one nibble) and can represent 16 unique values (0-F)
It is beneficial to use hexadecimal over binary because:
The more bits there are in a binary number, the harder it makes for a human to read
Numbers with more bits are more prone to errors when being copied
Examples of where hexadecimal can be seen:
MAC addresses
Colour codes
URLs

MAC addresses
A typical MAC address consists of 12 hexadecimal digits, equivalent to 48 digits in in binary
AA:BB:CC:DD:EE:FF
10101010:10111011:11001100:11011101:11101110:11111111
Writing down or performing calculations with 48 binary digits makes it very easy to make a mistake

Page 19 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Colour codes
A typical hexadecimal colour code consists of 6 hexadecimal digits, equivalent to 24 digits in binary Your notes
#66FF33 (green)
01000010:11111111:00110011

URL's
A URL can only contain standard characters (a-z and A-Z), numbers (0-9) and some special symbols
which is enough for basic web browsing

Page 20 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

If a URL needs to include a character outside of this set, they are converted into a hexadecimal code
Hexadecimal codes included in a URL are prefixed with a % sign Your notes

Page 21 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Binary Addition
Your notes
Adding Positive 8-bit Binary Integers
What is binary addition?
Binary addition is the process of adding together two binary integers (up to and including 8 bits)
To be successful there are 5 golden rules to apply:

Binary Addition Binary Answer Working

0+0= 0 1s

0 =0

0+1= 1 1s

1 =1

1+0= 1 1s

1 =1

1+1= 10 2s 1s

1 0 =2

1+1+1= 11 2s 1s

1 1 =3

Page 22 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Like denary addition, start from the rightmost digit and move left
Carrying over occurs when the sum of a column is greater than 1, passing the excess to the next left Your notes
column

Example 1
Add together the binary values 1001 and 0100

8 4 2 1 +

1 0 0 1

0 1 0 0

Starting from right to left, add the two binary values together applying the 5 golden rules
If your answer has 2 digits, place the rightmost digit in the column and carry the remaining digit to the
next column on the left
In this example, start with 1+0, 1+0 = 1, so place a 1 in the column

8 4 2 1 +

1 0 0 1

0 1 0 0

Repeat until all columns have a value

8 4 2 1 +

Page 23 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

1 0 0 1
Your notes
0 1 0 0

1 1 0 1

The sum of adding together binary 1001 (9) and 0100 (4) is 1101 (13)

Examiner Tips and Tricks


Make sure any carried digits are clearly visible in your answer, there are marks available for working.
Carries can be put above or below in the addition

Example 2
Add together the binary values 00011001 and 10000100

128 64 32 16 8 4 2 1 +

0 0 0 1 1 0 0 1

1 0 0 0 1 0 0 1

Starting from right to left, add the two binary values together applying the 5 golden rules
If your answer has 2 digits, place the rightmost digit in the column and carry the remaining digit to the
next column on the left
In this example, start with 1+1, 1+1 = 10, so place a 0 in the column and carry the 1 to the next column

128 64 32 16 8 4 2 1 +

Page 24 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

0 0 0 1 1 0 0 1
Your notes
1 0 0 0 1 0 0 1

1 C

Repeat until all columns have a value

128 64 32 16 8 4 2 1 +

0 0 0 1 1 0 0 1

1 0 0 0 1 0 0 1

1 1 1 C

1 0 1 0 0 0 1 0

The sum of adding together binary 00011001 (25) and 10001001 (137) is 10100010 (162)

Overflow & Binary Addition


What is an overflow error?
An overflow error occurs when the result of a binary addition exceeds the available bits
For example, if you took binary 11111111 (255) and tried to add 00000001 (1) this would cause an
overflow error as the result would need a 9th bit to represent the answer (256)

256 128 64 32 16 8 4 2 1 +

1 1 1 1 1 1 1 1

0 0 0 0 0 0 0 1

1 1 1 1 1 1 1 1 C

Page 25 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

0 0 0 0 0 0 0 0
Your notes

Examiner Tips and Tricks


When starting a binary addition question, always look at the question that comes after. If it asks you
to name what problem has been caused, you know the binary addition question must cause an
overflow error and therefore mean a carried bit that does not fit in to the answer

Page 26 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Binary Shifts
Your notes
Binary Shifts
What is a logical binary shift?
A logical binary shift is how a computer system performs basic multiplication and division on non-
negative values (0 and positive numbers)
Binary digits are moved left or right a set number of times
A left shift multiplies a binary number by 2 (x2)
A right shift divides a binary number by 2 (/2)
A shift can move more than one place at a time, the principle remains the same
A left shift of 2 places would multiply the original binary number by 4 (x4)

How do you perform a logical left shift of 1?


Here is the binary representation of the denary number 40

128 64 32 16 8 4 2 1

0 0 1 0 1 0 0 0

To perform a left logical binary shift of 1, we move each bit 1 place to the left
The digit in the 128 column (MSB) will move left causing an overflow error
The 1 column becomes empty so is filled with a 0

128 64 32 16 8 4 2 1

0 1 0 1 0 0 0 = 40

0 1 0 1 0 0 0 0 = 80

The original binary representation of denary 40 (32+8) was multiplied by 2 and became 80 (64+16)

How do you perform a logical left shift of 2?


Page 27 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Here is the binary representation of the denary number 28

128 64 32 16 8 4 2 1 Your notes

0 0 0 1 1 1 0 0

To perform a left binary shift of 2, we move each bit 2 places to the left
The digit in the 128 (MSB) and 64 column will move left causing an overflow error
The 1 and 2 column become empty so are filled with a 0

128 64 32 16 8 4 2 1

0 1 1 1 0 0 = 28

0 1 1 1 0 0 0 0 = 112

The original binary representation of denary 28 (16+8+4) was multiplied by 4 and became 112
(64+32+16)

How do you perform a logical right shift of 1?


Here is the binary representation of the denary number 40

128 64 32 16 8 4 2 1

0 0 1 0 1 0 0 0

To perform a right binary shift of 1, we move each bit 1 place to the right
The digit in the 1 column (LSB) will move right causing an underflow error
The 128 column becomes empty so is filled with a 0

128 64 32 16 8 4 2 1

0 0 1 0 1 0 0 = 40

0 0 0 1 0 1 0 0 = 20

Page 28 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The original binary representation of denary 40 (32+8) was divided by 2 and became 20 (16+4)

How do you perform a logical right shift of 2? Your notes


Here is the binary representation of the denary number 200

128 64 32 16 8 4 2 1

1 1 0 0 1 0 0 0

To perform a right binary shift of 2, we move each bit 2 places to the right
The digits in the 1 (LSB) and 2 columns will move right causing an underflow error
The 128 and 64 columns become empty so are filled with a 0

128 64 32 16 8 4 2 1

1 1 0 0 1 0 = 200

0 0 1 1 0 0 1 0 = 50

The original binary representation of denary 200 (128+64+8) was divided by 4 and became 50
(32+16+2)

Page 29 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Two's Complement
Your notes
Two's Complement
What is two's complement?
Two's complement is a method of using signed binary values to represent negative numbers
Using two's complement the left most bit is designated the most significant bit (MSB)
To represent negative numbers this bit must equal 1, turning the column value in to a negative
Working with 8 bits, the 128 column becomes -128

-128 64 32 16 8 4 2 1

1 1 1 1 1 1 1 1 = -1

In the example above to represent -1, add column values with a 1 to the MSB
MSB (-128)
Add 64 (-128+64 = -64
Add 32 (-64+32 = -32)
Add 16 (-32+16 = -16)
Add 8 (-16+8 = -8)
Add 4 (-8+4 = -4)
Add 2 (-4+2 = -2)
Add 1 (-2+1 = -1)
The two's complement representation of -1 is 11111111

Quick two's complement conversion


To represent -76
Write out the positive version of the number

128 64 32 16 8 4 2 1

Page 30 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

0 1 0 0 1 1 0 0 = 76
Your notes
Starting from the least significant bit (right most column), copy out the binary values up to and
including the first 1

-128 64 32 16 8 4 2 1

1 0 0

For the remaining digits, invert them (0s to 1s/1s to 0s)

-128 64 32 16 8 4 2 1

1 0 1 1 0 1 0 0

-128 + 32 + 16 + 4 = -76
The two's complement representation of -76 is 10110100

Page 31 of 31
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Text, Sound & Images
Contents
Character Sets
Representing Sound
Representing Images

Page 1 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Character Sets
Your notes
Character Sets
What is a character set?
A character set is all the characters and symbols that can be represented by a computer system
Each character is given a unique binary code
Character sets are ordered logically, the code for ‘B’ is one more than the code for ‘A’
A character set provides a standard for computers to communicate and send/receive information
Without a character set, one system might interpret 01000001 differently from another
The number of characters that can be represented is determined by the number of bits used by the
character set
Two common character sets are:
American Standard Code for Information Interchange (ASCII)
Universal Character Encoding (UNICODE)

ASCII
What is ASCII?
ASCII is a character set and was an accepted standard for information interchange
ASCII uses 7 bits, providing 27 unique codes (128) or a maximum of 128 characters it can represent

Page 2 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 3 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

ASCII only represents basic characters needed for English, limiting its use for other languages

Extended ASCII
Extended ASCII uses 8 bits, providing 256 unique codes (28 = 256) or a maximum of 256 characters it
can represent
Extended ASCII provides essential characters such as mathematical operators and more recent
symbols such as ©

Limitations of ASCII & extended ASCII


ASCII has a limited number of characters which means it can only represent the English alphabet,
numbers and some special characters
A, B, C, ………, Z
a, b, c ,.............,z
0, 1, 2,........, 9
!, @, #, …..
ASCII cannot represent characters from languages other than English
ASCII does not include modern symbols or emojis common in today's digital communication

UNICODE
What is UNICODE?
UNICODE is a character set and was created as a solution to the limitations of ASCII
UNICODE uses a minimum of 16 bits, providing 216 unique codes (65,536) or a minimum of 65,536
characters it can represent
UNICODE can represent characters from all the major languages around the world

Examiner Tips and Tricks

Page 4 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Exam questions often ask you to compare ASCII & UNICODE, for example the number of bits,
number of characters and what they store
Your notes
ASCII vs UNICODE
ASCII UNICODE

Number of bits 7-bits 16-bits

Number of 128 characters 65,536 characters


characters

Uses Used to represent characters in the Used to represent characters across the
English language. world.

Benefits It uses a lot less storage space than It can represent more characters than
UNICODE. ASCII.
It can support all common characters
across the world.
It can represent special characters such
as emoji's.

Drawbacks It can only represent 128 characters. It uses a lot more storage space than
ASCII.
It cannot store special characters such
as emoji's.

Worked Example
The computer stores text using the ASCII character set.

Part of the ASCII character set is shown:

Character ASCII Denary Code

E 69

Page 5 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

F 70

G 71 Your notes

H 72

(a)
Identify the character that will be represented by the ASCII denary code 76 [1]
(b)
Identify a second character set [1]
Answers
(a) L (must be a capital)
(b) UNICODE

Page 6 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Representing Sound
Your notes
How Sound is Sampled & Stored
How is sound sampled & stored?
Measurements of the original sound wave are captured and stored as binary on secondary storage
Sound waves begin as analogue and for a computer system to understand them they must be
converted into a digital form
This process is called Analogue to Digital conversion (A2D)
The process begins by measuring the amplitude of the analogue sound wave at a point in time, called
samples
Each measurement (sample) generates a value which can be represented in binary and stored
Using the samples, a computer is able to create a digital version of the original analogue wave
The digital wave is stored on secondary storage and can be played back at any time by reversing the
process

In this example, the grey line represents the digital wave that has been created by taking samples of the
original analogue wave
In order for the digital wave to look more like the analogue wave the sample rate and bit depth can be
changed

Page 7 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Sample Rate & Sample Resolution


Your notes
What is sample rate?
Sample rate is the amount of samples taken per second of the analogue wave
Samples are taken each second for the duration of the sound
The sample rate is measured in Hertz (Hz)
1 Hertz is equal to 1 sample of the sound wave

In this example you can see that the higher the sample rate, the closer to the original sound wave the digital
version looks

Page 8 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

The sampling rate of a typical audio CD is 44.1kHz (44,100 Hertz or 44,100 samples per second)
Using the graphic above helps to answer the question, “Why does telephone hold music sound so
bad?”

What is sample resolution?


Sample resolution is the number of bits stored per sample of sound
Sample resolution is closely related to the colour depth of a bitmap image, they measure the same
thing in different contexts

What effect do sample rate and sample resolution have?


Sample rate Sample resolution

High Low High Low

Playback quality ⇑ ⇓ ⇑ ⇓

File size ⇑ ⇓ ⇑ ⇓

Page 9 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Representing Images
Your notes
Bitmap Images
What is a bitmap?
A bitmap image is made up of squares called pixels
A pixel is the smallest element of a bitmap image
Each pixel is stored as a binary code
Binary codes are unique to the colour in each pixel
A typical example of a bitmap image is a photograph

The more colours and more detail in the image, the higher the quality of the image and the more binary
that needs to be stored

Resolution & Colour Depth


What is resolution?
Page 10 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Resolution is the total amount of pixels that make up a bitmap image


The resolution is calculated by multiplying the height and width of the image (in pixels) Your notes
In general, the higher the resolution the more detail in the image (higher quality)
Resolution can also refer to the total amount of pixels horizontally in a display, such as:
Computer monitors - 1440p means 1440 pixels horizontally compared to 4K which is 3840 pixels
(roughly 4 thousand)
TVs - HD (high definition) channels have a resolution of 1080p, 1080 pixels horizontally compared
to newer UHD (ultra high definition) channels with 3840 pixels (4K)
YouTube - The quality button allows a user to change the video playback resolution from 144p (144
pixels horizontally) up to 4K

What is colour depth?


Colour depth is the number of bits stored per pixel in a bitmap image
The colour depth is dependent on the number of colours needed in the image
In general, the higher the colour depth the more detail in the image (higher quality)
In a black & white image the colour depth would be 1, meaning 1 bit is enough to create a unique binary
code for each colour in the image (1=white, 0=black)

In an image with a colour depth of 2, you would have 00, 01, 10 & 11 available binary codes, so 4 colours

Page 11 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

As colour depth increases, so does the amount of colours available in an image


The amount of colours can be calculated as 2n (n = colour depth)

Colour Depth Amount of Colours

1 bit 2 (B&W)

2 bit 4

4 bit 16

8 bit 256

24 bit 16,777,216 (True Colour)

What is the impact of resolution and colour depth?


As the resolution and/or colour depth increases, the bigger the size of the file becomes on
secondary storage
The higher the resolution, the more pixels are in the image, the more bits are stored
The higher the colour depth, the more bits per pixel are stored
Striking a balance between quality and file size is always a consideration

Page 12 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Worked Example
1. Define the term Pixel [1]
2. If an image has a colour depth of 2 bits, how many colours can the image represent? [1]
3. Describe the impact of changing an images resolution from 500x500 to 1000x1000 [2]
Answers
1. The smallest element of a bitmap image (1 square)
2. 4
3. The image quality would be higher [1] the file size would be larger [1]

Page 13 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Data Storage & Compression
Contents
Units of Data Storage
Calculating File Sizes
Compression

Page 1 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Units of Data Storage


Your notes
Units of Data Storage
What are units of data storage?
A unit of data is a term given to describe different amounts of binary digits stored on a digital device
These are the units you need to know for IGCSE:

Unit Symbol Value

Bit b 1 or 0

Nibble 4b

Byte B 8b

Kibibyte KiB 1024 B (210)

Mebibyte MiB 1,048,576 KB (220)

Gibibyte GiB 1,073,741,824 MB (230)

Tebibyte TiB 1,099,511,626,776 GB (240)

Megabyte vs Mebibyte
1 kibibyte (1KiB) = 1024 bytes (1024 B) - binary prefixes (to the power of 2)
1 kilobyte (1KB) = 1000 bytes (1000 B) - decimal prefixes (to the power of 10)

Converting between units


It is often a requirement of the exam to be able to convert between different units of data, for example
bytes to mebibytes (larger) or kibibytes to bytes (smaller)
This process involves division, moving up in size of unit and multiplication, moving down in size of unit
When dealing with all units bigger than a byte we use multiples of 1024 (210)

Page 2 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

For example, 2000 kibibytes in mebibytes would be 2000 / 1024 = 1.95 MiB and 2 tebibytes in
gibibytes would be 2 * 1024 = 2048 GiB
Your notes
When dealing with bits and bytes the same process is used with the value 8 as there are 8 bits in a byte
For example, 24 bits in bytes would be 24 / 8 = 3 B and 10 bytes in bits would be 10 * 8 = 80 b
Unit

Multiply by 8 ⇑ Bit Divide by 8 ⇓

Byte

Multiply by 1024 ⇑ Kibibyte Divide by 1024 ⇓

Mebibyte

Gibibyte

Tebibyte

Page 3 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Calculating File Sizes


Your notes
Calculating File Sizes
How do you calculate the size of a bitmap image?
Calculating the size of a bitmap image can be carried out with either of the following formulas:
Resolution x colour depth
Image width x image height x colour depth

Example
Image Files

(Resolution) x (Colour Depth)

Size of bitmap image =

Resolution 250,000 Resolution = width x height

Colour Depth 24 bits (3 bytes) 24 bits = 3 bytes

250,000 x 24 = 6,000,000 bits


(bit to bytes) /8 750,000 bytes
(bytes to KiB) /1024 732 KiB

250000 x 3 = 750,000 bytes


(bytes to KiB) /1024 732 KiB

OR

Image Files

(Image width) x (Image height) x (Colour Depth)

Page 4 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Size of bitmap image =


Your notes
Image width 500

Image height 500

Colour Depth 24 bits 24 bits = 3 bytes

(500 x 500 x 24) = 6,000,000 bits


(bit to bytes) /8 750,000 bytes
(bytes to KiB) /1024 732 KiB

(500 x 500 x 3) = 750,000 bytes


(bytes to KiB) /1024 732 KiB

How do you calculate the size of a sound file?


Calculating the size of a sound file is carried out with the following formula:
Sample rate x duration x sample resolution

Example
Sound Files

(Sample Rate) x (Duration in seconds) x (Sample Resolution)

Size of sound file =

Sample rate 100 Samples per second

Duration 60 Seconds

Sample resolution 24 Number of bits stored per sample

Page 5 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

100 x 60 x 24 = 144,000 bits


(bit to bytes) /8 18,000 bytes Your notes
(bytes to KiB) /1024 18 KiB

Page 6 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Compression
Your notes
The Need For Compression
What is compression?
Compression is reducing the the size of a file so that it takes up less space on secondary storage
The impact of compression is:
Less storage space required
Less bandwidth required
Shorter transmission time
Compression can be achieved using two methods, lossy and lossless

Lossy Compression
What is lossy compression?
Lossy compression is when data is lost in order to reduce the size on secondary storage
Lossy compression is irreversible
Lossy can greatly reduce the size of a file but at the expense of losing quality
Lossy is only suitable for data where reducing quality is acceptable, for example images, video and
sound
In photographs, lossy compression will try to group similar colours together, reducing the amount of
colours in the image without compromising the overall quality of the image

Page 7 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 8 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

In the images above, lossy compression is applied to a photograph and dramatically reduces the file
size
Data has been removed and the overall quality has been reduced, however it is acceptable as it is
difficult to visually see a difference
Lossy compressed photographs take up less storage space which means you can store more and they
are quicker to share across a network

Lossless Compression
Page 9 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

What is lossless compression?


Lossless compression is when data is encoded in order to reduce the size on secondary storage
Lossless compression is reversible, the file can be returned to its original state
Lossless can reduce the size of a file but not as dramatically as lossy
Lossless can be used on all data but is more suitable for data where a loss in quality is unacceptable,
for example documents
In a document, lossless compression algorithms such as run length encoding (RLE) can be used to
analyse the contents looking for patterns and repetition.

What is run length encoding?


Run length encoding (RLE) is a form of lossless data compression that condenses identical elements
into a single value with a count
For a text file, "AAAABBBCCDAA" is compressed to "4A3B2C1D2A"
The string has four 'A's, followed by three 'B's, two 'C's, one 'D', and two 'A's

Page 10 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

RLE is used in bitmap images to compress sequences of the same colour


For example, a line in an image with 5 red pixels followed by 3 blue pixels could be represented as Your notes
"5R3B"
Lossless file formats

In the image above, lossless compression is automatically applied to document formats such as
DOCX and PDF with a different rate of success
When you open a lossless compressed document the decompression process reverses the
algorithms and returns the data back to its original state
Lossless compressed documents take up less storage space which means you can store more and
they are quicker to share across a network

Worked Example
An email is sent containing a sound file.
Lossy compression is used to compress the sound file.
Explain two reasons why using lossy compression is beneficial. [4]
How to answer this question

Page 11 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What are the differences between lossy and lossless?


Can you state two differences? [2 marks]
Can you say why each point is a benefit? [2 marks] Your notes
Answer
Lossy will decrease the file size [1]
...so it can sent via email quicker [1]
Lossy means data is lost [1]
...the difference is unlikely to be noticed by humans [1]

Page 12 of 12
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Types & Methods of Data Transmission
Contents
Data Packets
Packet Switching
Data Transmission
Universal Serial Bus (USB)

Page 1 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data Packets
Your notes
Data Packets
What are packets?
Packets are small 'chunks' of data that make up a larger piece of data that has been broken down by
the TCP protocol so that it can be transmitted over the internet
TCP stands for Transmission Control Protocol and is used for organising data transmission over
networks
Small 'chunks' of data are easier and quicker to route over the internet than big 'chunks' of data
Routing involves finding the most optimal path over a network
Data can include anything from text, images, audio, video, animations, etc, or any combination of these

What do packets contain?


A packet consists of:

Header Payload Trailer

Source IP address Actual data being transported Additional security information


(less common)

Destination IP address End of packet notification

Packet number
(1 of 5 etc.)

To transmit the message “This is a message :)”over the internet, TCP might break the message down
into 4 packets

Page 2 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Each packet contains a:


source IP address
destination IP address
payload (the data)
a packet number
Error checks make sure that when a packet is received there is minimal or no corruption of the data
Corruption is where packet data is changed or lost in some way, or data is gained that originally was not
in the packet
Read error detection methods for more detail on how data packets can be checked to ensure
corruption is avoided/minimised

Page 3 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Packet Switching
Your notes
Packet Switching
What is packet switching?
Packet switching is a method of sending and receiving data (packets) across a network
Packet switching can be broken down into five stages:

Stage Overview Detail

1 Data is broken down into Learn more by reading our data packets revision note
packets

2 Packets are assigned a


header

3 Each packet makes its way Like normal car traffic, data traffic builds up on the internet
to the destination
Routers can see this and decide to send a packet down a
different route that avoids traffic

4 Routers controls the routes Routers know which nearby router is closer to the
taken for each packet destination device

5 Packets arrive and are If a packet does not reach its destination the receiver can
reordered correctly send a resend request to the sender to resend the packet

Page 4 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What are the advantages of packet switching?


Interference and corruption are minimal as individual packets can be resent if they are lost or Your notes
damaged
The whole file doesn’t need to be resent if a corruption occurs, this saves time and internet bandwidth
Packet switching is quicker than sending a large packet as each packet finds the quickest way around
the network
It's harder to hack an individual's data as each packet contains minimal data, and travels through the
network separately

Worked Example
A local market shop wishes to arrange a delivery of goods from a supplier. Anna, the shop owner,
decides to send an email to request the delivery of the goods at a certain date and time.
Describe how packet switching is used to send this email and how it can be protected from
corruption.
[8]
Answer
The business email is first broken down into packets which are given a source address (where it's
come from) and a destination address (where it's going to) [1]
Each packet receives a packet number so that the email can be reassembled when it reaches its
destination [1]
Each packet also receives an error check such as a parity bit. A parity bit checks whether any
bits have been flipped due to corruption [1]
Each packet is sent over the internet via routers. Routers contain routing tables that determine
the next closest router to the destination [1]
Packets may take different routes depending on internet traffic and arrive at their destination in
any order [1]
Packets are checked for errors using the error checks and missing packets can be requested to
be resent [1]
Once all packets have been received then they can be put together in order using the packet
numbers [1]
Once assembled the original email can be read by the other business [1]

Page 5 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Examiner Tips and Tricks


For high marks make sure your answer is coherent, that is it follows logically from one point to the Your notes
next.
Some marks depend on previous points you have made.
Explaining parity bits without mentioning error checking first may not gain you additional marks

Page 6 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data Transmission
Your notes
What is data transmission?
Data transmission is the process of transferring data from one device to another using a wired or
wireless connection
Wired data transmission can be completed in two ways:
Serial
Parallel

Serial & Parallel Transmission


What is serial & parallel transmission?
Serial and parallel are methods of transmitting data (bits) from a sender to a receiver
Each method determines how many bits can be transmitted at once

Serial transmission
A stream of bits is sent in sequence, one after the other
USB is an example of a wired serial connection

Parallel transmission
A stream of bits is sent in sequence, one after the other across multiple wires at the same time
Transmission is asynchronous, data does not always arrive at the same time
A skew can be caused by data arriving out of order in asynchronous transmission
A traditional printer cable is an example of a wired parallel connection

Page 7 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Advantages and disadvantages of serial & parallel


transmission
Transmission Advantages Disadvantages

Serial Reliable over longer distance Slow transmission speed


Cheaper to setup
Low interference

Parallel Very fast transmission speed Only used on short distances


Prone to high interference

Simplex, Half-Duplex & Full-Duplex Transmission


What is simplex, half-duplex & full-duplex transmission?
Simplex, half-duplex and full-duplex control the direction in which data is transmitted between a
sender and receiver

Simplex transmission
Data travels in only one direction
Sending data from a computer to a monitor is an example of simplex transmission

Half-duplex transmission
Data can travel in both directions, but not simultaneously (bi-directional)
A printer cable which waits for the data to be received before sending back a ‘low ink’ message is an
example of half-duplex transmission

Full-duplex transmission

Page 8 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data can travel in both directions at the same time (bi-directional)


Network cables can send and receive data at the same time and are examples of full-duplex data Your notes
transmission
Full-duplex is used in local and wide area networks

Advantages and disadvantages of simplex, half-duplex &


full-duplex transmission
Transmission Advantages Disadvantages

Simplex Cheap as only one wire is used Slow


Expensive for bi-directional
transmission (multiple wires)

Half-duplex Cheaper than simplex for bidirectional Slow


transmission (fewer wires)

Full-duplex Fast as data can travel in both directions Expensive


simultaneously

Wires can be combinations of serial, parallel, simplex, half-duplex and full-duplex

Simplex Half-duplex Full-duplex

Serial Serial-Simplex Serial-Half-duplex Serial-Full-duplex

Parallel Parallel-Simplex Parallel-Half-duplex Parallel-Full-duplex

Serial-Simplex
Data is transmitted one bit at a time in a single direction on one wire
Serial-Half-duplex
Data can be transmitted in both directions on a single wire but only one bit at a time can be
transmitted in one direction at a time
Serial-Full-duplex
Data can be transmitted in both directions at the same time on a single wire one bit at a time

Page 9 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Parallel-Simplex
Multiple wires transmit one bit at a time in one direction Your notes
Parallel-Half-duplex
Multiple wires send multiple bits of data in both directions but only one direction at a time
Parallel-Full-duplex
Multiple wires send multiple bits of data in both directions at the same time

Worked Example
A company has a website that is stored on a web server
The company uses parallel half-duplex data transmission to transmit the data for the new videos to
the web server.

Explain why parallel half-duplex data transmission is the most appropriate method.
[6]
Answer
Parallel would allow for the fastest transmission [1]
as large amounts of data [1]
can be uploaded and downloaded [1]
but this does not have to be at the same time [1]
Data is not required to travel a long distance [1]
Therefore, skewing is not a problem [1]

Examiner Tips and Tricks


Any four of these points qualifies as a full answer, however make sure your answer is cohesive.
Saying “Parallel would allow for the fastest transmission but this does not have to be at the same
time” would qualify as one mark as only the first part makes sense and follows logically

Page 10 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Universal Serial Bus (USB)


Your notes
Universal Serial Bus (USB)
What is USB?
The Universal Serial Bus (USB) is an asynchronous and serial method of transmitting data between
devices and has become an industry standard
Many devices use USB such as keyboards, mice, video cameras, printers, portable media players,
mobile phones, disk drives, network adapters, etc
Different USB connectors exist for different devices:
USB-A (flash drives, mice, keyboards, external HDD, etc)
USB-B (printers, scanners, optical drives, floppy drives, etc)
USB-C (new standard of USB due to its small size and speed)
When a device is connected to a USB port the computer:
Automatically detects that the device has been connected
Automatically recognises and the appropriate device driver is loaded so that the device can
communicate with the computer
If the device is new, the computer will look for a matching device driver
If one cannot be found then the user must download and install an appropriate driver manually

Page 11 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Advantages and disadvantages of USB


Advantages Disadvantages

Devices are automatically detected and drivers are The maximum cable length is roughly 5
automatically loaded for communication metres meaning it cannot be used over
long distances, limiting its use

Cable connectors fit in only one way. Older versions of USB have limited
transmission rates for example USB 2.0
This prevents incorrect connections and ensures has 480Mbps
compatible data transmission

As USB usage is standardised, there is a lot of support Very old USB standards may not be
available online and from retailers supported in the near future (USB 1.1, USB
2.0, etc)

Several different data transmission rates are supported.


The newest transmission rate as of 2022 is USB4 2.0 with
80 Gbps (81,920 Mbps, 170x faster than USB 2.0)

Newer USB standards are backwards compatible with


older USB standards

Page 12 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes
Worked Example
Julia uses a USB connection to transfer data onto her USB flash memory drive.
One benefit of using a USB connection is that it is a universal connection.
(i) State two other benefits of using a USB connection.
[2]
(ii) Identify the type of data transmission used in a USB connection.
[1]
Answers
(i) Any two of:
It cannot be inserted incorrectly [1]
Supports different transmission speeds [1]
High speed transmission [1]
Automatically detected [1]
Powers the device for data transfer [1]
(ii)
Serial [1]

Page 13 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Methods of Error Detection
Contents
Error Checking
Error Detection Methods
Check Digits
Automatic Repeat Query (ARQ)

Page 1 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Error Checking
Your notes
Why Errors Occur
Why do errors occur?
Errors can occur using wired or wireless technology due to interference
Examples of interference include wire degradation or electrical fields changing the signal
Results of interference include:
Data loss - data is lost in transmission
Data gain - additional data is received
Data change - some bits have been changed or flipped
Wireless technology uses radio signals or other electromagnetic signals to transmit data
These signals can be blocked by physical barriers such as buildings, walls, cars or other objects
Interference can be caused by bad weather such as rain or clouds, or by other wireless signals or
electromagnetic radiation
Wired technology carries more chance of causing an error as physical components can be damaged,
degrade or receive interference from outside signals
Data loss can also occur from interruptions to data transmission such as a blocked signal or if the
transmission is intermittent

Why check for errors?


Computers expect data in certain formats
A format is a way of arranging the data so that it can be easily understood by people and by
computers
People agree to certain formats so that systems work more efficiently and there is little chance of
misunderstanding each other
An example of a format is date and time
Date and time can have multiple formats such as:
13/04/14 (DD/MM/YY)
12/31/2020 (MM/DD/YYYY)

Page 2 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Jul-04-16 (MMM/DD/YY)
If data is not as expected, things can go wrong
Your notes
For example, if a receiver expected to receive a date in format DD/MM/YY as 03/04/17 but received
04/03/17, did the sender mean 3rd April 2017 or 4th March 2017?
An error or corruption occurs when data received is not as expected and therefore is difficult or
impossible to process

Worked Example
Alex receives an email over a wireless connection from a work colleague containing an important
document.
Identify what interference Alex could experience when sending this email and identify the
outcomes of interference.
Further explain why Alex should check to make sure the document contains no errors.
[4]
Answer
Weather conditions or physical barriers such as building can affect signals, for example bits
could be flipped in the document making it hard to understand the original meaning [1]
Alex should be aware that interference can cause wirelessly received data to contain errors or
corruption [1]
Data could be lost, additional data could be gained or data could be changed [1]
As Alex received an important work document they need to check for errors so that their work is
unaffected and they do not receive incorrect information [1]

Page 3 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Error Detection Methods


Your notes
Parity Check
What is a parity check?
A parity check determines whether bits in a transmission have been corrupted
Every byte transmitted has one of its bits allocated as a parity bit
The sender and receiver must agree before transmission whether they are using odd or even parity
If odd parity is used then there must be an odd number of 1’s in the byte, including the parity bit
If even parity is used then there must be an even number of 1’s in the byte, including the parity bit
The value of the parity bit is determined by counting the number of 1’s in the byte, including the parity
bit
If the number of 1’s does not match the agreed parity then an error has occurred
Parity checks only check that an error has occurred, they do not reveal where the error(s) occurred

Even parity
Below is an arbitrary binary string

EVEN Byte
Parity bit

0 1 0 1 1 0 1 0

If an even parity bit is used then all bits in the byte, including the parity bit, must add up to an even
number
There are four 1’s in the byte
This means the parity bit must be 0 otherwise the whole byte, including the parity bit, would add up
to five which is an odd number

Odd parity
Below is an arbitrary binary string

Page 4 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

ODD Byte
Parity bit
Your notes
1 1 0 1 1 0 1 0

If an odd parity bit is used then all bits in the byte, including the parity bit, must add up to an odd
number
There are four 1’s in the byte. This means the parity bit must be a 1 otherwise the whole byte,
including the parity bit, would add up to four which is an even number
The table below shows a number of examples of the agreed parity between a sender and receiver and
the parity bit used for each byte

Example # Agreed parity Parity bit Main bit string Total number of 1’s

#1 ODD 0 1 1 0 1 0 1 1 5

#2 EVEN 1 0 0 0 1 0 0 0 2

#3 EVEN 1 0 1 0 1 1 1 1 6

#4 ODD 1 0 1 1 1 0 0 1 5

#5 ODD 1 1 0 1 0 1 0 1 5

#6 EVEN 0 1 0 0 1 1 1 0 4

Example #1: The agreed parity is odd. All of the 1’s in the main bit string are added (5). As this number is
odd already the parity bit is set to 0 so the whole byte stays odd
Example #2: The agreed parity is even. All of the 1’s in the main bit string are added (1). As this number is
odd the parity bit is set to 1 to make the total number of 1’s even (2)
Example #6: The agreed parity is even. All of the 1’s in the main bit string are added (4). As this number is
even already the parity bit is set to 0 so the whole byte stays even

How do errors occur?


When using parity bits, an error occurs when the number of total bits does not match the agreed
parity

Page 5 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Bits can be flipped or changed due to interference on a wire or wirelessly due to weather or other
signals
Your notes
Example # Agreed parity Parity bit Main bit string Total number of 1’s Error

#1 ODD 1 1 1 0 1 0 1 1 6 Error

#2 EVEN 1 0 0 0 1 0 0 0 2 No error

#3 EVEN 1 0 1 1 1 1 1 1 7 Error

#4 ODD 1 0 1 1 1 0 0 1 5 No error

#5 ODD 1 1 0 1 0 1 1 1 6 Error

#6 EVEN 0 1 0 0 0 1 1 0 3 Error

Parity checks are quick and easy to implement but fail to detect bit swaps that cause the parity to
remain the same

Parity Byte & Block Check


What are parity byte & block checks?
Parity blocks and parity bytes can be used to check an error has occurred and where the error is
located
Parity checks on their own do not pinpoint where errors in data exist, only that an error has occurred
A parity block consists of a block of data with the number of 1’s totalled horizontally and vertically
A parity byte is also sent with the data which contains the parity bits from the vertical parity
calculation
Below is a parity block with a parity byte at the bottom and a parity bit column in the second column

ODD Parity bit Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8

Byte 1 0 1 1 0 1 0 1 1

Byte 2 0 0 0 0 1 0 0 0

Page 6 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Byte 3 1 0 1 0 1 1 1 1
Your notes
Byte 4 1 0 1 1 1 0 0 1

Byte 5 1 1 0 1 0 1 0 1

Byte 6 1 1 0 0 1 1 1 0

Byte 7 0 0 1 1 1 1 1 0

Byte 8 0 1 0 1 1 0 0 0

Parity byte 0 1 1 1 1 1 1 1

The above table uses odd parity


Each byte row calculates the horizontal parity as a parity bit as normal
Each bit column calculates the vertical parity for each row, the parity byte
It is calculated before transmission and sent with the parity block
Each parity bit tracks if a flip error occurred in a byte while the parity byte calculates if an error
occurred in a bit column
By cross referencing both horizontal and vertical parity values the error can be pinpointed
In the above example the byte 3 / bit 5 cell is the error and should be a 0 instead
The error could be fixed automatically or a retransmission request could be sent to the sender

Checksum
What is a checksum?
A checksum is a value that can be used to determine if data has been corrupted or altered
It indicates whether data differs from its original form but does not specify where
Checksums are calculated using an algorithm and the value is added to the transmission
The receiving device re-calculates the checksum and compares to the original
If the checksums do not match, it is assumed an error has occurred

Page 7 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes
Worked Example
Describe the process a checksum algorithm uses to determine if an error has occurred
[5]
Answer
Before data is transmitted a checksum value is calculated [1]
The checksum value is transmitted with the data [1]
The receiver calculates the checksum value using the received data [1]
The calculated checksum is compared to the transmitted checksum [1]
If they are the same then there is no error otherwise an error has occurred [1]

Echo Check
What is an echo check?
An echo checks involve transmitting the received data back to the sender
The sender then checks the data to see if any errors occurred during transmission
This method isn’t reliable as an error could have occurred when the sender transmits the data or
when the receiver transmits the data
If an error does occur the sender will retransmit the data

Worked Example
Four 7-bit binary values are transmitted from one computer to another.
A parity bit is added to each binary value creating 8-bit binary values. All the binary values are
transmitted and received correctly.
(a) Identify whether each 8-bit binary value has been sent using odd or even parity by writing odd or
even in the type of parity column.

8-bit binary value Type of parity

01100100

10010001

Page 8 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

00000011

10110010 Your notes

[4]
(b) An error may not be detected when using a parity check.
Identify why an error may not be detected.
[1]
Answers
(a)

8-bit binary value Type of parity

01100100 Odd [1]

10010001 Odd [1]

00000011 Even [1]

10110010 Even [1]

(b)
Any one from:
there is a transposition of bits [1]
it does not check the order of the bits (just the sum of 1s/0s) [1]
even number of bits change [1]
incorrect bits still add up to correct parity [1]

Page 9 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Check Digits
Your notes
Check Digits
What is a check digit?
A check digit is the last digit included in a code or sequence, used to detect errors in numeric data
entry
Examples of errors that a check digit can help to identify are:
Incorrect digits entered
Omitted or extra digits
Phonetic errors
Added to the end of a numerical sequence they ensure validity of the data
Calculated using standardised algorithms to ensure widespread compatibility
Examples of where check digits can be used include:
ISBN book numbers
Barcodes

ISBN book numbers


Each book has a unique ISBN number that identifies the book
A standard ISBN number may be ten digits, for example, 965-448-765-9
The check digit value is the final digit (9 in this example).
This number is chosen specifically so that when the algorithm is completed the result is a whole number
(an integer) with no remainder parts
A check digit algorithm is performed on the ISBN number and if the result is a whole number, then the
ISBN is valid

Barcodes
Barcodes consist of black and white lines which can be scanned using barcode scanners
Barcode scanners shine a laser on the black and white lines which reflect light into the scanner
The scanner reads the distance between these lines as numbers and can identify the item

Page 10 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Barcodes also use a set of digits to uniquely identify each item


The final digit on a barcode is usually the check digit, this can be used to validate and authenticate an Your notes
item

Worked Example
Check digit algorithms are used to determine whether an error has occurred in transmitted data.
State the names of two examples of a check digit algorithm.
[2]
Answer
ISBN [1]
Barcode [1]

Page 11 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Automatic Repeat Query (ARQ)


Your notes
Automatic Repeat reQuests(ARQ)
What is an automatic repeat request(ARQ)?
An automatic repeat request is a protocol that notifies the sender that an error has occurred and that
the data received is incorrect
It works as follows:
If an error is detected the receiver sends a negative acknowledgement transmission to indicate
the data is corrupted
If no error is detected the receiver sends a positive acknowledgement transmission meaning the
data is correct
If the receiver does not send any acknowledgement transmission then the sender waits for a
certain time period known as a time-out before automatically resending the data
This process is repeated until all data has been received and acknowledged

Examiner Tips and Tricks


In this specification ARQ is referred to as Automatic Repeat Query but in past exam questions it has
been referred to as Automatic Repeat reQuests
Both words are interchangeable and should not cause any confusion!

Worked Example
Explain how Automatic Repeat reQuests (ARQ) are used in data transmission and storage
[2]
Answer
Any two from:
Set of rules for controlling error checking/detection // it’s an error detection method // used to
detect errors

Page 12 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Uses acknowledgement and timeout


Request is sent (with data) requiring acknowledgement
If no response/acknowledgment within certain time frame data package is resent Your notes
When data received contains an error a request is sent (automatically) to resend the data
The resend request is repeatedly sent until packet is received error free/limit is
reached/acknowledgement received

Page 13 of 13
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Encryption
Contents
Encryption

Page 1 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Encryption
Your notes
Encryption
What is encryption?
Encryption is a method of scrambling data before being transmitted across a network
Encryption helps to protect the contents from unauthorised access by making data meaningless
While encryption is important on both wired and wireless networks, it's even more critical on wireless
networks due to the data being transmitted over radio waves, making it easy to intercept

How is wireless data encrypted?


Wireless networks are identified by a 'Service Set Identifier' (SSID) which along with a password is used
to create a 'master key'
When devices connect to the same wireless network using the SSID and password they are given a
copy of the master key
The master key is used to encrypt data into 'cipher text', before being transmitted
The receiver uses the same master key to decrypt the cipher text back to 'plain text'
To guarantee the security of data, the master key is never transmitted. Without it, any intercepted
data is rendered useless
Wireless networks use dedicated protocols like WPA2 specifically designed for Wi-Fi security

Page 2 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

How is wired data encrypted?


Wired networks are encrypted in a very similar way to a wireless network, using a master key to encrypt
data and the same key to decrypt data
Encryption on a wired network differs slightly as it is often left to individual applications to decide how
encryption is used, for example HTTPS

Symmetric & Asymmetric Encryption


Encryption relies on the use of a key
A key is a binary string of a certain length that when applied to an encryption algorithm can encrypt
plaintext information and decrypt ciphertext
Plaintext is the name for data before it is encrypted
Ciphertext is the name for data after it is encrypted
Keys can vary in size and act like passwords, enabling people to protect information

Page 3 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What is symmetric encryption?


Symmetric encryption is when both the sender and receiver are given an identical secret key which Your notes
can be used to encrypt or decrypt information
If a hacker gains access to the key, then they can decrypt intercepted information
The secret key can be shared with the receiver without sending it electronically:
Both parties could verbally share the key in person
Both parties may use standard postage mail to share the key
An algorithm may be used to calculate the key by sharing secret non-key information

What is asymmetric encryption?


Asymmetric encryption is when two keys are used, a public and private key
Public key: a key known to everyone
Private key: a key known only to the receiver
Both keys are needed to encrypt and decrypt information
Asymmetric encryption works as follows:
Person A uses a public key to encrypt their message
Person A sends their message over the network or internet
Person B decrypts the message using their secret private key
Only one private key can be used to decrypt a message and it is not sent over the internet like a
symmetric key
Keys can be large, a key using 100 bits would generate 1,267,650,600,228,229,401,496,703,205,376
different combinations
Large keys are near impossible for a hacker to guess

Worked Example
Complete the sentences about symmetric encryption. Use the terms from the list. Some of the
terms in the list will not be used. You should only use a term once.

algorithm

Page 4 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

cipher
copied
delete Your notes
key
plain
private
public
standard
stolen
understood
unreadable
The data before encryption is known as ______ text. To scramble the data, an encryption ______,
which is a type of ______, is used. The data after encryption is known as ______ text. Encryption
prevents the data from being ______ by a hacker.
[5]
Answer
One mark for each correct term in the correct place:
The data before encryption is known as plain text. To scramble the data, an encryption
algorithm/key, which is a type of key/algorithm, is used. The data after encryption is known as cipher
text. Encryption prevents the data from being understood by a hacker.

Page 5 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Computer Architecture
Contents
The CPU & Microprocessors
Von Neumann Architecture
The Fetch-Decode-Execute Cycle
Characteristics of the CPU
CPU Instruction Sets
Embedded Systems

Page 1 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The CPU & Microprocessors


Your notes
The CPU & Microprocessors
What is the purpose of the CPU?
The purpose of the Central Processing Unit (CPU) is to fetch, decode and execute instructions
The CPU is the brain of the computer and its job is to take an input, process data and produce an output
It is central to all devices including:
Laptops
Desktops
Games-Consoles
Mobile Devices
The words CPU and Microprocessor are interchangeable and can be used to mean the same thing
A microprocessor is a type of integrated circuit on a single chip
Data and commands are inputted by the user using an input device, the central processing unit (CPU)
processes data by executing instructions and the results are outputted to an output device
Below is an example of data being inputted, processed and the results being outputted

Step Example

Input A keyboard is used to input a number

Process If the instruction being executed is ADD, the inputted value is added to an existing value

Output The result of the calculation is outputted to the user via the monitor

Page 2 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A diagram showing the input, process, output sequence followed by computer systems
Your notes

Page 3 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Von Neumann Architecture


Your notes
Von Neumann Architecture
What is the Von Neumann architecture?
The Von Neumann Architecture is a design of the CPU which was proposed by Mathematician John Von
Neumann in the 1940s, which most general-purpose computers are built upon
The Von Neumann Architecture outlines how the computer memory, input/output devices and
processor all work together

The Von-Neumann architecture

The Von Neumann architecture consists of:


Control unit (CU)
Arithmetic logic unit (ALU)
Registers
Buses
Page 4 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What is the function of each component?


Arithmetic logic unit (ALU) Your notes

Performs arithmetic operations


Performs logical decisions
IF X > 5 THEN
DO ……….

Control unit (CU)


Coordinates how data moves around the CPU by sending a signal to control the movement of the
data
Decodes the instructions fetched from memory

Registers
Extremely small, extremely fast memory located in the CPU
Hold small amounts of data needed as part of the fetch-execute cycle
Each register has its own specific purpose
It consists of 5 main registers
The Program Counter (PC)
The Memory Address Register (MAR)
The Memory Data Register (MDR)
The Accumulator (ACC)
Current Instruction Register (CIR)
For each of the registers you must know
The name of the register
Its acronym
The purpose of the register

Name Acronym Purpose

Program Counter PC Holds the memory address of the next instructions to be


executed

Page 5 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Increments by 1 as the fetch-decode-execute cycle runs

Your notes
Memory Address MAR Holds the memory address of where data or instructions are
Register to be fetched from memory

Memory Data Register MDR Stores the data or instruction which has been fetched from
memory

Current Instruction CIR Stores the instruction the CPU is currently decoding or
Register executing

Accumulator ACC Stores the results of any calculations that have taken place in
the Arithmetic Logic Unit (ALU)

Buses
Components within the CPU and wider computer system are connected by buses
A bus is a set of parallel wires through which data/signals are transmitted from one component to
another
There are 3 types of bus:
Address - unidirectional, carries location data (addresses), data is written to/read from
Data - bidirectional, carries data or instructions
Control - bidirectional, carries commands and control signals to tell components when they
should be receiving reads or writes etc..

Page 6 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Examiner Tips and Tricks


If asked to describe the purpose of the PC, MAR or the MDR make sure you explain how the data is
being fetched or written to memory

Worked Example
Describe the role of the control unit, the control bus, the data bus and the address bus when
fetching an instruction from memory [4]
Answer
The address of memory (holding instruction) is placed on the address bus (1)
The control unit sends a signal (1) on the control bus (to start a read operation) (1)
The instruction is/the contents of the memory are placed on the data bus (1)

Page 7 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The Fetch-Decode-Execute Cycle


Your notes
Fetch-Decode-Execute Cycle (FDE)
What is the purpose of the CPU?
The purpose of the Central Processing Unit (CPU) is to fetch, decode and execute instructions
The CPU is the brain of the computer and its job is to take an input, process data and produce an output

What is the Fetch-Decode-Execute cycle?


The Fetch-Decode-Execute Cycle is the cycle that the central processing unit (CPU) runs through
billions of times per second to make a computer work
A computer takes an input, processes the input and then delivers an output for the user
Input: Clicking a button on the gamepad
Process: The CPU inside the console follows a set of instructions to carry out the task
Output: The player moving on screen

Page 8 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The Fetch-Decode-Execute cycle stages


Fetch stage Your notes

During the fetch stage of the cycle, the program counter holds the address of the next instruction to
be fetched from memory
The address of the next instruction or data to be fetched is copied into the memory address register
(MAR)
The address of the instruction or data is then sent along the address bus and awaits a signal from the
control bus
The signal sent along the control bus is sent from the control unit (CU) to the main memory
The data or instructions received from main memory is fetched to the memory data register (MDR) via
the data bus
A copy of the instruction or data is stored in the current instruction register (CIR)
The program counter (PC) increments by 1 so it is pointing to the next instruction to be executed

Decode stage
During the decode stage of the cycle, the CPU needs to work out what is required from the
instruction
This is done as the instruction is split into two parts:
Opcode - what the instruction is
Operand - what to do it to
This could be either data or an address where the data is stored

Execute stage
During the execute stage of the cycle, the CPU will carry out the instruction that was fetched
Some examples that would take place at this stage are
Performing a calculation
Storing a result or data back in main memory (RAM)
Going to main memory to fetch data from a different location

The important things to remember are:


An instruction or data is fetched from memory

Page 9 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The instruction is decoded


The instruction is executed Your notes
The cycle repeats billions of times per second

Examiner Tips and Tricks


Make sure you read the question carefully and look at the number of marks allocated to judge the
level of detail required. Often questions on the fetch-decode-execute cycle only require you to
describe the steps rather than explain how the registers and buses are used during each step

Worked Example
Explain how an instruction is fetched using Von Neumann architecture
[6]
Answer
The Program Counter (PC) holds the address/location of the next instruction to be fetched [1]
The address held in the PC is sent to the Memory Address Register (MAR) [1]
The memory address is sent using the address bus [1]
The Program Counter is incremented [1]
The instruction is sent from the address in memory to the Memory Data Register (MDR) [1]
The instruction is transferred using the data bus [1]
The instruction is sent to the Current Instruction Register (CIR) [1]

Page 10 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Characteristics of the CPU


Your notes
Characteristics of the CPU
What are the common characteristics of the CPU?
There are 3 common characteristics
Clock Speed
Cache Size
Number of Cores
Each of these characteristics has a significant impact on the performance of the CPU

How do the characteristics of the CPU affect performance?


Clock speed
The clock speed is measured in Hertz (Hz)
The clock speed measures the number of fetch-decode-execute cycles that can take place in 1
second
The faster the clock speed, the more instructions can be fetched and executed per second

Page 11 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Modern computers have a clock speed in Gigahertz (GHz), meaning billion


A clock speed of 3.5GHz can perform up to 3.5 billion instructions per second Your notes
Cache size
Cache is very small, very fast memory on or close to the CPU
Cache is used as temporary storage to provide quick access to a copy of frequently used instructions
and data
The larger the cache size, the more frequently used instructions or data can be stored
This results in the CPU having to complete fewer fetch cycles from memory (RAM), speeding up the
performance
Cache also has a significantly faster read/write speed than RAM, making it much quicker to retrieve
instructions from there instead of from memory (RAM)

Number of cores
A core works like it is its own CPU
Multiple core processors mean they have multiple separate processing units that can fetch, decode
and execute instructions at the same time
For example, a dual-core processor would have 2 processing units, each with their own
Control Unit (CU)
Arithmetic Logic Unit (ALU)
Accumulator (ACC)
Registers
Multi-core processors can run more powerful programs with greater ease
Multiple cores increase the performance of the CPU by working with the clock speed
Example: A quad-core CPU (4 cores), running at a clock speed of 3Ghz
4 cores x 3GHz
4 x 3 billion instructions
12 billion instructions per second

Page 12 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Worked Example
One computer has a single core processor and the other has a dual core processor.
Explain why having a dual core processor might improve the performance of the computer
[2]
Answer
Any 2 from:
The computer with the dual core processor has two cores/double the amount of cores [1]
Parallel processing can take place [1]
Each core can execute a separate instruction at the same time [1]
Each core can process instructions independently of each other [1]

Page 13 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

CPU Instruction Sets


Your notes
CPU Instruction Sets
What is an Instruction set?
An instruction set is a list of all the commands that can be processed by a CPU
Each command has a binary code which is called machine code
The binary code is made up of an operation code (opcode) and an operand
The opcode is the operation to be performed
The operand is the location where the operation is to be performed in
The table below shows an example instruction set
Each instruction has a mnemonic that indicates what the instruction does alongside an example
binary code
After an instruction is decoded into an opcode and an operand, the CPU finds the opcode in the
processor’s instruction set
It then knows what operation to perform when executing the instruction

Instruction Mnemonic Binary code Command

Add ADD 10100001 Adds a value to the value currently stored in the accumulator
(ACC)

Subtract SUB 00100010 Subtract a value from the values stored in the accumulator

Load LDA 10111111 Load the value stored in a memory location into the
accumulator

Store STA 01100000 Store the value in the accumulator in a specific location in
memory

Stop HLT 00000000 Stop the program

Instruction lists are machine-specific

Page 14 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A program created using one computer’s instruction set would not run on a computer containing a
processor made by a different manufacturer
Your notes
For example, a computer program created using Intel’s instruction set would not run on a device
containing an ARM processor

Worked Example
Using the instruction set in the table above what would be the operation if the instruction was
00100010 00000010?
[1]
Answer
Either of:
The operation would be SUB [1]
If the operand was raw data the complete instruction would be to subtract 2 from the value in
the accumulator [1]

Page 15 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Embedded Systems
Your notes
Embedded Systems
What is an embedded system?
An embedded system is a computer system which is used to perform a dedicated function, inside a
larger mechanical unit
Examples of embedded systems include
Heating thermostats
Hospital equipment
Washing machines
Dishwashers
Coffee machines
Satellite navigation systems
Factory equipment
Security systems
Traffic lights

Page 16 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

What are the properties of an embedded system?


They are small in size
They use less power than a general-purpose computer
They have a lower cost

Examiner Tips and Tricks


Always use key examples from the list above and don’t try to use different examples such as a fridge
or kettle as these will not appear on mark schemes because although they have a single purpose,
most fridges and kettles do not have a CPU.

Worked Example
1) Tick two boxes below to show which are an example of an embedded system
[2]

Page 17 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Is it an example of an embedded system

Laptop Your notes

Washing Machine

Mobile Phone

Car Engine Management System

2) Justify your choice to question 1


[2]
Answers
1) Tick two boxes below to show which are an example of an embedded system. [2]

Is it an example of an embedded system

Laptop

Washing Machine ✓

Mobile Phone

Car Engine Management System ✓

2) Justify your choice to question 1 [2]


Any two of:
A washing machine and car engine management system are not general-purpose computers [1]
A washing machine and car engine management system have a single purpose and are both
housed inside a larger mechanical unit [1]
A washing machine and car engine management system have a microprocessor [1]

Page 18 of 18
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Input & Output Devices
Contents
Input Devices
Output Devices
Sensors

Page 1 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Input Devices
Your notes
Input Devices
What is an Input Device?
Input devices are hardware components that allow users to interact with a computer system
They enable the user to input data or commands into the system, which the computer then processes
to produce an output

Types of input devices


Device What It Does Where It Is Used Why It Is Used

Barcode Reads barcodes to Supermarkets Quickly and accurately


Scanner capture product retrieves product details
information. Warehouses for stock and checkout
Libraries

Digital Camera Captures photographs Photography High-quality visual


or videos as digital content
images Smartphones
Webcams

Keyboard Inputs text and Computers Type documents


commands by pressing
keys Tablets Enter data
Laptops Control software

Microphone Captures analogue Recording Audio recording


sound and converts it studios
into digital signals Voice communication
Smartphones
Computers

Page 2 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Optical Mouse Moves the cursor on the Computers Precise control and
screen based on hand navigation on a computer
Laptops Your notes
movements over a screen
surface

QR Code Reads QR codes to Retail shops Quickly retrieves data


Scanner access stored from QR codes
information Mobile apps
Website links or product
information

Touch Screen Detects touch by ATMs Direct interaction with the


(Resistive) pressing a flexible device
screen layer Older
smartphones
and tablets

Touch Screen Detects touch by Kiosks Accurate touch detection


(Infra-red) interrupting infrared
light beams across the Large touch Works well in various
screen displays lighting conditions

Touch Screen Detects touch through Modern Smooth, responsive


(Capacitive) changes in electrical smartphones touch experience with
charge on the screen multi-touch capabilities
surface Tablets
Touch monitors

Two- Captures flat, 2D Offices Digitises documents and


Dimensional images of documents photos for storage,
(2D) Scanner or photos Libraries editing, or sharing
Schools

Three- Captures detailed 3D Manufacturing Creates digital models of


Dimensional shapes and dimensions objects for design,
(3D) Scanner of objects Design analysis, or reproduction
Medical imaging

Page 3 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Output Devices
Your notes
Output Devices
What is an Output device?
Output devices are hardware components that receive information from a computer system and
present it to the user in an understandable form
They enable the computer to communicate the results of processed data or commands

Types of output devices


Name of device What does it do? Where is it used? Why is it used?

Actuator Converts energy into motion Make a robot's Essential in any


arm move system that requires
Makes things move movement
Open a valve
Performs physical tasks
based on instructions from a Rotate a motor
computer or control system

Digital Light Projects images onto a Cinemas High-quality images


Processing (DLP) screen
projector Classrooms
Shows images or video by
shining light through tiny Large
mirrors presentations

Inkjet printer Prints text and images onto Home Low cost compared
paper by spraying tiny to other types of
droplets of ink Schools printer
Offices

Laser printer Heat from a laser fuses toner Offices High-quality prints
(fine powder) onto paper
Schools Fast print speed

Page 4 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Light Emitting Displays images and video Televisions High-quality images


Diode (LED) using tiny lights called LEDs
Computer Bright Your notes
screen
monitors
Energy efficient
Smartphones
Thin

Liquid Crystal Projects images or video Offices Bright


Display (LCD) onto a screen by shining
projector light through liquid crystal Classrooms Excellent balance of
panels quality and
Home cinemas affordability

Liquid Crystal Displays images and video Televisions Energy efficient


Display (LCD) using liquid crystals with a
screen backlight Monitors Thin
Smartphones Sharp images
Laptops Lightweight

Speaker Converts electrical signals Televisions Multiple shapes and


into analogue sound waves sizes
to play music Radios
Smartphones

3d printer Adds thin layers of plastic, Manufacturing Create prototypes


one on top of another to
form a three dimensional Medicine Custom parts
object Education
Home

Choosing the right device


When recommending a device for a specific situation, consider the following factors:
User Needs
What tasks will the user be performing? A graphic designer might need a graphics tablet, while a
data entry clerk might need a keyboard with a number pad
User Skills

Page 5 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Is the user comfortable with the device? A touch screen might be more intuitive for some users,
while others might prefer a mouse and keyboard
Environment Your notes
Where will the device be used? A wireless mouse might be suitable for a clutter-free office, while a
wired mouse might be better for a public computer lab to prevent theft
Cost
Higher-end devices often have more features but are also more expensive. Consider the budget
and whether the extra features are worth the cost

Page 6 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Sensors
Your notes
Sensors
Sensors are input devices
They measure a physical property of their environment such as light levels, temperature or movement
Sensors can be used for monitoring systems and control systems
A monitoring system tracks the state of a system, it gathers data and may issue warning
messages
A control system will control the system based upon the input from sensors
For example, if the water temperature in a fish tank fell below the acceptable level, a control
system would start up a heater
The system will then continue to check the water temperature readings (outputs) and when they
are within the acceptable range it will switch off the heater
A process where outputs are recycled and used as inputs, creating a continuous cycle is called a
feedback loop

Examiner Tips and Tricks


You are likely to be given a scenario and asked to identify the sensors that would be used.
The 14 sensors you need to be aware of are in the table below

Sensor type What it measures Typical use

Acoustic Sound levels To detect changes in sound levels of industrial


machinery
To monitor noise pollution
In security system to detect suspicious sounds

Accelerometer Acceleration rate, tilt, Detecting sudden changes in vehicle movement and
vibration deploy safety features if needed
In mobile phones to detect orientation of the device

Page 7 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Flow Rate of gas, liquid or powder Detect changes in the flow through pipes in water
flow system
Your notes
Gas Presence of a gas e.g. Detect levels of gas in confined spaces
carbon monoxide
Detect gas levels when fixing gas leaks

Humidity Levels of water vapour Monitor humidity in greenhouses

Infra-red Detecting motion or a heat Security systems detecting intruders who break the
source beam
Measures heat radiation of objects - used by
emergency services to detect people

Level Liquid levels Detects levels of petrol in a car tank


Detect levels of water in a water tank
Detect a drop in water levels due to a leak

Light Light levels Automatically switching on lights when it gets dark


(street lights, headlights)

Magnetic field Presence and strength Anti-lock braking system


Monitoring rotating machinery such as turbines

Moisture Presence and levels of Monitoring moisture in the soil


moisture
Monitoring dampness in buildings

pH Acidity or alkaline Monitoring soil to ensure optimum growing conditions


Monitor ph levels in chemical processes

Pressure Gas, liquid or physical Monitoring tyre pressure


pressure
Monitoring pressure in pipes during the manufacturing
process

Proximity Distance Monitoring the position of objects in robotics

Page 8 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Used in safety systems to prevent objects from


colliding
Your notes
Temperature Temperature in Celsius, Used to maintain temperature in swimming pools
Fahrenheit or Kelvin
Used to control temperature in chemical processes

Worked Example
What type of sensor would be used to help drivers when reversing? [1]

A Motion

B Infra-red

C Light

D Proximity

Is this a monitoring system or a control system? [1]

A Monitoring

B Control

Answer

A Motion

B Infra-red

C Light

D Proximity

A Monitoring

B Control

Page 9 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Data Storage
Contents
Primary Storage
Secondary Storage
Virtual Memory
Cloud Storage

Page 1 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Primary Storage
Your notes
Primary Storage
Primary storage is directly accessed by the CPU
Computer systems need both primary and secondary storage to operate
Both types of storage play a crucial role in the operation of a computer system
A quick comparison of primary and secondary storage shows:

Primary Secondary

Volatile (with the exception of ROM) Non-volatile

Small capacity Large capacity

Why do you need primary storage?


A computer needs primary storage because access times are considerably faster than secondary
This means the time taken to complete operations such as the Fetch-Execute Cycle is dramatically
reduced
Primary storage holds the data and instructions that the CPU needs to access whilst the computer is
turned on
Due to the fast access times, primary storage is used as short-term, working memory, in hardware
that is directly connected to the CPU such as RAM, and components that reside inside the CPU such
as Cache and Registers
Performance of primary storage means a much higher cost which limits the amount that is used
For example, RAM is commonly purchased in 16 or 32 gigabytes whereas secondary storage such as a
hard drive is in terabytes

RAM
What is RAM?
RAM (Random Access Memory) is primary storage that is directly connected to the CPU and holds the
data and instructions that are currently in use
RAM is volatile which means the contents of RAM are lost when the power is turned off
Page 2 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

For the CPU to access the data and instructions they must be copied from secondary storage
RAM is very fast working memory, much faster than secondary storage Your notes
RAM is read/write which means data can be read from and written to
In comparison to ROM, it has a much larger capacity

Examiner Tips and Tricks


Just knowing what RAM is and what it stores is not enough, you must be able to apply your
understanding of RAM to real world contexts where RAM is a component, e.g. TVs, game consoles
and other smart devices

Worked Example
A smart television allows the user to search the Internet and watch videos online.
The smart television uses RAM
Give two examples of data that the smart television could store in RAM [2]
How to answer this question
Think about the main function of a smart television, watch channels, use apps to stream content
and browse the web etc
For each function, try to think of what data would have to be in the RAM whilst you were actually
doing it (in use!)
Possible answers
Current channel being watched
Current volume
Current video/file/tv program being watched
Web browser/applications that are running
Data being downloaded/buffered

Examiner Tips and Tricks

Page 3 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Examiners will accept anything reasonable when answering these style of questions BUT brand
names will not be be awarded without giving an example
Your notes
ROM
What is ROM?
ROM (Read Only Memory) is primary storage that holds the first instructions a computer needs to start
up (Bootstrap)
ROM contains the BIOS (Basic Input Output System)
ROM is a small memory chip located on the computers motherboard
ROM is fast memory, much faster than secondary storage but slower than RAM
ROM is non-volatile which means the contents of ROM are not lost when the power is turned off
ROM is read only which means data can only be read from
In comparison to RAM, it has a much smaller capacity

Examiner Tips and Tricks


RAM & ROM are examples of primary storage, they can be referred to as Main Memory or Primary
Memory in the exam

Worked Example
Quinn has 512 kilobytes of ROM and 16 gigabytes of RAM in her computer
1. Describe the purpose of the ROM in Quinn's computer [2]
2. Describe the purpose of the RAM in Quinn's computer [2]
Answer
1. ROM
Store start-up instructions/bootstrap
Used to start the computer
2. RAM
Stores the parts of the OS / programs that are running

Page 4 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Stores data currently in use


...for access by the CPU
Guidance Your notes
Do not confuse the purpose with characteristics, describe what it does, not what it is

Page 5 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Secondary Storage
Your notes
Secondary Storage
Storage devices are non-volatile secondary storage, that retain digital data within a computer system
They provide a means of storing, accessing, and retrieving data, which can include software
applications, documents, images, videos, and more
There are 3 types of storage:
Magnetic
Solid-state (flash memory)
Optical
Computer systems need both primary and secondary storage to operate
Both types of storage play a crucial role in the operation of a computer system
A quick comparison of primary and secondary storage shows:

Primary Secondary

Volatile (with the exception of ROM) Non-volatile

Small capacity Large capacity

Why do you need secondary storage?


A computer needs secondary storage for long term storage of programs and data that are currently
not in use
Secondary storage is needed as ROM is read only and RAM is volatile
Secondary storage holds the programs and data whilst the computer is turned off (non-volatile)
Performance of secondary storage is slower than primary storage but capacity is much higher which
makes it perfect for backup & archive of data files

What are the characteristics of secondary storage?


Capacity - What is the maximum amount of data that can be stored?
Speed - How fast can data be read from and written to? (R/W)

Page 6 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cost - How much does it cost?


Portability - How easy is it to move around? What is the physical size? Weight? Your notes
Durability - How robust is the storage?
Reliability - What is the probability that the device will consistently perform its function?

Worked Example
A games console has secondary storage.
State, using an example, why the games console needs secondary storage [2]
How to answer this question
They keyword is 'why', why does a games console need secondary storage? give an example,
do not just describe what secondary storage is!
Answer
To store data once the power is turned off / permanently // for non-volatile storage
Examples could include:
Storing games
Save games
User data/profiles
Downloaded content/applications/updates

Magnetic Storage
What is magnetic storage?
Magnetic storage is a type of non-volatile media that uses magnets (polarity) to store binary 0s and 1s
A magnetic hard disk is made up of several metal discs coated with a magnetic material
These are called platters
Iron particles on each platter are magnetised to represent a 0 or 1

Page 7 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Each platter is divided by concentric circles creating several tracks and wedge shaped sectors
Where they intersect is a track sector

Page 8 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The hard drive spins the metal disk(s) at a high speed (typically around 5400-7200 RPM) using a motor
A read/write arm, controlled by an actuator, moves the head over the surface of the disc to the Your notes
location of the data
The data is read/written using electromagnets

Advantages Disadvantages

Capacity - High storage Durability - Moving parts can get damaged if dropped

Cost - Low per gigabyte Portability - Heavy & bulky making them less convenient for
transport

Speed - Moderate read/write Reliability - Prone to mechanical failure


access

Noise - Loud (spinning disks)

Solid-state (Flash Memory)


What is solid state (flash memory)?
Solid-state (flash memory) storage is a type of non-volatile media that uses electronic circuits to
store binary 0s and 1s
Examples of solid state storage devices include:
Solid state drives (SSD) - replacing magnetic hard drives as a computers primary secondary
storage device as capacity increases and cost decreases
USB flash memory - most common form of portable storage device
It uses NAND and NOR gates in electrical circuits to persistently control the flow of electrons

Page 9 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Solid-state (flash memory) is memory made up of tiny cells that can contain one bit of data (1 or 0)
Each cell contains a transistor that acts as a switch that can be turned on or off Your notes
The transistor contains two main parts:
Control gate - top layer of transistor, connects to circuit and controls if current can flow through
the transistor
Floating gate - can hold a charge (like a tiny rechargeable battery) and is sandwiched between two
layers of insulating material (Oxide)
To store data a charge is placed on the floating gate
A high voltage is applied to the control gate, which allows electrons to be pushed through the
oxide layer and onto the floating gate
To remove data, a high voltage charge is applied in the opposite direction, pulling the electrons off
the floating gate

Advantages Disadvantages

Capacity - Medium/high storage Cost - Very high per gigabyte

Speed - Very fast read/write access Reliability - Limited read/write cycles

Durability - No moving parts

Portability - Small and no moving parts

Noise - Silent

Optical Storage
What is optical storage?
Optical storage is a type of non-volatile media that uses lasers to burn the surface of a disk, creating
pits and lands suitable for storing binary 0s and 1s
Examples of optical storage include:
Blu-rays have the largest capacity
CDs have the lowest capacity

Page 10 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

CD-R are read-only (you cannot save data on to them)


CD-RW can be written to and read from Your notes
DVD-RW can be written to and read from

All optical devices work by shining a laser at the disk and processing the reflection
An arm moves the laser across the surface of the disk
In CD-Rs a laser burns the data, permanently on to the disk, by creating pits and lands
The laser is also used to read the data from the pits and lands
When the laser light hits the point where the pit changes into a land or vice versa the light scatters and
is not reflected back as well.
This is captured by a sensor and can be interpreted as a change in the binary value

Advantages Disadvantages

Cost - Very low per gigabyte Capacity - Very low

Durability - No moving parts Speed - Very slow read/write access

Portability - Small and no moving parts Reliability - Prone to scratches

Noise - Silent

Worked Example

Page 11 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Zarmeen has purchased a new tablet computer. The tablet has an internal secondary storage
device.
Your notes
The storage device is a solid state device.
1. Give three benefits of the tablet having a solid state device instead of a magnetic device [3]
2. Give two drawbacks of the tablet having a solid state device instead of a magnetic device [2]
Answers
Benefits
Faster access / read/write speeds
Smaller in physical size
More durable // no moving parts
Drawbacks
More expensive (per gigabyte)
Smaller capacity (usually)
Limited number of read/write cycles
Guidance
Portable is not enough on it's own
No moving parts is not enough on it's own

Page 12 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Virtual Memory
Your notes
Virtual Memory
What is virtual memory?

Virtual memory is an extension of primary storage (RAM) located on secondary storage


In situations where RAM is close to being full, virtual memory can be used so that the computer remains
operational
Programs and data not currently being executed are transferred to virtual memory
Programs and data are transferred back to RAM when they are needed
Programs are stored as pages of data
Pages of data are transferred between RAM and virtual memory when needed
Virtual memory is much slower than RAM and its use will impact negatively on system performance
To avoid the use of virtual memory, increase the size of the RAM

Example

Page 13 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

In the example above, the computer is turned on and the elements of the operating system are loaded
into RAM
Your notes
The user opens some spreadsheet and video editing software but RAM is full
The program not currently being used (video editing) is transferred to virtual memory
When the user wants to use the video editing software again, it is transferred back from virtual memory
to RAM

Case Study
A student uses software to create 3D models.
3D modelling often means processing large amounts of data
This takes up a large amount of RAM
If there is not enough physical RAM, virtual memory is used to:
Extend the RAMs capacity
Ensure the software does not freeze/crash when RAM gets full

Worked Example
A computer only has 4GB of RAM, Fynn says that virtual memory can be used instead of adding more
RAM.
1. Explain how virtual memory can compensate for the lack of RAM in Fynn's computer [3]
2. Explain why it would be beneficial for Fynn to get more RAM instead of relying on virtual memory
[2]
How to answer these questions
1. What is the definition of virtual memory? how does it work?

Page 14 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

2. What is the downside of using virtual memory? turn this into an advantage of adding more RAM
Answers
Your notes
How can Virtual Memory compensate
Virtual Memory is used when RAM is full
...part of the secondary storage used as (temporary) RAM
Data from RAM is moved to the secondary storage/Virtual Memory (to make space in RAM)
RAM can then be filled with new data
When data in Virtual Memory is needed it is moved back to RAM
Benefit of more RAM
More RAM will improve the performance of the computer // More RAM will speed up the
access to data
Virtual Memory is slower to access than RAM direct (because it has to go back to RAM first)
Moving data between RAM and VM takes processor time

Page 15 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cloud Storage
Your notes
Cloud Storage
What is cloud storage?
Cloud storage is a term to describe long-term (secondary) storage of data that resides in a remote
location, accessible only via a wide area network (Internet)
Data is stored on remote servers, typically using magnetic storage (HDD), but increasingly using solid
state (SSD)

Advantages Disadvantages

Reliability - Access data anywhere, any time, from any Cost - Typically a monthly/yearly
device subscription plan

Security - Automatic backups Availability - No access without an


internet connection

Capacity - Endless storage space (cost permitting), uses


less space on own device

Collaboration - Multiple people can access the same file at


the same time

Page 16 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Advantages of Cloud Storage


Cloud storage offers several advantages over storing data on a local secondary storage device

Benefit Explanation

Accessibility Data can be accessed from anywhere


Data can be accessed by anyone with the relevant permissions, making it quick to
share files and collaborate with others
Data can be accessed on any device with an internet connection

Scalability Cloud storage providers allow customers to increase or decrease their storage
capacity as needed

Page 17 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Reliability Cloud storage providers often use multiple servers to store and backup data,
reducing the risk of data loss due to hardware failure
Your notes
Security Cloud storage providers offer advanced security features, such as data encryption
and multi-factor authentication multi-factor authentication, to protect user data
from unauthorised access
There is no need to hire specialist staff as IT services being provided by the cloud
storage provider

You also do not need to purchase local secondary storage devices


One cloud storage centre is more environmentally friendly than millions of individual servers
There are some drawbacks to using cloud storage
If the user has a slow or unreliable internet connection they would have problems accessing their
files
If you are storing a lot of data it can be expensive
You have to pay the cloud storage provider
You may need to commit to an annual subscription
You may have to pay for high download and upload data transfer limits
Data being sent over the internet has the potential to be intercepted
Security is managed by the cloud storage provider which means the user does not have complete
control over it but is still legally responsible for ensuring any personal and sensitive data is secure

Worked Example
A school currently stores all of their data on local servers. They are considering upgrading their
system to utilise cloud storage.
Explain two disadvantages to the school of storing their data in the cloud.
[4]
You need a constant internet connection [1]
if the internet connection failed, teachers would not be able to access lesson files [1]
if the internet connection failed, teachers would not be able to access student data/take
electronic registers [1]
Page 18 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

if the internet connection failed, students would not be able to access their work/coursework [1]
Reliant on third party to carry out security procedures [1]
but the school is still legally responsible if data is accessed by unauthorised people [1] Your notes
Data stored on the cloud could be hacked or intercepted [1]

Explain two advantages to the school of storing their data in the cloud.
[4]
Additional storage can be purchased if needed [1]
The cloud hosting company provides back up [1]
The cloud hosting company provides security [1]
Data can be accessed from anywhere and from any device provided there is an internet
connection [1]
So teachers would be able to access data from home [1]
So students would be able to access work from home [1]

Page 19 of 19
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Network Hardware
Contents
Network Interface Card (NIC)
MAC Addresses & IP Addresses
Router

Page 1 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Network Interface Card (NIC)


Your notes
Local Area Network Hardware: Network Interface
Card (NIC)
Network hardware is a selection of essential components that enable the connectivity and
communication of devices within computer networks
Networks use a variety of hardware to function, some of which include:
Router
Wireless access point (WAP)
Switch
Transmission media
Network interface card (NIC)
The exam requires you to understand the purpose of the network interface card (NIC)

What is a network interface card (NIC)?


The Network Interface Card (NIC) is required for a computer to connect to a network
A NIC can be both wired and wireless and allows your computer to send and receive data over a
network

Page 2 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 3 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

MAC Addresses & IP Addresses


Your notes
Devices on a network send and receive data, a device needs an address to ensure it sends data to the
correct place
There are two types of network address systems:
MAC Address
IP Address

MAC Addresses
What is a MAC address?
A MAC (Media Access Control) address is a unique identifier given to devices which communicate over
a local area network (LAN)
A network interface card is given a MAC address at the point of manufacture
MAC addresses are static, meaning they can never change
MAC addresses make it possible for switches to efficiently forward data to the intended recipient
Any device that contains a Network Interface Card (NIC) has a MAC address assigned during
manufacturing
A device connecting to a local network already has a MAC address, if it moves to a different network
then the MAC address will stay the same

A MAC address is represented as 12 hexadecimal digits (48 bits), usually grouped in pairs
The first three pairs are the manufacturer ID number (OUI) and the last three pairs are the serial number
of the network interface card (NIC)
There are enough unique MAC addresses for roughly 281 trillion devices

Page 4 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

IP Addresses
Your notes
What is an IP address?
An IP (Internet Protocol) address is a unique identifier given to devices which communicate over the
Internet (WAN)
IP addresses can be static, meaning they stay the same or dynamic, meaning they can change
IP addresses make it possible to deliver data to the right device
A device connecting to a network will be given an IP address, if it moves to a different network then the
IP address will change

IPv4
Internet Protocol version 4 is represented as 4 blocks of denary numbers between 0 and 255,
separated by full stops
Each block is one byte (8 bits), each address is 4 bytes (32 bits)

IPv4 provides over 4 billion unique addresses (232), however, with over 7 billion people and countless
devices per person, a solution was needed

IPv6
Internet Protocol version 6 is represented as 8 blocks of 4 hexadecimal digits, separated by colons
Each block is 2 bytes (16 bits), each address is 16 bytes (128 bits)

Page 5 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

IPv6 could provide over one billion unique addresses for every person on the planet (2128)

Worked Example
Computers in a network can be identified using both IP addresses and MAC addresses.
Describe two differences between IP addresses and MAC addresses [2]
Answer
IP address is dynamic/can change // MAC address is static/cannot change
IP address is used to communicate on a WAN/Internet // MAC address is used to communicate
on a LAN

Page 6 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Router
Your notes
Router
What is a router?
The router is responsible for routing data packets between different networks
An example of data the router can direct is, sending internet traffic to the correct destination/devices
in your home network
The router connects networks together, local area networks (LAN) to the wider internet which is a type
of wide area network (WAN)
The router can manage and prioritise data traffic, which can help to keep connections stable
The router will assign IP addresses to the devices on the network

Image of a router

Page 7 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Image of how a router connects LANs to other networks

Worked Example
State 3 tasks carried out by a router [3]
To answer the question you must simply identify 3 tasks a router does
1 mark each to max 3 e.g.
Send and Receive packets of data
Connect a local network to the internet
Assign IP addresses to nodes/devices
Converts packets from one protocol to another

Page 8 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Types of Software & Interrupts
Contents
System Software & Application Software
The Purpose & Functionality of Operating Systems
Hardware, Firmware & the Operating System
Interrupts

Page 1 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

System Software & Application Software


Your notes
System Software & Application Software
Software can be broken down in to two categories, system and application software

What is system software?


System software is software essential for the operation of the computer system
It gives users a platform to run applications and carry out tasks
Examples of system software include:
The operating system
Utility software

Utility software
Utility software is software designed to help maintain, enhance and troubleshoot/repair a computer
system
Designed to perform a limited number of tasks

Page 2 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Interacts with the computers hardware, for example, secondary storage devices
Some utility software comes installed with the operating system Your notes
Examples of utility software and their function are:
Defragmentation (maintain)
Compression (enhance)
Encryption (enhance)
Task manager (troubleshoot/repair)
What is application software?
Application software (abbreviated 'apps') is software chosen by a user to help them carry out a
specific task
Installed on top of system software and is user chosen to best suit induvial requirements
Common categories of application software include:
Productivity - get things done efficiently (word processors, spreadsheets & presentation)
Communication - stay connected (email, browser, messaging)
Entertainment - Watch movies, play games or listen to music

Examiner Tips and Tricks


Do not use brand names when talking about software, it is ok to talk about software categories or
software types but brand names do not get awarded marks
e.g. word processors instead in Microsoft Word

Page 3 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The Purpose & Functionality of Operating Systems


Your notes
What is an operating system?
An operating system (OS) is software that manages computer hardware and provides a platform for
running applications
It provides an interface between the user and the hardware in a computer system
It hides the complexities of the hardware from the user, for example:
A user does not need to know 'where' on secondary storage data is kept, just that it is saved for
when they want it again
An operating systems main functions can be divided in to eight key areas

File Management
What is file management?
File management is a process carried out by the operating system creating, organising, manipulating
and accessing files and folders on a computer system
The OS manages where data is stored in both primary and secondary storage
File management gives the user the ability to:
Create files/folders
Name files/folders
Rename files/folders
Copy files/folders
Move files/folders
Delete files/folders
The OS allows users to control who can access, modify and delete files/folders (permissions)
The OS provides a search facility to find specific files based on various criteria

Handling Interrupts
What is interrupt handling?
Interrupt events require the immediate attention of the central processing unit

Page 4 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

In order to maintain the smooth running of the system, interrupts need to be handled and processed in
a timely manner
Your notes
For example, if a user clicks cancel on a file conversion process, a signal is sent from the mouse,
interrupts the processor, and the operating system will trigger the cancellation routine
User Interface
What is a user interface?
A user interface is how the user interacts with the operating system
Examples of user interfaces include:
Command Line Interface (CLI)
Graphical User Interface (GUI)
Menu
Natural language (NLI)

What is a command line interface?


A Command Line Interface (CLI) requires users to interact with the operating system using text based
commands
CLIs are more commonly used by advanced users
Examples of CLIs are MSDOS (Microsoft Disk Operating System) and Raspbian (for Raspberry Pi)

What is a graphical user interface?

Page 5 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A Graphical User Interface (GUI) requires users to interact with the operating system using visual
elements such as windows, icons, menus & pointers (WIMP)
Your notes
GUIs are optimised for mouse and touch gesture input
Examples of GUIs are Windows, Android and MAC OS

What is a menu interface?


A menu interface is successive menus presented to a user with a single option at each stage
Often performed with buttons or a keypad
Examples include
Chip and pin machines
Vending machines
Entertainment streaming services

What is a natural language interface?


A natural language interface (NLI) uses the spoken word to respond to spoken or textual inputs from a
user
Examples include
Virtual assistants - Amazon Alexa, Google Assistant, Siri
Search engines
Smart home devices

Advantages and disadvantages of user interfaces


Interface Advantages Disadvantages

Command line Uses less system resources Requires users to remember


(CLI) commands
Useful for automation of tasks
Typing errors are common
Commands are often faster to type than
navigating menus Less intuitive than GUI

Graphical (GUI) Intuitive and user-friendly Uses more system resources


Requires no previous knowledge to use Can be slower to find and
execute commands

Page 6 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Information is visual, making it easier to Can be frustrating when doing


understand repetitive tasks
Your notes
Menu Simplicity Limited flexibility
Efficiency Accessibility issues

Natural language Can be used by people with disabilities Not always reliable
(NLI)
Intuitive Privacy concerns

Peripheral Management & Device Drivers


What is peripheral management?
Peripheral management is a process carried out by the operating system managing the way
peripherals (hardware) interact with software
The OS allocates system resources to peripherals to ensure efficient operation
Peripheral management makes plug-and-play (PnP) functionality possible, automatically detecting
and configuring new peripherals without the need for manually installing device drivers or power
cycling the system

What is a device driver?


A device driver is a piece of software used to control a piece of hardware
Peripherals require device drivers in order to be used by the operating system
The OS has generic device drivers built in which makes basic compatibility possible and enables
plug-and-play (PnP)
In order for hardware to be used to its maximum capacity, often a separate device driver must be
downloaded from the manufacturer
Device drivers are OS specific and are regularly updated

Memory Management & Multitasking


What is memory management?
Memory management is a process carried out by the operating system allocating main memory (RAM)
between different programs that are open at the same time

Page 7 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The OS is responsible for copying programs and data from secondary to primary storage as it is
needed
Your notes
Programs and data require different amounts of RAM to operate efficiently and the OS manages this
process
RAM is allocated based on priority and fairness, for example, system applications (essential) may have
a higher priority than user applications
The OS dynamically manages the memory, adjusting allocation as needed to maintain optimal system
performance
Memory management makes multitasking possible
What is multitasking?
Multitasking is a process made possible by the OS simultaneously managing system resources
(memory, CPU etc) to give a user the perception of being able to use multiple programs at the same
time
The OS splits tasks and allocates system resources based on a priority
The CPU can only execute one instruction at a time, it can can execute billions of them in one second.
This makes it appear that multiple programs are running at the same time

Providing a Platform for Running Applications


Operating systems provide a platform on which application software can run, this is mainly by
allowing software access to system resources
For example, if a computer game has intensive graphics and online play, the operating system will grant
it access to the GPU and the network card

Page 8 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Organisation of application layer, operating system components, and input/output

Providing System Security


What is system security?
Operating systems provide various security features such as password-protected system accounts, a
firewall, virus scanning and file encryption
Password-protected system accounts are a very common feature in operating systems

Page 9 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

System accounts can also be restricted from performing certain actions, e.g. editing network settings,
installing unapproved software, changing the account settings of other users
Your notes
User Management
What is user management?
User management is a process carried out by the operating system enabling different users to log onto
a computer
The OS is able to maintain settings for individual users, such as desktop backgrounds, icons and colour
schemes
A system administrator is able to allocate different access rights for different users on a network

Worked Example
Ella uses her computer to create artwork for a magazine
Ella makes use of system software.
One type of system software is the operating system.
Identify and describe two functions of an operating system [6]
How to answer this question
Break down the 6 marks, 1 mark each for identifying a function of the operating system. For each
function you need to make 2 points about how they work
Answer
Memory management
Allocates memory to programs currently in use
Gets data from RAM
Stores data in RAM
File management
Creating/editing/renaming files
Creating/editing/renaming folders
Movement of files/folders

Page 10 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Hardware, Firmware & the Operating System


Your notes
Hardware, Firmware & the Operating System
How does application software, the operating system and
hardware communicate?
Application software talks to the operating system, this allows it to interact with the hardware
The hardware processes and sends the information to the operating system which talks directly to the
applications software
This process is repeated while application software is in use

Page 11 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

What is firmware?
Firmware is embedded directly in to the hardware of a device, to make them function
When a computer is turned on, it has to explore the ROM for its initial boot-up instructions, these are
contained in a Bootstrap loader
The initial process is handled by the basic input/output system (BIOS) which is known as firmware
Once start-up is complete, instructions are sent to RAM to be processed by the operating system

Page 12 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

This layer ensures that hardware devices e.g. keyboard and mouse are available and can be
communicated directly by the operating system
Your notes
Firmware translates between the hardware and the software

Page 13 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Interrupts
Your notes
Interrupts
What is an interrupt?
An interrupt is a signal for the CPU to stop what it is currently doing and do something else as a higher
priority
The CPU is in a continuous loop of carrying out the fetch-decode-execute cycle, however there are
occasions when this needs to be interrupted

How is an interrupt generated?


An interrupt can be generated by hardware and software:
Hardware - this is caused by a hardware device such as a hardware failure
Software - this occurs when an application stops or requests services from the OS
Interrupts are added to an area called the interrupt service routine
The interrupt service routine holds instructions that will need to be fetched, decoded and executed to
complete the commands of the interrupt
The contents of the registers within the CPU cannot be lost by an interrupt, so contents are copied to a
reserved area in RAM called a stack
Contents are added to the top of the stack, which will save them for later retrieval when the interrupt is
complete
The interrupt will be executed instead of the original instructions

What are examples of hardware interrupts?


Hardware
power button may have been pressed
moving the mouse
clicking an icon to open a new program
keyboard presses e.g. ctrl, alt, delete

What are examples of software interrupts?


Software

Page 14 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

a program is not responding


division by zero Your notes
two processes trying to access the same memory location

Examiner Tips and Tricks


The main focus of interrupts is the importance of the interrupt service routine and the role it plays in
moving current instructions to the stack so that they can be interrupted BUT continue again
afterwards

Worked Example
Describe the purpose of an interrupt in a computer system
[4]
Answer
Four from:
Used to attend to certain tasks/issues
Used to make sure that vital tasks are dealt with immediately
The interrupt/signal tells the CPU/processor (that its attention is required)
A signal that can be sent from a device (attached to the computer)
A signal that can be sent from software (installed on the computer)
The interrupt will cause the OS/current process to pause
The OS/CPU/ISR will service/handle the interrupt
They have different levels of priority
After the interrupt is serviced, the (previous) process is continued
It enables multi-tasking to be carried out on a computer
A valid example of an interrupt e.g. ‘out of paper’ message for a printer

Page 15 of 15
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Types of Programming Language, Translators &
Integrated Development Environments (IDEs)
Contents
Levels of Programming Languages
Assembly Language
Translators, Compilers & Interpreters
Tools & Facilities in IDEs

Page 1 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Levels of Programming Languages


Your notes
What is a programming language?
A programming language acts as a bridge between what humans understand and what a computer
understands
Early computers were complex and instructions would have to be in written in binary code, 0s and 1s
This process was slow, taking days to program simple tasks
Over time, new generations of programming languages have enabled people to become faster and
more efficient at writing programs as they resemble human language
Generations of programming languages can be split in to two categories:
Low-level
First generation
Second generation
High-level
Third generation

Low-Level Languages
What is a low-level language?
A low-level language is a programming language that directly translates to machine code understood
by the processor
Low-level languages allow direct control over hardware components such as memory and registers
These languages are written for specific processors to ensure they embed the correct machine
architecture

First generation
Machine code is a first-generation language
Instructions are directly executable by the processor
Written in binary code

Second generation

Page 2 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Assembly code is a second-generation language


The code is written using mnemonics, abbreviated text commands such as LDA (Load), STA(Store) Your notes
Using this language programmers can write human-readable programs that correspond almost
exactly to machine code
One assembly language instruction translates to one machine code instruction
Needs to be translated into machine code for the computer to be able to execute it

Advantages Disadvantages

Complete control over the system Difficult to write and understand


components

Occupy less memory and execute faster Machine dependent

Direct manipulation of hardware More prone to errors

Knowledge of computer architecture is key to program


effectively

High-Level Languages
What is a high-level language?
A high-level programming language uses English-like statements to allow users to program with easy
to use code
High-level languages allow for clear debugging and once programs are created they are easier to
maintain
High level languages were needed due to the development of processor speeds and the increase in
memory capacity
One instruction translates into many machine code instructions
Needs to be translated into machine code for the computer to be able to execute it
Examples of high-level languages include:
Python
Java

Page 3 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Basic
C+ Your notes
Advantages Disadvantages

Easier to read and write The user is not able to directly manipulate the
hardware

Easier to debug Needs to be translated to machine code before


running

Portable so can be used on any computer The program may be less efficient

One line of code can perform multiple


commands

Page 4 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Assembly Language
Your notes
Assembly Language
What is assembly language?
Assembly language is a second generation, low-level language designed to simplify the writing of
machine code instructions for programmers
Programmers use assembly language for the following reasons:
Need to make use of specific hardware or parts of the hardware
To complete specific machine dependent instructions
To ensure that too much space is not taken up in RAM
To ensure code can completed much faster
Assembly languages allow programmers to program with mnemonics. e.g.
LDA Load - this will ensure a value is added to the accumulator
ADD Addition - this will add the value input or loaded from memory to the value in the accumulator
STO, Store - stores the value in the accumulator in RAM
Assembly language allowed continuation of working directly with the hardware but removed an
element of complexity
A mnemonic is received by the computer and it is looked up within a specific table
An assembler is needed to check the word so that it can be converted into machine code
If a match from the word is found e.g. STO the word is replaced with the relevant binary code to match
that sequence

Worked Example
Complete the table to identify whether each example of computer code is High-level, Assembly
language or Machine code

Computer code High-level Assembly Machine code

10110111

Page 5 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

00110110
11100110 Your notes
FOR X = 1 to 10
PRINT x
NEXT X

INP X
STA X
LDA Y

[3]
Answer

Computer code High-level Assembly Machine code

10110111 X
00110110
11100110

FOR X = 1 to 10 X
PRINT x
NEXT X

INP X X
STA X
LDA Y

Page 6 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Translators, Compilers & Interpreters


Your notes
Translators, Compilers & Interpreters
What is a translator?
A translator is a program that translates program source code into machine code so that it can
executed directly by a processor
Low-level languages such as assembly code are translated using an assembler
High-level languages such as Python are translated using a compiler or interpreter

What is a compiler?
A compiler translates high-level languages into machine code all in one go
Compilers are generally used when a program is finished and has been checked for syntax errors
Compiled code can be distributed (creates an executable) and run without the need for translation
software
If compiled code contains any errors, after fixing, it will need re-compiling

Advantages Disadvantages

Speed of execution Can be memory intensive

Optimises the code Difficult to debug

Original source code will not be seen Changes mean it must be recompiled

It is designed solely for one specific processor

What is an interpreter?
An interpreter translates high-level languages into machine code one line at a time
Each line is executed after translation and if any errors are found, the process stops
Interpreters are generally used when a program is being written in the development stage
Interpreted code is more difficult to distribute as translation software is needed for it to run

Page 7 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Advantages Disadvantages
Your notes
Stops when it finds a specific syntax error in the Slower execution
code

Easier to debug Every time the program is run it has to be


translated

Require less RAM to process the code Executed as is, no optimisation

Worked Example
A computer program is written in a high-level programming language.
(a) State why the computer needs to translate the code before it is executed.[1]
(b) Either a compiler or an interpreter can translate the code. Describe two differences between
how a compiler and an interpreter would translate the code.[2]
How to answer this question
(a) what time of language does a computer understand?
(b) the keyword is 'how'
Answer
(a)
To convert it to binary/machine code
The processor can only understand machine code
(b)
Compiler translates all the code in one go...
...whereas an interpreter translates one line at a time
Compiler creates an executable...
...whereas an interpreter does not/executes one line at a time
Compiler reports an error at the end...
...whereas an interpreter stops when it finds an error

Page 8 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Tools & Facilities in IDEs


Your notes
Tools & Facilities in IDEs
What is an IDE?
An Integrated Development Environment (IDE) is software designed to make writing high-level
languages more efficient
IDEs include tools and facilities to make the process of creating/maintaining code easier, such as:
Editor
Error diagnostics
Run-time environment
Translators

Editor

An editor gives users an environment to write, edit and maintain high-level code
Editors can provide:
Basic code formatting tools - changing the font, size of the font and making text bold etc
Prettyprint - using colour to make it easier to identify keywords, for example 'print', 'input' and 'if' in
Python
Code editing - auto-completion and auto-correction of code, bracket matching and syntax
checks
Commenting code - allows sections of code to be commented out easily to stop it from being run
or as comments on what the program is doing

Error-diagnostics

Page 9 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Tools that help to identify, understand and fix errors in code, such as:
Identifying errors - highlight particular areas of code or provide direct error messages where the
error may have appeared e.g. indentation errors etc
Debugger - provide a 'step through' command which provides step by step instructions and
shows what is happening to the code line by line, useful for finding logic errors

Run-time environment

Gives users the ability to run and see the corresponding output of a high-level language

Translator
Built in to compile or interpret code without the need for an extra piece of software

Page 10 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
The Internet & the World Wide Web
Contents
The Internet & the World Wide Web
Network Protocols
Web Browser
Web Pages
Cookies

Page 1 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The Internet & the World Wide Web


Your notes
The Internet & the World Wide Web
What is the Internet?
The Internet is a global network of networks
The Internet is the most well-known Wide Area Network (WAN)
The Internet is the infrastructure used to provide connectivity to the World Wide Web

What is the World Wide Web?


The world wide web, or simply the web, is a collection of websites and web pages that are accessed
using the internet
It was created in 1989 by Tim Berners-Lee, who envisioned it as a way to share and access information
on a global scale
The web consists of interconnected documents and multimedia files that are stored on web servers
around the world
Web pages are accessed using a web browser, which communicates with web servers to retrieve and
display the content

Page 2 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Network Protocols
Your notes
HTTP & HTTPS
What is HTTP & HTTPS?
Hypertext Transfer Protocol (HTTP) allows communication between clients and servers for website
viewing
HTTP & HTTPS are protocols, a set of rules governing communication between devices on a network
HTTP allows clients to receive data from the sever (fetching a webpage) and send data to the server
(submitting a form, uploading a file)
HTTPS works in the same way as HTTP but with an added layer of security
All data sent and received using HTTPS is encrypted
HTTPS is used to protect sensitive information such as passwords, financial information and personal
data

Page 3 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Web Browser
Your notes
Web Browser
What is a web browser?
A web browser is a piece of software used to access and display information on the internet
A web browser displays web pages by rendering hypertext markup language (HTML)
Web browsers interpret the code in HTML documents and translate it into a visual display for the user

Functions of a web browser


Function Description

Render HTML Display the web page

Provide navigation tools E.g. back/forward buttons and home button, to help users move between
pages

Storing bookmarks & Allow users to save links to frequently visited websites and access them
favourites easily

Storing cookies Cookies

Record user history Allow users to quickly revisit recently viewed web pages

Provide address bar A place for user to type in the URL (link to URL page) of a web page to visit

Multiple tabs Allow multiple web pages to be open at once so users can quickly switch
between them

Page 4 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Web Pages
Your notes
Loading a Web Page
How is a web page loaded?
Web pages are held on web servers (1), known as 'hosting'
To access a web page on a web server, a web browser is used
In the browser, a user enters a web page URL (2)
The browser sends the domain name to a DNS (3)
The browser connects to the web server and requests to access the page
HTML (4) is transferred and rendered by the browser, displaying the web page

Web Servers (1)


What is a web server?
A web server is a remote computer that stores the files needed to display a web page on the Internet
Web servers are generally available 24/7 and security is managed by the owner of the hardware
Web servers provide access to multiple users at the same time

Uniform Resource
Locator (URL) (2)
What is a URL?
A Uniform Resource Locator (URL) is a unique identifier for a web page, known as the website address
It is text based to make it easier to remember
A user enters a URL into a web browser to view a web page
An example of a URL is:
https://www.savemyexams.com/igcse/computer-science/cie/23/revision-notes/
A URL can typically be split into three parts:
Protocol

Page 5 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Domain name
Web page/file name Your notes
Using the example about the URL would be split as follows:
Protocol https Communication method to transfer data
between client and server

Domain name www.savemyexams.com Name of the server where the resource is


located

Web page/file /igcse/computer- Location of the file or resources on the


name science/cie/23/revision-notes/ server

Domain Name System (DNS) (3)


What is a DNS?
The Domain Name System (DNS) can be thought of as the Internet's equivalent to a phone book
It is essentially a directory of domain names and is used to translate human-readable domain names to
the numeric IP addresses that computers use
When you type a URL into your browser, the DNS translates the domain name into its associated IP
address so your computer can connect to the server hosting the website
Without DNS, we would have to remember the IP address of every site we want to visit

HTML (4)
What is HTML?
Hypertext Markup Language (HTML), is the foundational language used to structure and present
content on the web
HTML consists of a series of elements, often referred to as "tags"
Most tags are opened and closed e.g. <html> and </html>, whereas some tags are only opened e.g.
<img> and <link>

Structure
HTML is used to define the basic structure of a webpage by organising content into sections such as
headers, paragraphs, and footers

Page 6 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The <html> tag is the root element of an HTML page and includes all other HTML elements used to
create a page structure
<!DOCTYPE html> Your notes
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
</header>
<main>
<section>
<h2>About Me</h2>
<p>This is a paragraph about me.</p>
</section>
<section>
<h2>My Projects</h2>
<p>This is a paragraph about my projects.</p>
</section>
</main>
<footer>
<p>Contact: myemail@example.com</p>
</footer>
</body>
</html>

In this example, HTML is used to create a structure with a header, two sections in the main body, and a
footer
Other examples of HTML being used for structure include:
Creating lists to structure information
Positioning of text on the screen
Embedding media and interactive elements

Present
HTML is also used to present and display information in a visually meaningful way
The content layer of a web page is made up of HTML elements such as headings (<h1>, <h2>, etc.),
paragraphs (<p>), links (<a>), images (<img>), and more
This layer is mainly handled by CSS (Cascading Style Sheets)
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to My Website</h1>

Page 7 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

<p>This is a paragraph introducing the content of the website.</p>

<h2>Subheading 1</h2> Your notes


<p>Here is some detailed information under the first subheading.</p>

<h2>Subheading 2</h2>
<p>Another section with more information.</p>

<p><strong>Bold text</strong> and <em>italic text</em> can emphasise important points.</p>


</body>
</html>

In this example, headings (<h1>, <h2>) and text formatting tags (<strong>, <em>) are used to present the
content clearly and with emphasis
Other examples of HTML being used to present information include:
Presenting data in a table
Displaying images with captions

Worked Example
A company sells products over the Internet.
Explain how the information stored on the company’s website is requested by the customer, sent to
the customer’s computer and displayed on the screen.
[7]
Answer
Seven from:
Requested
a web browser is used
user enters the URL / web address (into the address bar) // clicks a link containing the web
address // clicks an element of the webpage
the URL / web address specifies the protocol
protocols used are Hyper Text Transfer Protocol (HTTP) / Hyper Text Transfer Protocol Secure
(HTTPS)
Sent
the URL / web address contains the domain name
the domain name is used to look up the IP address of the company
the domain name server (DNS) stores an index of domain names and IP addresses

Page 8 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

web browser sends a request to the web server / IP address


Received
Your notes
Data for the website is stored on the company’s web server
webserver sends the data for the website back to the web browser
web server uses the customer’s IP address to return the data
the data is transferred into Hyper Text Mark-up Language (HTML)
HTML is interpreted/rendered by the web browser (to display the website)

Page 9 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cookies
Your notes
Cookies
What is a cookie?
A cookie is a tiny data file stored on a computer by browser software that holds information relating to
your browsing activity
Typically a cookie will contain:
Browsing history - what websites you have visited
Login information - usernames & passwords
Preferences - language/font size/themes
The two types of cookie are:
Session - Created and replaced every time a user visits a website
Persistent - Created and saved the first time a user visits a website, retained until they expire

What is the Privacy and Electronic Communications


Regulations (2003)?
The Privacy and Electronic Communications Regulations (2003) is a law that governs the use of
cookies
Any website that wants to store a cookie must:
Tell users the cookies are there
Explain what the cookies are doing
Obtain users consent to store the cookie

Page 10 of 10
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Digital Currency
Contents
Digital Currency

Page 1 of 3
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Digital Currency
Your notes
Digital Currency
What is digital currency?
Digital currency is one that only exists in digital form
Currency is stored in digital wallets or accounts, there is no physical bank notes or coins
It can be exchanged online to pay for goods and services or for transferring money internationally
Unlike traditional currencies, digital currency is not controlled or monitored by central banks or
government (decentralised)
This can make digital currencies highly volatile, their value can fluctuate rapidly in a short period of time
Digital currency investment can be risky due the volatility
Digital currency can also be known as crypto currency
All transactions made using crypto currency are publicly available and tracked using cryptography
Examples include
Bitcoin
Ethereum

Examiner Tips and Tricks


In the IGCSE exam digital currency and crypto currency are the same thing, although in real life they
are not strictly the same thing.

Blockchain
What is a blockchain?
A blockchain is a digital ledger that records every transaction made with a particular digital currency
Transactions are time-stamped and added to the blockchain in a permanent and unalterable way
A blockchain is a decentralised technology, meaning that it is not controlled by a single entity or
authority

Page 2 of 3
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Instead, every participant in the network has a copy of the ledger and can verify the transactions
independently
The blockchain is made up of "blocks" of transactions that are linked together in a "chain" using Your notes
cryptographic algorithms
This creates a secure and tamper-proof record of every transaction made with the digital
currency
Each transaction in the blockchain must be verified by multiple participants in the network
This verification process ensures that the transaction is legitimate and prevents any fraudulent
activity

Page 3 of 3
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Cyber Security
Contents
Cyber Security Threats
Keeping Data Safe

Page 1 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cyber Security Threats


Your notes
Forms of cyber security threat
Computers face a variety of forms of attack and they can cause a large number of issues for a network
and computers
The main threats posed are:
Brute-force attacks
Data interception & theft
DDos attack
Hacking
Malware
Pharming
Phishing
Social engineering

Brute Force Attack


What is a brute-force attack?
A brute force attack works by an attacker repeatedly trying multiple combinations of a user's
password to try and gain unauthorised access to their accounts or devices
An example of this attack would be an attacker finding out the length of a PIN code, for example, 4-
digits
They would then try each possible combination until the pin was cracked, for example
0000
0001
0002
A second form of this attack, commonly used for passwords is a dictionary attack
This method tries popular words or phrases for passwords to guess the password as quickly as
possible
Popular words and phrases such as 'password', '1234' and 'qwerty' will be checked extremely quickly.

Page 2 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data interception
Your notes
What is data interception & theft?
Data interception and theft is when thieves or hackers can compromise usernames and passwords as
well as other sensitive data
This is done by using devices such as a packet sniffer
A packet sniffer will be able to collect the data that is being transferred on a network
A thief can use this data to gain unauthorised access to websites, companies and more

DDoS Attack
What is a DDoS attack?
A Distributed Denial of Service Attack (DDoS attack) is a large scale, coordinated attack designed to
slow down a server to the point of it becoming unusable
A server is continually flooded with requests from multiple distributed devices preventing genuine
users from accessing or using a service
A DDoS attack uses computers as 'bots', the bots act as automated tools under the attackers control,
making it difficult to trace back to the original source
A DDoS attack can result in companies losing money and not being able to carry out their daily duties
A DDoS attack can cause damage to a company's reputation

Hacking
What is hacking?
Hacking is the process of identifying and exploiting weaknesses in a computer system or network to
gain unauthorised access
Access can be for various malicious purposes, such as stealing data, installing malware, or disrupting
operations
Hackers seek out opportunities that make this possible, this includes:
Unpatched software
Out-of-date anti-malware

Malware
Page 3 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What is malware?
Malware (malicious software) is the term used for any software that has been created with malicious Your notes
intent to cause harm to a computer system
Examples of issues caused by malware include
Files being deleted, corrupted or encrypted
Internet connection becoming slow or unusable
Computer crashing or shutting down
There are various types of malware and each has slightly different issues which they cause

Malware What it Does

Virus Contains code that will replicate and cause unwanted and unexpected events to
occur
Examples of issues a user may experience are
Corrupt files
Delete data
Prevent applications from running correctly

Worms Very similar to viruses, main difference being that they spread to other drives and
computers on the network
Worms can infect other computers from
Infected websites
Instant message services
Email
Network connection

Trojan Sometimes called a Trojan Horse


Trojans disguise themselves as legitimate software but contain malicious code in
the background

Spyware Allow a person to spy on the users' activities on their devices

Page 4 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Embedded into other software such as games or programs that have been
downloaded from illegitimate sources
Your notes
Can record your screen, log your keystrokes to gain access to passwords and more

Adware Displays adverts to the user


Users have little or no control over the frequency or type of ads
Can redirect clicks to unsafe sites that contain spyware

Ransomware Locks your computer or device and encrypts your documents and other important
files
A demand is made for money to receive the password that will allow the user to
decrypt the files
No guarantee paying the ransom will result in the user getting their data back

Pharming
What is pharming?
Pharming is typing a website address into a browser and it being redirected to a 'fake' website in
order to trick a user into typing in sensitive information such as passwords
An attacker attempts to alter DNS settings, the directory of websites and their matching IP addresses
that is used to access websites on the internet or change a users browser settings
A user clicks a link which downloads malware
The user types in a web address which is then redirected to the fake website

Page 5 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

How can you protect against it?


To protect against the threat of pharming:
Keep anti-malware software up to date
Check URLs regularly
Make sure the padlock icon is visible

Phishing
What is phishing?
Phishing is the process of sending fraudulent emails/SMS to a large number of people, claiming to be
from a reputable company or trusted source
Phishing is an attempt to try and gain access to your details, often by coaxing the user to click on a
login button/link

Social Engineering
What is social engineering?
Social engineering is exploiting weaknesses in a computer system by targeting the people that use or
have access to them
There are many forms of social engineering, some examples include
Fraudulent phone calls: pretending to be someone else to gain access to their account or their
details
Page 6 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Pretexting: A scammer will send a fake text message, pretending to be from the government or
human resources of a company, this scam is used to trick an individual into giving out confidential
data Your notes
People are seen as the weak point in a system because human errors can lead to significant issues,
some of which include:
Not locking doors to computer/server rooms
Not logging their device when they're not using it
Sharing passwords
Not encrypting data
Not keeping operating systems or anti-malware software up to date

Worked Example
A company is concerned about a distributed denial of service (DDoS) attack.
(i) Describe what is meant by a DDoS attack.
[4]
(ii) Suggest one security device that can be used to help prevent a DDoS attack.[1]
Answers
(i) Any four from:
multiple computers are used as bots
designed to deny people access to a website
a large number / numerous requests are sent (to a server) …
… all at the same time
the server is unable to respond / struggles to respond to all the requests
the server fails / times out as a result.
(ii)
firewall OR proxy server

Page 7 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Keeping Data Safe


Your notes
Access Levels
What are access levels?
Access levels ensure users of a network can access what they need to access and do not have access
to information/resources they shouldn't
Users can have designated roles on a network
Access levels can be set based on a user's role, responsibility, or clearance level
Full access - this allows the user to open, create, edit & delete files
Read-only access - this only allows the user to open files without editing or deleting
No access - this hides the file from the user
Some examples of different levels of access to a school network could include:
Administrators: Unrestricted - Can access all areas of the network
Teaching Staff: Partially restricted - Can access all student data but cannot access other staff
members' data
Students: Restricted - Can only access their own data and files
Users and groups of users can be given specific file permissions

Anti Malware
What is anti-malware software?
Anti-malware software is a term used to describe a combination of different software to prevent
computers from being susceptible to viruses and other malicious software
The different software anti-malware includes are
Anti-virus
Anti-spam
Anti-spyware

How does anti-malware work?


Anti-malware scans through email attachments, websites and downloaded files to search for issues

Page 8 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Anti-malware software has a list of known malware signatures to block immediately if they try to
access your device in any way
Your notes
Anti-malware will also perform checks for updates to ensure the database of known issues is up to
date
Authentication
What is authentication?
Authentication is the process of ensuring that a system is secure by asking the user to complete tasks
to prove they are an authorised user of the system
Authentication is done because bots can submit data in online forms
Authentication can be done in several ways, these include
Usernames and passwords
Multi-factor authentication
CAPTCHA - see example below

Page 9 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 10 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Biometrics Your notes


Biometrics use biological data for authentication by identifying unique physical characteristics of a
human such as fingerprints, facial recognition, or iris scans
Biometric authentication is more secure than using passwords as:
A biometric password cannot be guessed
It is very difficult to fake a biometric password
A biometric password cannot be recorded by spyware
A perpetrator cannot shoulder surf to see a biometric password

Automating Software Updates


What are automatic software updates?
Automatic software updates take away the need for a user to remember to keep software updated
and reduce the risk of software flaws/vulnerabilities being targeted in out of date software
Automatic updates ensure fast deployment of updates as they release

Communication
What is communication?
One way of protecting data is by monitoring digital communication to check for errors in the spelling
and grammar or tone of the communication
Phishing scams often involve communication with users, monitoring it can be effective as:
Rushed - emails and texts pretending to be from a reputable company are focused on quantity
rather than quality and often contain basic spelling and grammar errors
Urgency - emails using a tone that creates panic or makes a user feel rushed is often a sign that
something is suspicious
Professionalism - emails from reputable companies should have flawless spelling and grammar

URL
How to check a URL?
Checking the URL attached to a link is another way to prevent phishing attacks

Page 11 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Hackers often use fake URLs to trick users into visiting fraudulent websites
e.g. http://amaz.on.co.uk/ rather than http://amazon.co.uk/ Your notes
If you are unsure, always check the website URL before clicking any links contained in an email
Firewalls
What is a firewall?
A firewall monitors incoming and outgoing network traffic and uses a set of rules to determine which
traffic to allow
A firewall prevents unwanted traffic from entering a network by filtering requests to ensure they are
legitimate
It can be both hardware and software and they are often used together to provide stronger security to
a network
Hardware firewalls will protect the whole network and prevent unauthorised traffic
Software firewalls will protect the individual devices on the network, monitoring the data going to
and from each computer

What form of attack would this prevent?


Hackers
Malware
Unauthorised access to a network

Privacy Settings
What are privacy settings?
Privacy settings are used to control the amount of personal information that is shared online
They are an important measure to prevent identity theft and other forms of online fraud
Users should regularly review their privacy settings and adjust them as needed

Proxy Servers
What is a proxy server?
A proxy-server is used to hide a user's IP address and location, making it more difficult for hackers to
track them

Page 12 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

They act as a firewall and can also be used to filter web traffic by setting criteria for traffic
Malicious content is blocked and a warning message can be sent to the user Your notes
Proxy-servers are a useful security measure for protecting against external security threats as it can
direct traffic away from the server
SSL
What is SSL?
Secure Socket Layer (SSL) is a security protocol which is used to encrypt data transmitted over the
internet
This helps to prevent eavesdropping and other forms of interception
SSL is widely used to protect online transactions, such as those involving credit card information or
other sensitive data
It works by sending a digital certificate to the user’s browser
This contains the public key which can be used for authentication
Once the certificate is authenticated, the transaction will begin

Worked Example
(i) ) Identify a security solution that could be used to protect a computer from a computer virus,
hacking and spyware.
Each security solution must be different

Threat Security solution

Phishing

DDoS attack

Hacking

[3]
(ii) Describe how each security solution you identified in (i) will help protect the computer.
[6]
Answers

Page 13 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

(i)

Threat Security solution Your notes


Phishing Monitoring communication

Brute force attack Authentication

Hacking Firewall/Biometrics

(ii) Two marks for each description


Monitoring communication
Checking for spelling & grammar errors
Reading tone, is the user being rushed? // is the user made to panic?
Authentication
Checks the user is they say they are
Captcha proves they are not a bot
Passwords lock out after a set number of attempts
Firewall
Monitors traffic coming into and out of the computer system
Checks that the traffic meets any criteria/rules set
Blocks any traffic that does not meet the criteria/rules set // set blacklist/whitelist
Biometrics
Data needed to enter is unique to individual
… therefore it is very difficult to replicate
Lock out after set number of attempts

Page 14 of 14
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Automated Systems
Contents
Automated Systems

Page 1 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Automated Systems
Your notes
Automated Systems
What is an automated system?
An automated system is a computer system that collects information and can react and perform tasks
based on the data
Automated systems are made using three components:
Sensors
Microprocessors
Actuators
A sensor collects information (link here to 3 Sensors) and provides the microprocessor with it as an
input
A microprocessor processes the information and makes decisions based on pre-programmed rules
An actuator makes physical changes based on instructions given by the microprocessor (outputs)
Examples of physical changes include:
Opening/closing a door/valve
Activating an alarm

Advantages & Disadvantages of Automated Systems


There are general advantages and disadvantages of automated systems

Advantages Disadvantages

Cost - long-term cost saving Cost - short-term expensive to set up

Safer - timely interventions Testing - significant testing must be done before


being used

Safer - keeps humans away from hazardous Security - open to cyber attacks
environments

Page 2 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Efficient - materials and resources Flexibility - will only react to programmed scenarios
Your notes
Consistent - results are repeatable Maintenance - needs to be well maintained

Unethical - can result in major job losses

There are also scenarios where specific advantages and disadvantages are important such as:

Scenario Advantages Disadvantages

Industry Increased production High investment costs


Improved quality control Job losses

Transport Less accidents & traffic congestion Transportation drivers lose jobs
Increased logistical efficiency Technology reliability

Agriculture Less manual labour High start-up costs for equipment and
sensors
Increased crop yield & resource
management

Weather Accurate forecasting Dependence on accurate sensor data


Improved early warning systems

Gaming Personalised experience Reduced creativity & problem solving


for players
AI enhanced opponents add
challenge Repetitive gameplay

Lighting Increased energy efficiency Lack of human control with light


adjustments
Better security with motion-activated
systems

Science Faster & more precise High cost development and


maintenance
Reduced risk of human error
Potential for algorithm bias

Page 3 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes
Worked Example
A theme park has a game where a player tries to run from the start to the finish without getting wet.
The system for the game uses sensors and a microprocessor to spray water at a player as they run
past each sensor.
Describe how the sensors and the microprocessor are used in this system
[8]
Answer
A motion sensor collects data [1]
This data is converted to digital using ADC [1]
The sensor sends data to the microprocessor... [1]
... where the data is compared to stored data [1]
If the value is outside range, water will be sprayed [1]
A signal is sent to the actuator to spray water [1]
If the value is within range no action is taken [1]
This runs in a continuous loop [1]

Page 4 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Robotics
Contents
Robotics

Page 1 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Robotics
Your notes
Robotics
What is robotics?
Robotics is the principle of a robot carrying out a task by following a precise set of programmed
instructions
Robots can be categorised into two groups:

Dumb robots Smart robots

Repeat the same programmed instructions over and Carries out more complex tasks and can adapt
over again (no AI) and learn (AI)

E.g. Car assembly line E.g. Assisting surgeons in delicate procedures

The development of artificial intelligence, including the increased use of machine learning and robotics
raises ethical and legal issues such as:
Accountability
Safety
Algorithmic bias
Legal liability

Characteristics of a Robot
What are the characteristics of a robot?
Robots share three common characteristics:
Mechanical structure
Electrical components
Programmable

Mechanical structure Electrical components Programmable

Page 2 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A physical body that can move and Sensors, microprocessors Designed to follow a precise
interact with the environment and actuators set of instructions
Your notes

The Role of Robots


What is the role of robots?
Robots play a crucial role in many areas such as:

Scenario Role Advantages Disadvantages

Industry Quality Advanced vision to inspect May not work on defects that
inspector products for defaults, might require human judgement
improving quality control

Transport Warehouse Efficiency in finding, moving High infrastructure costs and


worker and packing, less reliable on potential safety concerns for
manual labour human workers sharing the same
space

Agriculture Planting & Precise planting (optimum High upfront costs, may struggle
seeding depths and distances) with uneven terrain and changing
machine weather conditions

Medicine Rehabilitation Personalised physical therapy Doesn't provide emotional


therapist exercises to aid recovery support

Domestic Sous chef Assists with meal prep by Limited ability and capabilities
doing basic duties (chopping,
measuring and following basic
recipes)

Entertainment Educational Interactive learning High cost, cannot replace the


robot experiences for children, guidance of human teachers
increased engagement

Worked Example
Page 3 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A company uses robots in its factory to manufacture restaurant tables and chairs
(i) One characteristic of a robot is that they contain electrical components. Your notes
State two other characteristics of a robot.
[2]
(ii) Give two advantages to company employees of using robots to manufacture tables and chairs.
[2]
(ii) Give one disadvantage to the company’s owners of using robots to manufacture table and chairs
[1]
Answers
(i)
Mechanical structure
Programmable
(ii)
Employees don't need to lift heavy items
Employees can be protected from dangerous tasks
Employees can utilise their skills in other tasks
Employees don’t need to perform repetitive/mundane tasks
(iii)
Expensive to install/purchase/setup
High ongoing costs/maintenance costs
May deskill the workforce
If they malfunction, production may stop

Page 4 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Artificial Intelligence
Contents
Artificial Intelligence (AI)

Page 1 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Artificial Intelligence (AI)


Your notes
Artificial Intelligence (AI)
What is artificial intelligence?
Artificial intelligence (AI) is a machine that can simulate intelligent behaviours similar to that of a human
AI is a system that can:
Learn - acquire new information
Decide - analyse and make choices
Act autonomously - take actions without human input
There are two main types of AI:
Weak AI, also known as narrow AI, is designed to perform a specific task or set of tasks
Strong AI, also known as artificial general intelligence (AGI), is designed to perform any intellectual
task that a human can do

Advantages and disadvantages of AI


Advantages Disadvantages

Increased efficiency Job losses

Increased accuracy Potential for biased decision making

Scalability Ethical concerns over its use

Characteristics of AI
AI shares three common characteristics:
Collection of data
Rules for using data
Ability to reason

Page 2 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Collection of data Rules for using data Ability to


reason
Your notes
AI systems require large amounts of AI systems can use logical reasoning to It can change its
data to perform tasks evaluate information and make decisions own rules and
based on that information data
The data is processed using rules or
algorithms that enable the system to
make decisions and predictions

Expert systems
What is an expert system?
An expert system mimics human knowledge and experience and uses a combination of the two to
solve problems or answer questions
Examples of expert systems include:
Equipment troubleshooting and repair
Technical support
Medical diagnosis system
Expert systems share four key characteristics

Knowledge base Rule base Inference engine Interface

A database of facts to A set of rules or logic that A program that applies A way for users to
generate rules that are is used to apply the the rules in the rule base interact with the
used to solve problems knowledge in the to the facts in the system and
and make decisions knowledge base to knowledge base to solve provide input
specific problems problems

Advantages and disadvantages of expert systems


Advantages Disadvantages

Consistent results Only as good as the data entered

Page 3 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Faster responses Responses can be cold and lack human emotion


Your notes
Can store large amounts of data Requires training to use correctly

Unbiased

Machine Learning
What is machine learning?
Machine learning is one method that can help to achieve an artificial intelligence (AI)
By giving a machine data so that it can 'learn over time' it helps towards training a machine or software
to perform a task and improve its accuracy and efficiency
Uses algorithms to analyse data and identify patterns or relationships

Worked Example
Describe the characteristics of AI
[3]
Answer
Any three from:
Collects data
Stores rules for using the data
The ability to reason
The ability to learn // uses machine learning
… by adapting what it does
… for example, from mistakes to not make them again // result from previous decisions impacts
future
… by changing its own rules
…by changing its own data
…by being trained
Makes one or more predictions (to make a decision)
Find/analyse patterns

Page 4 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Development Life Cycle
Contents
Program Development Life Cycle

Page 1 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Program Development Life Cycle


Your notes
Analysis
What is the analysis stage of the program development life
cycle?
The analysis stage of the program development life cycle is to precisely understand the problem the
program is intended to solve

What role does abstraction play in the analysis?


Abstraction is the act of removing unimportant details from the problem to focus on important
elements such as:
Core functionality
Requirements
An example of abstraction would be the London underground train route map; travellers do not need
to know the geographical layout of the routes, only that getting on at stop A will eventually transport
you to stop B

Page 2 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 3 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Core functionality
Using abstraction helps to identify the fundamental components of what the program is going to
solve
Before tackling a problem, it needs to be clearly understood by everyone working on it
The overall goal of the solution needs to be agreed as well as any constraints such as limited resources
or requiring a platform specific solution

Requirements
To create a solution, a requirements document is created to define the problem and break it down into
clear, manageable, understandable parts by using abstraction and decomposition
A requirements document labels each requirement, gives it a description as well as success criteria
which state how we know when the requirement has been achieved

Design
What is the design stage of the program development life
cycle?
Page 4 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

The design stage of the program development life cycle involves using techniques to come up with a
blueprint for a solution
Your notes
Ways the design of a solution to a problem can be presented include:
Structure diagrams
Flowchart
Pseudocode

Coding
What is the coding stage of the program development life
cycle?
Developers begin programming modules in a suitable programming language that works together to
provide an overall solution to the problem
As each developer programs, they perform iterative testing
Iterative testing is where each module is tested and debugged thoroughly to make sure it interacts
correctly with other modules and accepts data without crashing or causing any errors
Developers may need to retest modules as new modules are created and changed to make sure they
continue to interact correctly and do not cause errors

Testing
What is the testing stage of the program development life
cycle?
Once the overall program or set of programs is created, they are run many times using varying sets of
test data
This ensures the program or programs work as intended as outlined in the initial requirements
specification and design and rejects any invalid data that is input
Examples of test data include alphanumeric sequences to test password validation routines

Page 5 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Computer Sub-Systems
Contents
Computer Sub-Systems
Problem Decomposition

Page 1 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Computer Sub-Systems
Your notes
Computer Sub-Systems
What is a sub-system?
A sub-system is a smaller part of a computer system that works together with other sub-systems to
create fully functional computer system
A car is a great example of using sub-systems
A car will only function if its sub-systems all work together, they are:
Engine
Breaks
Wheels etc.
Sub-systems can be further broken down into even smaller sub-systems such as:
Engine - spark plugs, sensors, pistons
In computers, there are five main sub-systems:

Central Memory Storage Input devices Output devices


Processing
Unit (CPU)

Executes Stores data & Stores data and Allows a user to Displays information
instructions instructions software enter information or creates a physical
temporarily for the permanently (HDD, (keyboard, mouse) output (monitor,
CPU (RAM) SSD) printer)

Computer sub-systems can be further broken down into smaller sub-systems such as:
CPU - control unit, registers & arithmetic logic unit (ALU)

Advantages of sub-systems
Can help troubleshoot problems in a computer system
The ability to isolate a sub-system makes it easier to identify and fix issues, as each sub-system can
be examined separately
Developing software relies on the use of different sub-systems to ensure they operate efficiently

Page 2 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Gives developers and designers a clear picture of how sub-systems help build complex systems

Your notes

Page 3 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Problem Decomposition
Your notes
Problem Decomposition
What is decomposition?
Decomposition is the process of breaking down a large problem into a set of smaller problems
Benefits of decomposition are:
Smaller problems are easier to solve
Each smaller problem can be solved independently of the others
Smaller problems can be tested independently
Smaller problems can be combined to produce a solution to the full problem
Modern computer games are a good example of using decomposition to break down the complexity
of the problem into more manageable 'chunks'
Creating an entire game at once would be challenging and inefficient, so it could be decomposed
into:
Levels - Levels can be designed/created/tested/ independently of other levels
Characters - The mechanics of characters in the game can be designed and created by a separate
team
Landscape - The art team can work on the visual aspects of the game without needing to
understand how the game is programmed
Once all of the smaller problems are completed, joined together a complex game has been created

Inputs, processes, outputs and storage


Decomposing a problem requires developers to think about four component parts:
Inputs: data entered into the system
Processes: subroutines and algorithms that turn inputs and stored data into outputs
Outputs: data that is produced by the system, such as information on a screen or printed
information
Storage: data that is stored on a physical device, such as on a hard drive or in memory whilst the
program is running

Page 4 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Example - Area of a rectangle program


Inputs Width of the rectangle Your notes

Height of the rectangle

Processes Width x height

Outputs Calculated area of the rectangle

Storage Memory: width, height and area stored temporarily

Page 5 of 5
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Algorithms
Contents
Designing Algorithms
Explaining Algorithms

Page 1 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Designing Algorithms
Your notes
What is an algorithm?
An algorithm is precise set of rules or instructions to solve a specific problem or task
There are three main ways to design an algorithm
Structure diagrams
Flowchart
Pseudocode

Structure Diagrams
What is a structure diagram?
Structure diagrams show hierarchical top-down design in a visual form
Each problem is divided into sub-problems and each sub-problem divided into further sub-problems
At each level the problem is broken down into more detailed tasks that can be implemented using a
single subroutine

an example of a structure diagram for a mobile application could be:


Page 2 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Flowcharts
What is a flowchart?
Flowcharts are a visual tool that uses shapes to represent different functions to describe an
algorithm
Flowcharts show the data that is input and output, the processes that take place and any decisions or
repetition
Lines are used to show the flow of control

Page 3 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Example
Flowchart

Page 4 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

The casino would like the algorithm refined so that the user also enters their first name and this is used
to greet the user when they access the site

Page 5 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Flowchart
Your notes

Page 6 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 7 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Pseudocode Your notes

What is pseudocode?
Pseudocode is a text-based tool that uses short English words/statements to describe an algorithm
Pseudocode is more structured than writing sentences in English but is very flexible

Example
A casino would like a program that asks users to enter an age, if they are 18 or over they can enter the
site, if not then they are given a suitable message

Pseudocode

INPUT Age
IF Age >= 18
THEN
OUTPUT "Welcome to the site"
ELSE
OUTPUT "Sorry, this site is for users 18 and over"

The casino would like the algorithm refined so that the user also enters their first name and this is used
to greet the user when they access the site

Pseudocode

INPUT FName
INPUT Age
IF Age >= 18
THEN
OUTPUT "Welcome to the site", FName
ELSE
OUTPUT "Sorry, this site is for users 18 and over"

Page 8 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Explaining Algorithms
Your notes
Explaining Algorithms
How do you explain an algorithm?
A well designed algorithm should be able to be interpreted by a new user and they should be able to
explain what it does
Algorithms can be written using flowcharts, pseudocode or high-level programming language code
such as Python
The purpose of an algorithm is to solve a problem, if a user does not know the goal of the algorithm,
then following the algorithm instructions should make its purpose clear
If the algorithm is complex then additional ways to understand the problem could be:
Look for comments in the code
Consider the context of where the algorithm is being used
Test the algorithm with different inputs
Look at the following algorithm, can you explain what it does?

Pseudocode

Count ← 1
Number ← 0
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total

The purpose of the algorithm is to add ten user-entered numbers together and output the total
The processes are:
initializing three variables (Count, Number, Total)
inputting a user number
adding to two variables (Total, Count)

Page 9 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

repeating nine more times


outputting the final Total value Your notes

Worked Example
The pseudocode algorithm shown has been written by a teacher to enter marks for the students in
her class and then to apply some simple processing.
Count ← 0

REPEAT
INPUT Score[Count]

IF Score[Count] >= 70 THEN


Grade[Count] ← "A"
ELSE
IF Score[Count] >= 60 THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] >= 50 THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] >= 40 THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] >= 30 THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF

Count ← Count + 1
UNTIL Count = 30

Describe what happens in this algorithm.


[3]
Answer
Any 3 of:
Inputted marks are stored in the array Score[] [1]

Page 10 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Marks are then checked against a range of boundaries [1]


A matching grade is assigned to each mark that has been input [1]
The grade is then stored in the array Grade[] [1] Your notes
At the same index as the inputted mark [1]
The algorithm finishes after 30 marks have been input [1]

Page 11 of 11
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Standard Methods of a Solution
Contents
Linear Search & Bubble Sort
Other Standard Methods of a Solution

Page 1 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Linear Search & Bubble Sort


Your notes
What is a searching algorithm?
Searching algorithms are precise step-by-step instructions that a computer can follow to efficiently
locate specific data in massive datasets

Linear Search
What is a linear search?
A linear search starts with the first value in a dataset and checks every value one at a time until all
values have been checked
A linear search can be performed even if the values are not in order

How do you perform a linear search?


Step Instruction

1 Check the first value

2 IF it is the value you are looking for


STOP!

3 ELSE move to the next value and check

4 REPEAT UNTIL you have checked all values and not found the value you are looking for

Examiner Tips and Tricks


You will not be asked to perform a linear search on a dataset in the exam, you will be expected to
understand how to do it and know the advantages and disadvantages of performing it

A linear search in Python code

Page 2 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# Identify the dataset to search, the target value and set the initial flag
data = [5, 2, 8, 1, 9]
target = 11 Your notes
found = False

# Loop through each element in the data


for index in range(0, len(data)): # loop to go through all elements
# Check if the current element matches the target
if data[index] == target:
# If found, output message
found = True
print("Target found")
break # Exit the loop if the target is found

# If the target is not found, output a message


if not found:
print("Target not found")

What is a sorting algorithm?


Sorting algorithms are precise step-by-step instructions that a computer can follow to efficiently
sort data in massive datasets

Bubble Sort
What is a bubble sort?
A bubble sort is a simple sorting algorithm that starts at the beginning of a dataset and checks values in
'pairs' and swaps them if they are not in the correct order
One full run of comparisons from beginning to end is called a 'pass', a bubble sort may require multiple
'passes' to sort the dataset
The algorithm is finished when there are no more swaps to make

How do you perform a bubble sort?


Step Instruction

1 Compare the first two values in the dataset

2 IF they are in the wrong order...


Swap them

Page 3 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

3 Compare the next two values


Your notes
4 REPEAT step 2 & 3 until you reach the end of the dataset (pass 1)

5 IF you have made any swaps...


REPEAT from the start (pass 2,3,4...)

6 ELSE you have not made any swaps...


STOP! the list is in the correct order

Example
Perform a bubble sort on the following dataset

Page 4 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

5 2 4 1 6 3
Your notes
Step Instruction

1 Compare the first two values in the dataset

5 2 4 1 6 3

2 IF they are in the wrong order...


Swap them

2 5 4 1 6 3

3 Compare the next two values

2 5 4 1 6 3

4 REPEAT step 2 & 3 until you reach the end of the dataset
5 & 4 SWAP!

2 4 5 1 6 3

5 & 1 SWAP!

2 4 1 5 6 3

5 & 6 NO SWAP!

2 4 1 5 6 3

6 & 3 SWAP!

2 4 1 5 3 6

Page 5 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

End of pass 1

Your notes
5 IF you have made any swaps...
REPEAT from the start
End of pass 2 (swaps made)

2 1 4 3 5 6

End of pass 3 (swaps made)

1 2 3 4 5 6

End of pass 4 (no swaps)

1 2 3 4 5 6

6 ELSE you have not made any swaps...


STOP! the list is in the correct order

Examiner Tips and Tricks


In the exam you do not have to show every swap that takes place in a bubble sort. You can show the
outcome of a bubble sort at the end of each pass. If you have the outcome of each pass correct
then a bubble sort has been implemented correctly and all marks will be given!

A bubble sort in Python code

# Unsorted dataset
nums = [66, 7, 69, 50, 42, 80, 71, 321, 67, 8, 39]

# Count the length of the dataset


numlength = len(nums)

# Set a flag to initiate the loop


swaps = True

Page 6 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

while swaps: # While any swap is made, continue


swaps = False
# Loop through the dataset, reduce range for optimization Your notes
for y in range(numlength - 1): # Compare adjacent elements
if nums[y] > nums[y + 1]: # If the first number is bigger
# Swap the numbers using a temporary variable
nums[y], nums[y + 1] = nums[y + 1], nums[y]
swaps = True # Mark that a swap was made

# Each iteration confirms that the last element is in place


numlength -= 1

# Print the sorted list


print(nums)

Worked Example
A program uses a file to store a list of words.

A sample of this data is shown

Milk Eggs Bananas Cheese Potatoes Grapes

Show the stages of a bubble sort when applied to data shown [2]
How to answer this question
We need to sort the values in to alphabetical order from A-Z
You CAN use the first letter of each word to simplify the process
Answer
E, B, C, M, G, P (pass 1)
B, C, E, G, M, P (pass 2)

Page 7 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Other Standard Methods of a Solution


Your notes
Totalling & Counting
What is totalling?
Totalling is keeping a running total of values entered into the algorithm
An example may be totalling a receipt for purchases made at a shop
In the example below, the total starts at 0 and adds up the user inputted value for each item in the list

Pseudocode

Total ← 0
FOR Count ← 1 TO ReceiptLength
INPUT ItemValue
Total ← Total + itemValue
NEXT Count
OUTPUT Total

What is counting?
Counting is when a count is incremented or decremented by a fixed value, usually 1, each time it
iterates
Counting keeps track of the number of times an action has been performed
Many algorithms use counting, including the linear search to track which element is currently being
considered
In the example below, the count is incremented and each pass number is output until fifty outputs have
been produced

Pseudocode

Count ← 0
DO
OUTPUT “Pass number”, Count
Count ← Count + 1
UNTIL Count >= 50

In the example below, the count is decremented from fifty until the count reaches zero. An output is
produced for each pass
Page 8 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Pseudocode
Your notes
Count ← 50
DO
OUTPUT “Pass number”, Count
Count ← Count - 1
UNTIL Count <= 0

Maximum, Minimum & Average


Finding the largest (max), smallest (min) and average (mean) values in a list are frequently used method
in algorithms
Examples could include:
Calculating the maximum and minimum student grades or scores in a game
Calculating the average grade of students in a class test
In the example below, in a list of student test scores, the highest, lowest and average scores are
calculated and displayed to the screen

Pseudocode

Total ← 0
Scores ← [25, 11, 84, 91, 27]

Highest ← max(Scores)
Lowest ← min(Scores)

# Loop through the scores in the list (indexing starts from 0)


FOR Count ← 0 TO LENGTH(Scores) - 1
# Add score to total
Total ← Total + Scores[Count]
NEXT Count

# Calculate average
Average ← Total / LENGTH(Scores)

OUTPUT "The highest score is:", Highest


OUTPUT "The lowest score is:", Lowest
OUTPUT "The average score is:", Average

Page 9 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Validation & Verification
Contents
Validation & Verification
Suitable Test Data
Trace Tables

Page 1 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Validation & Verification


Your notes
Validation
What is validation?
Validation is an automated process where a computer checks if a user input is sensible and meets the
program's requirements.
There are six categories of validation which can be carried out on fields and data types, these are
Range check
Length check
Type check
Presence check
Format check
Check digit
There can be occasions where more than one type of validation will be used on a field
An example of this could be a password field which could have a length, presence and type check on it

Page 2 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Range check
Ensures the data entered as a number falls within a particular range

Pseudocode Ensures a percentage number is between 0-100 inclusive

OUTPUT “Enter a number between 0 and 100”


REPEAT
INPUT Number
IF Number < 0 OR Number > 100
THEN
OUTPUT “Number is not between 0 and 100, please try again”
ENDIF
UNTIL Number >= 0 AND Number <= 100

Page 3 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Python Ensures a user's age has been entered and falls between the digits of 0-110 inclusive
Your notes
age = int(input("Enter your age"))
while age < 0 or age > 110:
age = int(input("Enter your age, ensure it is between 0-110"))

Length check
Checks the length of a string

Pseudocode Ensures a pin number can only contain 4 digits

OUTPUT “Please enter your 4 digit bank PIN number”


REPEAT
INPUT Pin
IF LENGTH(Pin) <> 4
THEN
OUTPUT “Your pin number must be four characters in length, please try again”
ENDIF
UNTIL LENGTH(Pin) ← 4

Python Ensures a password is 8 characters or more

password_length = len(password)
while password_length < 8:
password = input("Enter a password which is 8 or more characters")

Type check
Check the data type of a field

Pseudocode Ensures an age should be entered as an integer (whole number)

OUTPUT “Enter an integer number”


REPEAT
INPUT Number
IF Number <> DIV(Number, 1)
THEN
OUTPUT “Not a whole number, please try again”
ENDIF
UNTIL Number ← DIV(Number , 1)

Page 4 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Python Ensures an age should be entered as an integer (whole number)


Your notes
age = input("Enter your age")
while age.isdigit() == False:
print("enter a number")
age = input("Enter your age as a number")

Presence check
Looks to see if any data has been entered in a field

Pseudocode Ensures username and password are both entered

OUTPUT “Enter your username”


REPEAT
INPUT Username
IF Username = “”
THEN
OUTPUT “No username entered, please try again”
ENDIF
UNTIL Username <> “”

Python Ensures when registering for a website the name field is not left blank

name = input("Enter your name")


while name == "":
name = input("You must enter your name here")

Format check
Ensures that the data has been entered in the correct format
Format checks are done using pattern matching and string handling

Pseudocode Ensures a six digit ID number is entered against the format "XX9999" where X is an
uppercase alphabetical letter and 9999 is a four digit number

INPUT IDNumber

IF LENGTH(IDNumber) <> 6
THEN
OUTPUT "ID number must be 6 characters long"
END IF

Page 5 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

ValidChars ← "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Your notes
FirstChar ← SUBSTRING(IDNumber, 1, 1)
ValidChar ← False
Index ← 1

WHILE Index <= LENGTH(ValidChars) AND ValidChar = False DO


IF FirstChar = ValidChars[Index]
THEN
ValidChar ← True
ENDIF
Index ← Index + 1
ENDWHILE

IF ValidChar = False
THEN
OUTPUT "First character is not a valid uppercase alphabetical character"
ENDIF

SecondChar ← SUBSTRING(IDNumber, 2, 2)
ValidChar ← False
Index ← 1

WHILE Index <= LENGTH(ValidChars) AND ValidChar = False DO


IF SecondChar = ValidChars[Index]
THEN
ValidChar ← True
ENDIF
Index ← Index + 1
ENDWHILE

IF ValidChar = False
THEN
OUTPUT "Second character is not a valid uppercase alphabetical character"
ENDIF

Digits ← INT(SUBSTRING(IDNumber, 3, 6))

IF Digits < 0000 OR Digits > 9999


THEN
OUTPUT "Digits invalid. Enter four valid digits in the range 0000-9999"
ENDIF

Explanation

The first two characters are checked against a list of approved characters
The first character is compared one at a time to each valid character in the ValidChars array

Page 6 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

If it finds a match it stops looping and sets ValidChar to True


The second character is then compared one at a time to each valid character in the ValidChars array Your notes
If it finds a match then it also stops looping and sets ValidChar to True
Casting is used on the digits to turn the digit characters into numbers
Once the digits are considered a proper integer they can be checked to see if they are in the
appropriate range of 0-9999
If any of these checks fail then an appropriate message is output

Python Ensures an email contains a '@' and ' full stop (.) which follows the format
"email@address.com"

email = input("Enter your email address")


while "@" not in email or "." not in email:
email = input("Please enter a valid email address")

Check digits
Check digits are numerical values that are the final digit of a larger code such as a barcode or an
International Standard Book Number (ISBN)
They are calculated by applying an algorithm to the code and are then attached to the overall code

Verification
What is verification?
Verification is the act of checking data is accurate when entered into a system
Mistakes such as creating a new account and entering a password incorrectly mean being locked out
of the account immediately
Verification methods include:
double entry checking
visual checks

Double entry checking


Double entry checking involves entering the data twice in separate input boxes and then comparing
the data to ensure they both match

Page 7 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

If they do not, an error message is shown


Pseudocode
Your notes
REPEAT
OUTPUT “Enter your password”
INPUT Password
OUTPUT “Please confirm your password”
INPUT ConfirmPassword
IF Password <> ConfirmPassword
THEN
OUTPUT “Passwords do not match, please try again”
ENDIF
UNTIL Password ← ConfirmPassword

Visual checks
Visual checks involve the user visually checking the data on the screen
A popup or message then asks if the data is correct before proceeding
If it isn’t the user then enters the data again

Pseudocode

REPEAT
OUTPUT “Enter your name”
INPUT Name
OUTPUT “Your name is: “, Name, “. Is this correct? (y/n)”
INPUT Answer
UNTIL Answer ← “y”

Worked Example
Describe the purpose of validation and verification checks during data entry. Include an example for
each.
[4]
Answers
Validation check
[1] for description:

Page 8 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

To test if the data entered is possible / reasonable / sensible


A range check tests that data entered fits within specified values
[1] for example: Your notes
Range / length / type / presence / format
Verification check
[1] for description:
To test if the data input is the same as the data that was intended to be input
A double entry check expects each item of data to be entered twice and compares both entries
to check they are the same
[1] for example:
Visual / double entry

Page 9 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Suitable Test Data


Your notes
Suitable Test Data
What is suitable test data?
Suitable test data is specially chosen to test the functionality of a program or design
Developers or test-users would pick a selection of test data from the following categories
Normal
Abnormal
Extreme
Boundary
The results would be compared to the expected results to check if the algorithm/program works as
intended
Each category is explained within the context of a simple Python program below, comments have been
added to help explain the processes

Python

# Ask for user's name


name = input("What is your name? ")

# Ask for user's age


age = int(input("How old are you? "))

# Check if age is between 12 and 18


if age >= 12 and age <= 18:
print("Welcome, " + name + "! Your age is accepted.")
else:
print("Sorry, " + name + ". Your age is not accepted.")

Normal data
Normal test data is data that should be accepted in the program
An example would be a user entering their age as 16 into the age field of the program

Abnormal data

Page 10 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Abnormal test data is data that is the wrong data type


An example would be a user entering their age as "F" into the age field of the program Your notes
Extreme data
Extreme test data is the maximum and minimum values of normal data that are accepted by the
system
An example would be a user entering their age as 18 or 12 into the age field of the program

Boundary data
Boundary test data is similar to extreme data except that the values on either side of the maximum and
minimum values are tested
The largest and smallest acceptable value is tested as well as the largest and smallest unacceptable
value
An example would be a user entering their age as 11 or 19 into the age field of the program

Selecting suitable test data


Type of Test Input Expected Output

Normal 14 Accepted

Normal 16 Accepted

Extreme 12 Accepted

Extreme 18 Accepted

Abnormal H Rejected

Abnormal @ Rejected

Boundary 11 Rejected

Boundary 19 Rejected

Page 11 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Worked Example
Your notes
A programmer has written an algorithm to check that prices are less than $10.00
These values are used as test data: 10.00 9.99 ten
State why each value was chosen as test data.
[3]
Answers
10.00 is boundary or abnormal data and should be rejected as it is out of range [1]
9.99 is boundary, extreme and normal data and should be accepted as it is within the normal range [1]
Ten is abnormal data and should be rejected as it is the wrong value type [1]

Page 12 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Trace Tables
Your notes
Trace Tables
What is a trace table?
A trace table is used to test algorithms and programs for logic errors that appear when an algorithm or
program executes
Trace tables can be used with flowcharts, pseudocode or program code
A trace table can be used to:
Discover the purpose of an algorithm by showing output data and intermediary steps
Record the state of the algorithm at each step or iteration
Each stage of the algorithm is executed step by step.
Inputs, outputs, variables and processes can be checked for the correct value when the stage is
completed

Trace table walkthrough


Below is a flowchart to determine the highest number of ten user-entered numbers
The algorithm prompts the user to enter the first number which automatically becomes the highest
number entered
The user is then prompted to enter nine more numbers.
If a new number is higher than an older number then it is replaced
Once all ten numbers are entered, the algorithm outputs which number was the highest
Example test data to be used is: 4, 3, 7, 1, 8, 3, 6, 9, 12, 10

Page 13 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 14 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Trace table: Highest number


Your notes
Count Highest Number Output

1 Enter ten numbers

4 Enter your first number

2 3 Enter your next number

3 7 7

4 1

5 8 8

6 3

7 6

8 9 9

9 12 12

10 10 12 is your highest number

Worked Example
The flowchart represents an algorithm. The algorithm will terminate if –1 is entered.

Page 15 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Complete the trace table for the input data: 50, 75, 99, 28, 82, 150, –1, 672, 80
[4]

Page 16 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Value Diff1 Diff2 Output


Your notes

Answer
[1] for each correct column

Value Diff1 Diff2 Output

50 50 0 Accept: Extreme

75 25 25 Accept: Normal

99 1 49 Accept: Normal

28 Reject: Abnormal

82 18 32 Accept: Normal

150 Reject: Abnormal

-1

Page 17 of 17
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Identifying Errors
Contents
Identifying Errors
Writing & Amending Algorithms

Page 1 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Identifying Errors
Your notes
Identifying errors
Designing algorithms is a skill that must be developed and when designing algorithms, mistakes and
issues will occur
Trace tables can also help to find any kind of error in a program or algorithm
There are three main categories of errors that when designing algorithms a programmer must be able
to identify & fix, they are:
Syntax errors
Logic errors
Runtime errors

Syntax Errors
What is a syntax error?
A syntax error is an error that breaks the grammatical rules of a programming language and stops it
from running
Examples of syntax errors are:
Typos and spelling errors
Missing or extra brackets or quotes
Misplaced or missing semicolons
Invalid variable or function names
Incorrect use of operators
Incorrectly nested loops & blocks of code

Python code - with syntax errors

def generate_username(first_name, last_name)


username = f"{first_name[0]}{last_name[0]}{last_name[:3]}"
return username

def main():
# -----------------------------------------------------------------------
# Prompts the user for personal information and displays a suggested username

Page 2 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# -----------------------------------------------------------------------
first_name = imput("Enter your first name: ")
last_name = input("Enter your last name: ") Your notes
usdrname = generate_username(first_name, last_name)
print(f"Here's a suggested username: {username}")

# ------------------------------------------------------------------------
# Main program
# ------------------------------------------------------------------------
main

Python code - without syntax errors

def generate_username(first_name, last_name):


username = f"{first_name[0]}{last_name[0]}{last_name[:3]}"
return username

def main():
# -----------------------------------------------------------------------
# Prompts the user for personal information and displays a suggested username
# -----------------------------------------------------------------------
first_name = input("Enter your first name: ")
last_name = input("Enter your last name: ")
username = generate_username(first_name, last_name)
print(f"Here's a suggested username: {username}")

# ------------------------------------------------------------------------
# Main program
# ------------------------------------------------------------------------
main()

Syntax errors

1. Missing semicolon def generate_username(first_name, last_name)


2. Incorrectly spelt function name first_name = imput("Enter your first name: ")
3. Typo in variable name usdrname = generate_username(first_name, last_name)
4. Missing parenthesis main

Logic Errors
What is a logic error?

Page 3 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A logic error is where incorrect code is used that causes the program to run, but produces an
incorrect output or result
Your notes
Logic errors can be difficult to identify by the person who wrote the program, so one method of finding
them is to use 'Trace Tables'
Examples of logic errors are:
Incorrect use of operators (< and >)
Logical operator confusion (AND for OR)
Looping one extra time
Indexing arrays incorrectly (arrays indexing starts from 0)
Using variables before they are assigned
Infinite loops

Python code

def calculate_area(length, width):


###
Calculates the area of a rectangle
Inputs:
length (float): The length of the rectangle (positive value)
width (float): The width of the rectangle (positive value)
Returns:
float: The calculated area of the rectangle
Raises:
ValueError: If either length or width is non-positive
###
if length < 0 or width < 0:
raise ValueError("Length and width must be positive values.")
area = length * width
return area

def main():
# -----------------------------------------------------------------------
Prompts the user for rectangle dimensions and prints the calculated area
# -----------------------------------------------------------------------
try:
length = float(input("Enter the length of the rectangle: "))
width = float(input("Enter the width of the rectangle: "))
# Call the area calculation function
area = calculate_area(length, width)
print(f"The area of the rectangle is approximately {area:.2f} square units.")
except ValueError as error:
print(f"Error: {error}")

Page 4 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# -----------------------------------------------------------------------
# Main program Your notes
# -----------------------------------------------------------------------
main()

Logic errors
Test Test Expected outcome Actual outcome Changes needed?
number data (Y/N)

1 Length "The area of the rectangle is "The area of the rectangle is N


=5 approximately 25 square approximately 25.00 square
units." units."
Width =
5

2 Length "Length and width must be "The area of the rectangle is Y


= 10 positive values." approximately 0.00 square should not accept
units." 0 input as not
Width = positive
0

Logic error located on line if length < 0 or width < 0:


Logic error identified in expression < 0, should be <= 0 so that 0 is not accepted as valid input for length
or width

Runtime Errors
What is a runtime error?
A runtime error is where an error causes a program to crash
Examples of runtime errors are:
Dividing a number by 0
Index out of the range of an array
Unable to read or write a drive

Python code

Page 5 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

def calculate_area(length, width):


"""
Calculates the area of a rectangle Your notes
Inputs:
length (float): The length of the rectangle (positive value)
width (float): The width of the rectangle (positive value)
Returns:
float: The calculated area of the rectangle
Raises:
ValueError: If either length or width is non-positive
"""
if length < 0 or width < 0:
raise ValueError("Length and width must be positive values.")
area = length * width
return area

def main():
# -----------------------------------------------------------------------
Prompts the user for rectangle dimensions and prints the calculated area
# -----------------------------------------------------------------------
try:
length = float(input("Enter the length of the rectangle: "))
width = float(input("Enter the width of the rectangle: "))
# Call the area calculation function
area = calculate_area(length, width)
print(f"The area of the rectangle is approximately {area:.2f} square units.")
except ValueError as error:
print(f"Error: {error}")

# -----------------------------------------------------------------------
# Main program
# -----------------------------------------------------------------------
main()

Runtime errors
Test Test Expected outcome Actual outcome Changes needed?
number data (Y/N)

1 Length = "The area of the rectangle "The area of the rectangle is N


10 is approximately 100 approximately 100.00
square units." square units."
Width =
10

2 Length = "Program could not Program crashed Y


"abc" convert string to float, try should give error

Page 6 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Width = again" message and ask


0 user to enter again
Your notes

Runtime error located in


try:
length = float(input("Enter the length of the rectangle: "))
width = float(input("Enter the width of the rectangle: "))
# Call the area calculation function
area = calculate_area(length, width)
print(f"The area of the rectangle is approximately {area:.2f} square units.")
except ValueError as error:
print(f"Error: {error}")

Runtime error identified as missing iteration (while loop) so program does not ask user to enter width
and height again
Corrected code now includes a while loop
while True:
try:
length = float(input("Enter the length of the rectangle: "))
width = float(input("Enter the width of the rectangle: "))
# Call the area calculation function
area = calculate_area(length, width)
print(f"The area of the rectangle is approximately {area:.2f} square units.")
break # Exit the loop if successful
except ValueError as error:
print(f"Error: {error}")
print("Please enter positive values for length and width.")

Page 7 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Writing & Amending Algorithms


Your notes
Algorithmic Thinking
What is algorithmic thinking?
Algorithmic thinking is the process of creating step-by-step instructions in order to produce a
solution to a problem
Algorithmic thinking requires the use of abstraction and decomposition to identify each individual
step
Once each step has been identified, a precise set of rules (algorithm) can be created and the problem
will be solved
An example of algorithmic thinking is following a recipe, if the recipe is followed precisely it should lead
to the desired outcome
A set of traffic lights is an example of how algorithmic thinking can lead to solutions being automated

Examiner Tips and Tricks


Writing algorithms in an exam can be challenging and time consuming. It's important to allocate your
time carefully to not spend too little or too long writing an algorithm
You will likely make mistakes and rewrite your algorithm a few times. Use scrap paper or the back of
your exam paper if possible to sketch out your ideas before committing to your answer. This will
make your answer clearer, neater and easier to read, follow and understand
You may wish to chunk your algorithm into parts initially, for example, “This part will enter the grades”,
“this part will calculate the total”, and “This part will allocate grades”. You can then put the whole
algorithm together in order later
Make a plan before you start answering the question and writing your algorithm. A plan can be simple
but allows you to order your thoughts, for example:
Part 1: Declare and initialise variables
Part 2: Allocate marks for each subject
Part 3: Allocate grades for each student's subject
Part 4: Include a loop

Page 8 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Part 5: Output all necessary data


Pseudocode does not have a syntax, therefore you can write an algorithm in any way which is easily Your notes
understandable. Caution is advised to stick to IGCSE specification standards to ensure your answer
is consistent and easy for examiners to follow
Be sure to use variable names and data provided in the question as given. Failure to do so will lose
you marks
Remember to comment on your code. It helps both you and the examiner understand your answer
and also awards marks in the mark scheme!

Page 9 of 9
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Programming Concepts
Contents
Variables & Constants
Data Types
Input & Output
Sequence
Selection
Iteration
Totalling & Counting
String Handling
Arithmetic, Logical & Boolean Operators
Procedures & Functions
Local & Global Variables
Library Routines
Maintaining Programs

Page 1 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Variables & Constants


Your notes
Variables & Constants
What is a variable?
A variable is an identifier that can change in the lifetime of a program
Identifiers should be:
In mixed case (Pascal case)
Only contain letters (A-Z, a-z)
Only contain digits (0-9)
Start with a capital letter and not a digit
A variable can be associated a datatype when it is declared
When a variable is declared, memory is allocated based on the data type indicated

Pseudocode

DECLARE <identifier> : <datatype>

DECLARE Age : INTEGER

DECLARE Price : REAL

DECLARE GameOver : BOOLEAN

Python

score = int() # whole number

cost = float() # decimal number

light = bool() # data can only have one or two values

Page 2 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What is a constant?
A constant is an identifier set once in the lifetime of a program Your notes
Constants are named in all uppercase characters
Constants aid the readability and maintainability
If a constant needs to be changed, it should only need to be altered in one place in the whole program

Pseudocode

CONSTANT <identifier> ← <value>

CONSTANT PI ← 3.142

CONSTANT PASSWORD ← "letmein"

CONSTANT HIGHSCORE ← 9999

Python

PI = 3.142

VAT = 0.20

PASSWORD = "letmein"

Page 3 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data Types
Your notes
Data Types
What is a data type?
A data type is a classification of data into groups according to the kind of data they represent
Computers use different data types to represent different types of data in a program
The basic data types include:

Data type Used for Pseudocode Example

Integer Whole numbers INTEGER 10, -5, 0

Real Numbers with a fractional part (decimal) REAL 3.14, -2.5, 0.0

Character Single character CHAR 'a', 'B', '6', '£'

String Sequence of characters STRING "Hello world", "ABC", "@#!%"

Boolean True or false values BOOLEAN True, False

It is important to choose the correct data type for a given situation to ensure accuracy and efficiency
in the program
Data types can be changed within a program, this is called casting

Programming data types


Data type Pseudocode Python

Integer Number ← 5 number = 5

Real RealNumber ← 3.14 realNumber = 3.14

Character FirstNameInitial ← "a" firstNameInitial = "a"

Page 4 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

String Password ← "letmein" password = "letmein"

Your notes
Boolean LightSensor ← True lightSensor = True

Worked Example
Name and describe the most appropriate programming data type for each of the examples of data
given. Each data type must be different
[6]
Data: 83
Data: myemail@savemyexams.co.uk
Data: True
Answers
Data type name: Integer [1]
Data type description: The number is a whole number [1]
Data type name: String [1]
Data type description: It is a group of characters [1]
Data type name: Boolean [1]
Data type description: The value is True (or could be False) [1]

Page 5 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Input & Output


Your notes
Input & Output
What is an input?
An input is a value that is read from an input device and then processed by a computer program
Typical input devices include:
Keyboards - Typing text
Mice - Selecting item, clicking buttons
Sensors - Reading data from sensors such as temperature, pressure or motion
Microphone - Capturing audio, speech recognition
Without inputs, programs are not useful as they can't interact with the outside world and always
produce the same result
In programming the keyboard is considered the standard for user input
If the command 'INPUT' is executed, a program will wait for the user to type a sequence of characters
In other programming languages different command words can be used

Examples
Pseudocode (INPUT <identifier>) Python

INPUT Name name=input("Enter your name: ")

IF Name ← "James" OR Name ← "Rob" THEN... if name == "James" or name == "Rob":

What is an output?
An output is a value sent to an output device from a computer program
Typical output devices include:
Monitor - Displaying text, images or graphics
Speaker - Playing audio
Printer - Creating physical copies of documents or images

Page 6 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

In programming the monitor is considered the standard for user output


If the command 'OUTPUT' is executed, a program will output to the screen Your notes
In other programming languages different command words can be used
Examples
Pseudocode (OUTPUT <identifier(s)>) Python

INPUT Name name=input("Enter your name: ")

IF Name ← "James" OR Name ← "Rob" THEN if name == "James" or name == "Rob":

OUTPUT "Great names!" print("Great names!")

INPUT Name name=input("Enter your name: ")

IF Name ← "James" OR Name ← "Rob" THEN if name == "James" or name == "Rob":

OUTPUT "Love the name ", Name print("Love the name "+name)

Page 7 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Sequence
Your notes
Sequence
What is sequence?
Sequence refers to lines of code which are run one line at a time
The lines of code are run in the order that they written from the first line of code to the last line of code
Sequence is crucial to the flow of a program, any instructions out of sequence can lead to
unexpected behaviour or errors

Example 1
A simple program to ask a user to input two numbers, number two is subtracted from number one and
the result is outputted

Line Pseudocode

01 OUTPUT "Enter the first number"

02 INPUT Num1

03 OUTPUT "Enter the second number"

04 INPUT Num2

05 Result ← Num1 - Num2

06 OUTPUT Result

A simple swap of line 01 and line 02 would lead to an unexpected behaviour, the user would be
prompted to input information without knowing what they should enter

Example 2
Python example

This function calculates the area of a rectangle

Page 8 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Inputs:
length: The length of the rectangle Your notes
width: The width of the rectangle
Returns:
The area of the rectangle

def calculate_area(length, width):


return area
area = length * width

# ------------------------------------------------------------------------
# Main program
# ------------------------------------------------------------------------

length = 5
width = 3
correct_area = calculate_area(length, width)
print(f"Correct area (length * width): {correct_area}")

In the example, the sequence of instructions is wrong and would cause a runtime error
In the calculate_area() function a value is returned before it is assigned
The correct sequence is:
area = length * width
return area

Page 9 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Selection
Your notes
What is Selection?
Selection is when the flow of a program is changed, depending on a set of conditions
The outcome of this condition will then determine which lines or block of code is run next
Selection is used for validation, calculation and making sense of a user's choices
There are two ways to write selection statements:
if... then... else...
case...

If Statements
What is an If statement?
As If statements allow you to execute a set of instructions if a condition is true
They have the following syntax:

IF <condition>
THEN
<statement>
ENDIF
A detailed look at a Python IF statement:

Page 10 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Example
Concept Pseudocode Python

IF-THEN-ELSE IF Answer ← "Yes" if answer == "Yes":


THEN print("Correct")
OUTPUT "Correct" elif answer == "No":
ELSE print("Wrong")
OUTPUT "Wrong" else:
ENDIF print("Error")

Nested Selection
What is nested selection?
Nested selection is a selection statement within a selection statement, e.g. an If inside of another If
Nested means to be 'stored inside the other'

Page 11 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Example
Pseudocode Your notes

IF Player2Score > Player1Score


THEN
IF Player2Score > HighScore
THEN
OUTPUT Player2, " is champion and highest scorer"
ELSE
OUTPUT Player2, " is the new champion"
ENDIF
ELSE
OUTPUT Player1, " is still the champion"
IF Player1Score > HighScore
THEN
OUTPUT Player1, " is also the highest scorer"
ENDIF
ENDIF

Python

# Prompt the user to enter a number


print("Enter a number: ")
test_score = int(input())

# Outer statement to check if the test_score is above 40


if test_score > 40:
# Inner statement to assign the result from the test
if test_score > 70:
result = "Distinction"
elif test_score > 55:
result = "Merit"
else:
result = "Pass"
else:
result = "Fail"

# Output the result


print(result)

Case Statements
What is a case statement?

Page 12 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A case statement can mean less code but it only useful when comparing multiple values of the same
variable
Your notes
If statements are more flexible and are generally used more in languages such as Python
The format of a CASE statement is:
CASE OF <identifier>
<value 1> : <statement>
<value 2>: <statement>
....
OTHERWISE <statement>
ENDCASE

Concept Pseudocode Python

CASE INPUT Move day = "Sat"


match day:
CASE OF Move case "Sat":
'W' : Position ← Position - 10 print("Saturday")
'E' : Position ← Position + 10 case "Sun":
'A' : Position ← Position - 1 print("Sunday")
'D' : Position ← Position + 1 case _:
OTHERWISE print("Weekday")
OUTPUT "Beep"
ENDCASE

Examiner Tips and Tricks


Make sure to include all necessary components in the selection statement:
the condition,
the statement(s) to execute when the condition is true
any optional statements to execute when the condition is false
Use proper indentation to make the code easier to read and understand
Be careful with the syntax of the programming language being used, as it may differ slightly
between languages
Make sure to test the selection statement with various input values to ensure that it works as
expected

Page 13 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Worked Example
Write an algorithm using pseudocode that: Your notes
Inputs 3 numbers
Outputs the largest of the three numbers
[3]
Exemplar answer

Pseudocode
INPUT A
INPUT B
INPUT C

IF A > B
THEN
IF A > C
THEN
OUTPUT A
ELSE
OUTPUT C
ENDIF
ELSE
OUTPUT B
ENDIF

Python
if A > B and A > C:
print(A)
elif B > C:
print(B)
else:
print(C)

Page 14 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Iteration
Your notes
What is iteration?
Iteration is repeating a line or a block of code using a loop
Iteration can be:
Count controlled
Condition controlled
Nested

Count Controlled Loops


What is a count controlled loop?
A count controlled loop is when the code is repeated a fixed number of times (e.g. using a for loop)
A count controlled loop can be written as:

FOR <identifier> ← <value1> TO <value2>


<statements>
NEXT <identifier>
Identifiers must be an integer data type
It uses a counter variable that is incremented or decremented after each iteration
This can be written as:

FOR <identifier> ← <value1> TO <value2> STEP <increment>


<statements>
NEXT <identifier>
A detailed look at a Python FOR statement:

Page 15 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Examples
Iteration Pseudocode Python

Count controlled FOR X ← 1 TO 10 for x in range(10):


OUTPUT "Hello" print("Hello")
NEXT X

This will print the word "Hello" 10 times

FOR X ← 2 TO 10 STEP 2 for x in range(2,12,2):


OUTPUT X print(x)
NEXT X # Python range function excludes end value

This will print the even numbers from 2 to 10 inclusive

FOR X ← 10 TO 0 STEP -1 for x in range(10,-1,-1):


OUTPUT X print(x)
NEXT X # Python range function excludes end value

This will print the numbers from 10 to 0 inclusive

Condition Controlled Loops


Page 16 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

What is a condition controlled loop?


A condition controlled loop is when the code is repeated until a condition is met Your notes
There are two types of condition controlled loops:
Post-condition (REPEAT)
Pre-condition (WHILE)

Post-condition loops (REPEAT)


A post-condition loop is executed at least once
The condition must be an expression that evaluates to a Boolean (True/False)
The condition is tested after the statements are executed and only stops once the condition is
evaluated to True
It can be written as:

REPEAT
<statement>
UNTIL <condition>

Iteration Pseudocode Python

Post-condition REPEAT # NOT USED IN PYTHON


INPUT Colour
UNTIL Colour ← "red"

REPEAT # NOT USED IN PYTHON


INPUT Guess
UNTIL Guess ← 42

Pre-condition loops (WHILE)


The condition must be an expression that evaluates to a Boolean (True/False)
The condition is tested and statements are only executed if the condition evaluates to True
After statements have been executed the condition is tested again
The loop ends when the condition evaluates to False
It can be written as:

Page 17 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

WHILE <condition> DO
<statements> Your notes
ENDWHILE
A detailed look at a Python WHILE statement:

Iteration Pseudocode Python

Pre-condition WHILE Colour != "Red" DO while colour != "Red":


INPUT Colour colour = input("New colour")
ENDWHILE

INPUT Temperature temperature = float(input("Enter temperature: "))


WHILE Temperature > 37 DO while temperature > 37:
OUTPUT "Patient has a fever" print("Patient has a fever")
INPUT temperature temperature = float(input("Enter temperature: "))
END WHILE

Page 18 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Nested Iteration
Your notes
What is nested selection?
Nested iteration is a loop within a loop, e.g. a FOR inside of another FOR
Nested means to be 'stored inside the other'

Example
Pseudocode

Total ← 0

FOR Row ← 1 TO MaxRow


RowTotal ← 0

FOR Column ← 1 TO 10
RowTotal ← RowTotal + Amount[Row, Column]
NEXT Column

OUTPUT "Total for Row ", Row, " is ", RowTotal


Total ← Total + RowTotal

NEXT Row

OUTPUT "The grand total is ", Total

Python

# Program to print a multiplication table up to a given number

# Prompt the user to enter a number


number = int(input("Enter a number: "))

# Set the initial value of the counter for the outer loop
outer_counter = 1

# Outer loop to iterate through the multiplication table


while outer_counter <= number:
# Set the initial value of the counter for the inner loop
inner_counter = 1

# Inner loop to print the multiplication table for the current number
while inner_counter <= 10:
# Calculate the product of the outer and inner counters
product = outer_counter * inner_counter

Page 19 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# Print the multiplication table entry


print(outer_counter, "x", inner_counter, "=", product) Your notes
# Increment the inner counter
inner_counter = inner_counter + 1

# Move to the next number in the multiplication table


outer_counter = outer_counter + 1

Page 20 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Totalling & Counting


Your notes
Totalling & Counting
How do you use totalling in a program?
Totalling involves adding up values, often in a loop
A total variable is set to 0 at the beginning of the program and then updated within a loop, such as:

Pseudocode Python

Total ← 0 total = 0
FOR I ← 1 to 10 for i in range(1, 11):
INPUT Num num = int(input("Enter a number: "))
TOTAL ← TOTAL + Num total = total + num
NEXT I print("Total:", total)
OUTPUT Total

How do you use counting in a program?


Counting involves keeping track of the number of times a particular event occurs
A count variable is set to 0 and then updated within a loop, such as:

Pseudocode Python

Count ← 0 count = 0
FOR I ← 1 to 10 for i in range(1, 11):
INPUT Num num = int(input("Enter a number: "))
IF Num > 5 if num > 5:
THEN count = count + 1
Count ← Count + 1 print("Count:", count)
ENDIF
NEXT I
OUTPUT Count

Worked Example
Write an algorithm using pseudocode that:

Page 21 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Inputs 20 numbers
Outputs how many of these numbers are greater than 50
[3] Your notes
Answer
Count = 0
FOR x ← 1 TO 20 [1]
INPUT Number
IF Number > 50
THEN
Count ← Count + 1 [1]
NEXT x
PRINT Count [1]

Page 22 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

String Handling
Your notes
String Handling
What is string manipulation?
String manipulation is the use of programming techniques to modify, analyse or extract information
from a string
Examples of string manipulation include:
Case conversion (modify)
Length (analyse)
Substrings (extract)

Case conversion
The ability to change a string from one case to another, for example, lower case to upper case

Function Pseudocode Python Output

Uppercase Name ← "Sarah" Name = "Sarah" "SARAH"


OUTPUT UCASE(Name) print(Name.upper())

Lowercase Name ← "SARAH" Name = "SARAH" "sarah"


OUTPUT LCASE(Name) print(Name.lower())

Length
The ability to count the number of characters in a string, for example, checking a password meets the
minimum requirement of 8 characters

Pseudocode Python Output

Password ← "letmein" Password = "letmein" 7


OUTPUT LENGTH(Password) print(len(Password))

Page 23 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Password ← "letmein" Password = "letmein" "Password too short"


IF LENGTH(Password) >= 8 if len(Password) >= 8:
THEN print("Password accepted") Your notes
OUTPUT "Password accepted" else:
ELSE print("Password too short")
OUTPUT "Password too short"
ENDIF

Substring
The ability to extract a sequence of characters from a larger string in order to be used by another
function in the program, for example, data validation or combining it with other strings
Extracting substrings is performed using 'slicing', using specific start and end to slice out the desired
characters
Substring has a start position of 1 in pseudocode and 0 in Python

Pseudocode Python Output

Word ← "Revision" Word = "Revision" "Rev"


OUTPUT SUBSTRING(Word, 1, 3) print(Word[0:2])

Word ← "Revision" Word = "Revision" "visi"


OUTPUT SUBSTRING(Word, 3, 6) print(Word[2:5])

Worked Example
The function Length(x) finds the length of a string x. The function substring(x,y,z) finds a substring of x
starting at position y and z characters long. The first character in x is in position 1.
Write pseudocode statements to:
Store the string “Save my exams” in x
Find the length of the string and output it
Extract the word exams from the string and output it
[6]
Answer
X ← "Save my exams"

# [1] for storing string in X

Page 24 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

OUTPUT LENGTH(X)
Your notes
# [1] for calling the function length. [1] for using the correct parameter X

Y←9

Z←5

OUTPUT SUBSTRING(X,Y,Z)

# [1] for using the substring function.

# [1] for correct parameters

# [1] for outputting length and substring return values

Page 25 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Arithmetic, Logical & Boolean Operators


Your notes
What is an operator?
An operator is a symbol used to instruct a computer to perform a specific operation on one or more
values
Examples of common operators include:
Arithmetic
Logical
Boolean

Arithmetic Operators
Operator Pseudocode Python

Addition + +

Subtraction - -

Multiplication * *

Division / /

Modulus (remainder after division) MOD %

Quotient (whole number division) DIV //

Exponentiation (to the power of) ^ **

To demonstrate the use of common arithmetic operators, three sample programs written in Python are
given below
Comments have been included to help understand how the arithmetic operators are being used
Arithmetic operators #1 - a simple program to calculate if a user entered number is odd or even
Arithmetic operators #2 - a simple program to calculate the area of a circle from a user inputted
radius
Page 26 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Arithmetic operators #3 - a simple program that generates 5 maths questions based on user
inputs and gives a score of how many were correctly answered at the end
Your notes
Python code

# -----------------------------------------------------------------------
# Arithmetic operators #1
# -----------------------------------------------------------------------
# Get the user to input a number
user_input = int(input("Enter a number: "))

# If the remainder of the number divided by 2 is 0, the number is even


if user_input % 2 == 0:
print("The number is even.")
else:
print("The number is odd.")

# -----------------------------------------------------------------------
# Arithmetic operators #2
# -----------------------------------------------------------------------
# Get the radius from the user
radius = float(input("Enter the radius of the circle: "))

# Calculate the area of the circle


area = 3.14159 * radius ** 2

# Display the calculated area


print("The area of the circle with radius", radius, "is", area)

# ------------------------------------------------------------------------
# Arithmetic operators #3
# ------------------------------------------------------------------------
# Set the score to 0
score = 0

# Loop 5 times
for x in range(5):
num1 = int(input("Enter the first number: "))
operator = input("Enter the operator (+, -, *): ")
num2 = int(input("Enter the second number: "))
user_answer = int(input("What is " + str(num1) + " " + str(operator) + " " + str(num2) + "? "))

# Check the answer and update the score


if operator == '+':
correct_answer = num1 + num2
elif operator == '-':
correct_answer = num1 - num2
elif operator == '*':

Page 27 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

correct_answer = num1 * num2


else:
print("Invalid operator!") Your notes
continue

if user_answer == correct_answer:
score = score + 1
else:
print("Sorry, that's incorrect.")

# Display the final score


print("Your score is:", score)

Logical Operators
Operator Pseudocode Python

Equal to == ==

Not equal to <> !=

Less than < <

Less than or equal to <= <=

Greater than > >

Greater than or equal to >= >=

Boolean Operators
A Boolean operators is a logical operator that can be used to compare two or more values and return a
Boolean value (True or False) based on the comparison
There are 3 main Boolean values:
AND: Returns True if both conditions are True
OR: Returns True if one or both conditions are True
NOT: Returns the opposite of the condition (True if False, False if True)

Page 28 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

To demonstrate the use of common Boolean operators, three sample programs written in Python are
given below
Your notes
Comments have been included to help understand how the Boolean operators are being used
Common Boolean operators #1 - a simple program that assigns Boolean values to two variables
and outputs basic comparisons
Common Boolean operators #2 - a simple program to output a grade based on a users score
Common Boolean operators #3 - a simple program reads a text files and searches for an inputted
score

Python code

# -----------------------------------------------------------
# Common Boolean operators #1
# -----------------------------------------------------------
# Assign a Boolean value to a and b
a = True
b = False

# Print the result of a and b


print("a and b:", a and b)
# Print the result of a or b
print("a or b:", a or b)
# Print the result of not a
print("not a:", not a)

# -----------------------------------------------------------
# Common Boolean operators #2
# -----------------------------------------------------------
# Take input for the score from the user
score = int(input("Enter the score: "))

# Compare the score and output the corresponding grade


if score >= 90 and score <= 100:
print("Grade: A")
elif score >= 80 and score < 90:
print("Grade: B")
elif score >= 70 and score < 80:
print("Grade: C")
elif score < 70:
print("Fail")

# -----------------------------------------------------------
# Common Boolean operators #3
# -----------------------------------------------------------

Page 29 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# Open the file for reading


try:
file = open("scores.txt", "r") Your notes
# Set flags to false
end_of_file = False
found = False
score = input("Enter a score: ")

# While it's not the end of the file and the score has not been found
while not end_of_file and not found:
# Read the line
scores = file.readline().strip()

# If the line equals the score


if score == str(scores):
found = True
print("Score found")

# If the line is empty (i.e., end of file)


if scores == "":
end_of_file = True
if not found:
print("Score not found")

# Close the file after reading


file.close()

except FileNotFoundError:
print("The file 'scores.txt' was not found.")

Examiner Tips and Tricks


Boolean operators are often used in conditional statements such as if, while, and for loops
Boolean operators can be combined with comparison operators
Be careful when using the NOT operator, as it can sometimes lead to unexpected results
It is always a good idea to test your code with different inputs to ensure that it works as
expected

Page 30 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Procedures & Functions


Your notes
What are functions and procedures?
Functions and procedures are a type of sub program, a sequence of instructions that perform a
specific task or set of tasks
Procedures and functions are defined at the start of the code
Sub programs are often used to simplify a program by breaking it into smaller, more manageable
parts
Sub programs can be used to:
Avoid duplicating code and can be reused throughout a program
Improve the readability and maintainability of code
Perform calculations, to retrieve data, or to make decisions based on input
Parameters are values that are passed into a sub program
Parameters can be variables or values and they are located in brackets after the name of the sub
program
Example: FUNCTION TaxCalculator(pay,taxcode) OR PROCEDURE TaxCalculator(pay,taxcode)
Sub programs can have multiple parameters
To use a sub program you 'call' it from the main program

What's the difference between a function and procedure?


A Function returns a value whereas a procedure does not

Procedures
Procedures are defined using the PROCEDURE keyword in pseudocode or def keyword in Python
A procedure can be written as:

PROCEDURE <identifier>
<statements>
ENDPROCEDURE
Or if parameters are being used:

Page 31 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

PROCEDURE <identifier>(<param1>:<data type>, <param2>:<data type>...)


<statements>
ENDPROCEDURE Your notes
Creating a procedure

Pseudocode

PROCEDURE calculate_area(length: INTEGER, width: INTEGER)


area ← length * width
OUTPUT "The area is " + area
END PROCEDURE

Python

def ageCheck(age):
if age > 18:
print("You are old enough")
else:
print("You are too young")

To call a procedure, it can be written as:

CALL <identifier>
CALL <identifier>(Value1,Value2...)

Calling a procedure

Pseudocode

CALL Calculate_area
CALL Calculate_area(5,3)

Python

ageCheck(21)
print(ageCheck(21))

Examples
A Python program using procedures to display a menu and navigate between them

Page 32 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Procedures are defined at the start of the program and the main program calls the first procedure to
start
Your notes
In this example, no parameters are needed
Procedures

# Procedure definition for the main menu


def main_menu():
# Outputs the options
print("1. Addition")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")
print("5. Exit")

# Asks the user to enter their choice


choice = int(input("Enter your choice: "))
if choice == 1:
addition()
elif choice == 2:
subtraction()
elif choice == 3:
multiplication()
elif choice == 4:
division()
elif choice == 5:
exit_program()

# Procedure definition for addition


def addition():
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
print("Result:", num1 + num2)

# Procedure definition for subtraction


def subtraction():
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
print("Result:", num1 - num2)

# Procedure definition for multiplication


def multiplication():
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
print("Result:", num1 * num2)

# Procedure definition for division


def division():
num1 = int(input("Enter the first number: "))

Page 33 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

num2 = int(input("Enter the second number: "))


if num2 != 0:
print("Result:", num1 / num2) Your notes
else:
print("Error: Division by zero is not allowed.")

# Procedure to exit the program


def exit_program():
print("Exiting the program. Goodbye!")
exit()

# Main program
while True: # Loop to continuously show the menu until the user chooses to exit
main_menu()

Functions
Functions are defined using the FUNCTION keyword in pseudocode or def keyword in Python
Functions always return a value so they do not use the CALL function, instead they are called within an
expression
A function can be written as:

FUNCTION <identifier> RETURNS <data type>


<statements>
ENDFUNCTION
Or if parameters are being used:

FUNCTION <identifier>(<param1>:<data type>, <param2>:<data type>...) RETURNS <data type>


<statements>
ENDFUNCTION

Creating and using a function

Pseudocode

FUNCTION calculate_area(length: INTEGER, width: INTEGER)


area ← length * width
RETURN area
ENDFUNCTION

# Output the value returned from the function


OUTPUT(calculate_area(5,3))

Page 34 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Python
Your notes
def squared(number):
squared = number^2
return squared

# Output the value returned from the function


print(squared(4))

Examples
A Python program using a function to calculate area and return the result
Two options for main program are shown, one which outputs the result (# 1) and one which stores the
result so that it can be used at a later time (# 2)

Functions

# Function definition, length and width are parameters


def area(length, width):
area = length * width # Calculate area
return area # Return area

# Main program #1
length = int(input("Enter the length: "))
width = int(input("Enter the width: "))
print(area(length, width)) # Calls the area function and prints the result

# Main program #2
length = int(input("Enter the length: ")) # Input for length
width = int(input("Enter the width: ")) # Input for width
calculated_area = area(length, width) # Stores the result of the function in a variable
print("The area is " + str(calculated_area) + " cm^2") # Outputs the result with a message

Worked Example
An economy-class airline ticket costs £199. A first-class airline ticket costs £595.
(A) Create a function, flightCost(), that takes the number of passengers and the type of ticket as
parameters, calculates and returns the price to pay.
You do not have to validate these parameters

Page 35 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

You must use :


a high-level programming language that you have studied [4] Your notes
(B) Write program code, that uses flightCost(), to output the price of 3 passengers flying economy.
You must use :
a high-level programming language that you have studied [3]
How do I answer this question?
(A)
Define the function, what parameters are needed? where do they go?
How do you calculate the price?
Return the result
(B)
How do you call a function?
What parameters does the function need to return the result?
Answers

Part Python

A def flightCost(passengers, type):


if type == "economy":
cost = 199 * passengers
elif type == "first":
cost = 595 * passengers
return cost

B print(flightCost("economy", 3)

OR
x = flightCost("economy", 3)

print(x)

Page 36 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Local & Global Variables


Your notes
Local Variables
What is a local variable?
A local variable is a variable declared within a specific scope, such as a function or a code block
Local variables are accessible only within the block in which they are defined, and their lifetime is
limited to that particular block
Once the execution of the block ends, the local variable is destroyed, and its memory is released

Python example
In this python code, you can see that the localVariable (with the value 10) is declared inside of the
function printValue
This means that only this function can access and change the value in the local variable
It cannot be accessed by other modules in the program

Local variables

def printValue():
localVariable = 10 # Defines a local variable inside the function
print("The value of the local variable is:", localVariable)

printValue() # Call the function

Global Variables
What is a global variable?
A global variable is a variable declared at the outermost level of a program.
They are declared outside any modules such as functions or procedures
Global variables have a global scope, which means they can be accessed and modified from any part
of the program

Python example
In this python code, you can see that the globalVariable (with the value 10) is declared outside of the
function printValue

Page 37 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

This means that this function and any other modules can access and change the value in the global
variable
Your notes
Global variables

globalVariable = 10 # Defines a global variable

def printValue():
global globalVariable
print("The value into the variable is:", globalVariable)

printValue() # Call the function

Page 38 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Library Routines
Your notes
Library Routines
What are library routines?
A library routine is reusable code that can be used throughout a program
The code has been made public through reusable modules or functions
Using library routines saves programmers time by using working code that has already been tested
Some examples of pre-existing libraries are:
Random
Round

Random
The random library is a library of code which allows users to make use of 'random' in their programs
Examples of random that are most common are:
Random choices
Random numbers
Random number generation is a programming concept that involves a computer generating a random
number to be used within a program to add an element of unpredictability
Examples of where this concept could be used include:
Simulating the roll of a dice
Selecting a random question (from a numbered list)
National lottery
Cryptography

Concept Pseudocode Python

Page 39 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Random numbers RANDOM(1,6) import random

number = random.randint(1,10) Your notes


number = random.randint(-1.0,10.0)

Random choice import random

choice = random.choice()

Examples in Python
Random code

# importing random library


import random

# asking user to enter a username and password


user = input("Enter a username: ")
pw = input("Enter a password: ")

# checking if the user and password are correct


if user == "admin" and pw == "1234":
# generating a random 4-digit code
code = random.randint(1000, 9999)

# printing the code


print("Your code is", code)
else:
print("Invalid username or password.")

National lottery

import random

# Create a list of numbers for the national lottery


lottery_numbers = list(range(1, 50))

# Create an empty list to store the chosen numbers


chosen_numbers = []

# Loop to pick 6 numbers from the list


for _ in range(6):
# Use random.choice to pick a number from the list
number = random.choice(lottery_numbers)

Page 40 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# Add the chosen number to the list of chosen numbers


chosen_numbers.append(number) Your notes
# Remove the chosen number from the list of available numbers
lottery_numbers.remove(number)

# Sort the chosen numbers in ascending order


chosen_numbers.sort()

# Output the chosen numbers


print("The winning numbers are:", chosen_numbers)

Round
The round library is a library of code which allows users to round numerical values to a set amount of
decimal places
An example of rounding is using REAL values and rounding to 2 decimal places
The round library can be written as:

ROUND(<identifier>, <places>)

Concept Pseudocode Python

Round Cost ← 1.9556 number = 3.14159 rounded_number = round(number, 2)


OUTPUT ROUND(Cost,2) print(rounded_number)
# Outputs 1.95 # Outputs 3.14

Page 41 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Maintaining Programs
Your notes
Maintaining Programs
How do you write programs that are easy to maintain?
Easy to maintain programs are written using techniques that make code easy to read
Programmers should be consistent with the use of techniques such as:
Layout - spacing between sections
Indentation - clearly defined sections of code
Comments - explaining key parts of the code
Meaningful variable names - describe what is being stored
White space - adding suitable spaces to make it easy to read
Sub-programs - Functions or procedures used where possible
When consistency is applied, programs are easy to maintain

Example easy to-maintain program


Python code

Calculates the area of a triangle given its base and height


Inputs:
base (float): The length of the triangle's base (positive value)
height (float): The height of the triangle from the base (positive value)
Returns:
The calculated area of the triangle (float)
Raises:
ValueError: If either base or height is non-positive

def calculate_area_of_triangle(base, height):


if base <= 0 or height <= 0:
raise ValueError("Base and height must be positive values.")

Page 42 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

area = 0.5 * base * height # Corrected multiplication syntax


return area
Your notes
def main():
# -----------------------------------------------------------------------
# Prompts the user for triangle base and height, calculates and prints the area
# -----------------------------------------------------------------------
try:
base = float(input("Enter the base of the triangle: "))
height = float(input("Enter the height of the triangle: "))

# Call the area calculation function


area = calculate_area_of_triangle(base, height)

print(f"The area of the triangle is approximately {area:.2f} square units.")

except ValueError as error:


print(f"Error: {error}")

# ------------------------------------------------------------------------
# Main program
# ------------------------------------------------------------------------

main()

Page 43 of 43
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Arrays
Contents
Arrays

Page 1 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Arrays
Your notes
1-Dimensional Arrays
What is an array?
An array is an ordered, static set of elements in a fixed-size memory location
An array can only store 1 data type
A 1D array is a linear array
Indexes start at generally start at 0, known as zero-indexed

Concept Pseudocode Python

Create DECLARE scores: ARRAY[0:4]OF INTEGER scores = []

Creates a blank array with 5 elements (0-4) Creates a blank array

scores ← [12, 10, 5, 2, 8] scores = [12, 10, 5, 2, 8]

Creates an array called scores with values assigned

Assignment colours[4] ← "Red" colours[4] = "Red"

Page 2 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Assigns the colour "Red" to index 4 (5th element)


Your notes
Example in Python
Creating a one-dimensional array called ‘array’ which contains 5 integers.
Create the array with the following syntax:
array = [1, 2, 3, 4, 5]

Access the individual elements of the array by using the following syntax:
array[index]

Modify the individual elements by assigning new values to specific indexes using the following syntax:
array[index] = newValue

Use the len function to determine the length of the array by using the following syntax:
len(array)

In the example the array has been iterated through to output each element within the array. A for loop
has been used for this

Python

Page 3 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

# Creating a one-dimensional array


array = [1, 2, 3, 4, 5]
Your notes
# Accessing elements of the array
print(array[0]) # Output: 1
print(array[2]) # Output: 3

# Modifying elements of the array


array[1] = 10
print(array) # Output: [1, 10, 3, 4, 5]

# Iterating over the array


for element in array:
print(element)

# Output:
#1
# 10
#3
#4
#5

# Length of the array


length = len(array)
print(length) # Output: 5

2-Dimensional Arrays
What is a 2-dimensional array?
A 2D array extends the concept on a 1D array by adding another dimension
A 2D array can be visualised as a table with rows and columns
When navigating through a 2D array you first have to go down the rows and then across the columns to
find a position within the array

Page 4 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Concept Pseudocode Python

Create DECLARE NamesAndNumbers : ARRAY[1:3, 1:3] OF NamesAndNumbers = [],[]


STRING

Creates a blank 2D array with 3 elements Creates a blank 2D array


(0-2)

NamesAndNumbers[1, 2] ← "John" NamesAndNumbers = ["Rob","Paul","Hayley"],


[10, 5, 8]
NamesAndNumbers[1, 3] ← "Emily"

NamesAndNumbers[2, 1] ← "25"

NamesAndNumbers[2, 2] ← "33"

NamesAndNumbers[2, 3] ← "19"

NamesAndNumbers[3, 1] ← "Sarah"

NamesAndNumbers[3, 2] ← "12"

NamesAndNumbers[3, 3] ← "8"

Creates a 2D array called players with values assigned

Assignment NamesAndNumbers[0,1] ← "Holly" NamesAndNumbers[0][1] = "Holly"

Page 5 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Assigns the name "Holly" to index 0, 1 (1st row, 2nd column) - replaces "Paul"
Your notes
Example in Python
Initialising a 2D array with 3 rows and 3 columns, with the specified values

array_2d = [[1, 2, 3],


[4, 5, 6],
[7, 8, 9]]

# Accessing elements in the 2D array


print(array_2d[0][0]) # Output: 1
print(array_2d[1][2]) # Output: 6

Iterating through a 2-dimensions array


When iterating through an array, a nested for loop can be used

Nested iteration to access items in the 2D array

for row in array_2d:


for item in row:
print(item, end=" ")
print() # Print a newline after each row

Examiner Tips and Tricks


In the exam, the question will always give an example to demonstrate which order the array is being
read from.
Some questions can be X,Y and others can be Y, X. Always refer to the example before giving your
answer!

Worked Example
A parent records the length of time being spent watching TV by 4 children

Page 6 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Data for one week (Monday to Friday) is stored in a 2D array with the identifier minsWatched.
The following table shows the array Your notes
Quinn Lyla Harry Elias

0 1 2 3

Monday 0 34 67 89 78

Tuesday 1 56 43 45 56

Wednesday 2 122 23 34 45

Thursday 3 13 109 23 90

Friday 4 47 100 167 23

Write a line of code to output the number of minutes that Lyla watched TV on Tuesday [1]
Write a line of code to output the number of minutes that Harry watched TV on Friday [1]
Write a line of code to output the number of minutes that Quinn watched TV on Wednesday [1]

Answers
print(minsWatched[1,1] or print(minsWatched[1][1]
print(minsWatched[2,4] or print(minsWatched[2][4]
print(minsWatched[0,2] or print(minsWatched[0][2]

Page 7 of 7
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
File Handling
Contents
File Handling

Page 1 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

File Handling
Your notes
File Handling
What is file handling?
File handling is the use of programming techniques to work with information stored in text files
Examples of file handing techniques are:
opening text files
reading text files
writing text files
closing text files

Concept OCR exam reference Python

Open OPENFILE "fruit.txt" FOR READ file = open("fruit.txt","r")

Close CLOSEFILE "fruit.txt" file.close()

Read line READFILE "fruit.txt", LineOfText file.readline()

Write line OPENFILE "fruit.txt" FOR WRITE file.write("Oranges")

WRITEFILE "fruit.txt", "Oranges"

Append a file OPENFILE "fruit.txt" FOR APPEND file = open("shopping.txt","a")

Python example (reading data)


Employees Text file

# Open file in read mode Greg


file = open("employees.txt", "r") Sales
39000
endOfFile = False # Set end of file flag to false
43
while not endOfFile: # While not end of file Lucy
Human resources
Page 2 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

name = file.readline().strip() # Read line 1 and remove extra spaces/newlines 26750


department = file.readline().strip() # Read line 2 28
salary = file.readline().strip() # Read line 3
Jordan Your notes
age = file.readline().strip() # Read line 4
Payroll
if name == "": # If name is empty (end of file) 45000
endOfFile = True # Set end of file flag to true 31
else:
print("Name: ", name) # Print name
print("Department: ", department) # Print department
print("Salary: ", salary) # Print salary (fixed typo)
print("Age: ", age) # Print age
print() # Add a blank line for readability

# Close the file


file.close()

Python example (writing new data)


Employees Text file

# Open file in append mode Greg


file = open("employees.txt", "a") Sales
39000
# Write employee details to the file
file.write("Polly\n") # Name
43
file.write("Sales\n") # Department Lucy
file.write("26000\n") # Salary Human resources
file.write("32\n") # Age 26750
28
# Close the file Jordan
file.close()
Payroll
45000
31
Polly
Sales
26000
32

Examiner Tips and Tricks

Page 3 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

When opening files it is really important to make sure you use the correct letter in the open
command
Your notes
"r" is for reading from a file only
"w" is for writing to a new file, if the file does not exist it will be created. If a file with the same
name exists the contents will be overwritten
"a" is for writing to the end of an existing file only
Always make a backup of text files you are working with, one mistake and you can lose the contents!

Worked Example
Use pseudocode to write an algorithm that does the following :
Inputs the title and year of a book from the user.
Permanently stores the book title and year to the existing text file books.txt [4]
How to answer this question
Write two input statements (title and year of book)
Open the file
Write inputs to file
Close the file
Example answer
title = input("Enter title")
year = input("Enter year")
file = open("books.txt")
file.writeline(title)
file.writeline(year)
file.close()

Guidance

title = input("Enter title") 1 mark

year = input("Enter year")

file = open("books.txt") 1 mark

file.writeline(title) 1 mark

file.writeline(year)

file.close() 1 mark

Page 4 of 4
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Databases
Contents
Single Table Databases
Primary Keys

Page 1 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Single Table Databases


Your notes
What is a database?
A Database is an organised collection of data
A database is made up of either one or multiple tables which are made up of fields and records to
organise how it stores data
It allows easy storage, retrieval, and management of information
A database is useful when working with large amounts of data, databases are stored on secondary
storage
A database is often stored on remote servers so multiple users can access it at the same time, useful
for online systems
Data can be sorted and searched efficiently, making use of more advanced structures
They are more secure than text files

Fields & records


What are fields & records?
A field is one piece of information relating to one person, item or object
A field is represented in a database by a column,
A record is a collection of fields relating to one person, item or object
A record is represented in a database by a row

Text files
A text file is useful when working with small amounts of data, text files are stored on secondary storage
and 'read' into a program when being used
They are used to store information when the application is closed
Each entry is stored on a new line or separated with a special identifier, for example, a comma (',')
It can be difficult in text files to know where a record begins and ends

Page 2 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Validation
When a table is created, validation rules can be assigned to the different fields
A validation rule controls what data can be entered into that field
There are different types of validation checks used to limit what data can be entered into each
field
The validation checks that are used are the same as those that appear in section 7: Algorithm
Design & Problem-Solving

Type Description

Length This type of validation checks the number of characters that have been entered into a field.
Check For example, you might make phone numbers entered have to be eleven characters long

Format This type of validation checks data entered meets an exact format. For example, a product
Check code might have to be two letters followed by five numbers

Page 3 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Range A range check will check the number entered is within a specific range. For example, the
Check age of a dog would be between 0 - 40. Any other number would be disallowed
Your notes
Presence A presence check can be added to fields which cannot be left blank
Check

Type A type check will allow data with a specific data type to be entered into a field. For
Check example, if text was entered into a field which is supposed to contain the date of birth of a
person it would not be allowed

Check Check digit validation is a process used to verify the accuracy of numbers such as credit
Digits card numbers. A check digit is a single digit added to the end of the number, which is
calculated based on a specific algorithm applied to the other digits in the number. When
the data is re-entered the same algorithm can be applied, and if it produces a different
result the code is incorrect

Examiner Tips and Tricks


You will likely be presented with an example database table and identify either how many fields there
are or how many records there are so make sure you remember a record is a row and a field is a
column.

Worked Example
A Database Table Containing Student Grades

StudentID FirstName LastName MarkSubmitted Percentage

1483792 Shanay Giles Y 55

1498378 Poppy Petit N 20

1500121 Diya Dinesh Y 74

1382972 Joe Swaile Y 68

1598264 Anton Smith Y 34

Page 4 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

1548282 Felicity Hall N 47


Your notes
Describe two validation checks that could be used to check data being inputted into the table
above [4]
How to answer this question
This
Answer
StudentID could have a length check to ensure 7 characters are entered [2]
FirstName and LastName could have a presence check to make a record cannot be entered without
entering the name of the student [2]
A type check of boolean could be applied to the Mark Submitted field so that only Y or N are entered
[2]
A range check could be assigned to the Mark column to ensure only numbers between 0 and 100
are entered [2]

Data types
What is a data type?
A data type is the type of data that can be held in a field and is defined when designing a table
Examples of common datatypes are:
Integer - whole number
Real - decimal number
Text/alphanumeric - text data
Character - single
Date/Time
Boolean - true or false values
In the table cars below, the following datatypes would be used:
car_id: integer
make: text/alphanumeric
model: text/alphanumeric
colour: text/alphanumeric

Page 5 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

price: real
cars
Your notes
car_id make model colour price

1 Peugeot 2008 Red 24950

2 Mazda MX5 Blue 17995

3 Citroen DS4 Black 21450

4 Ford Puma White 19500

Page 6 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Primary Keys
Your notes
Primary Keys
What is a primary key?
A primary key is a unique field that can be used to identify a record in a table
customer_id is the primary key for the customers table below
Other examples of primary keys in database tables would include:
Student_ID in a school database
Car_Registration in a car database
Product_ID in a shop database

CustomerID FirstName LastName DOB PhoneNumber

001 Andrea Bycroft 05031976 0746762883

002 Melissa Langler 22012001 0756372892

003 Amy George 22111988 074637

Key database terminology


Term Definition

Table A collection of records with a similar structure

Record A group of related fields, representing one data entry

Field A single piece of data in a record

Data type Type of data held in a field

Page 7 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Primary A unique identifier for each record in a table. Usually an ID number


key
Your notes
Foreign A field in a table that refers to the primary key in another table. Used to link tables and
key create relationships

Worked Example
A database has been developed for a dance club to store information about their members.
The database contains one table: Members
Figure A shows some data from the table.
Members

MemberID FirstName LastName DateJoined

1 Zarmeen Hussain 2024-01-19

2 Fyn Ball 2024-02-01

3 George Johnson 2024-02-25

4 Ella Franks 2024-03-04

State the name of the field from the Members table that is the most suitable to use as the primary
key [1]
Answer
(a) MemberID

Page 8 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
SQL
Contents
SQL

Page 1 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

SQL
Your notes
SQL
What is SQL?
SQL (Structured Query Language) is a programming language used to interact with a DBMS.
The use of SQL allows a user to:
Select data
Order data
Sum data
Count data

Selecting data commands


Command Description Example

SELECT Retrieves data from a SELECT * FROM users;


database table (retrieves all data from the 'users' table)
SELECT name, age
FROM users
(retrieves names and ages from the 'users' table)

FROM Specifies the tables to SELECT name, age FROM users;


retrieve data from (retrieves names and ages from the 'users' table)

WHERE Filters the data based on a SELECT * FROM users


specified condition WHERE age > 30;
(Retrieves users older than 30)

AND Combines multiple SELECT * FROM users


conditions in a WHERE WHERE age > 18 AND city = 'New York';
clause (retrieves users older than 18 and from New York)

Page 2 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

OR Retrieves data when at SELECT * FROM users


least one of the WHERE age < 18 OR city = 'New York';
Your notes
conditions is true (retrieves users younger than 18 or from New York)

WILDCARDS '*' and '%' symbols are SELECT * FROM users;


used for searching and (retrieves all columns for the 'users' table)
matching data
'*' used to select all SELECT * FROM users WHERE name LIKE 'J%';
columns in a table (retrieves users whose names start with 'J')
'%' used as a wildcard
character in the LIKE
operator

ORDER BY How data is organised SELECT Forename, Lastname FROM Students


(sorted) when it is WHERE StudentID < 10
retrieved ORDER BY Lastname, Forename ASC
(retrieves only the forename and lastname of all students
from the students table who have a studentID of less than 10
and displays in ascending order by lastname and forename)

SUM Adds up and outputs the SELECT SUM(Salary) FROM tbl_people;


sum of a field

COUNT Counts the number of SELECT COUNT(*)


files which match the set
criteria FROM tbl_people
WHERE Salary > 50000;

Examples
Select all the fields from the Customers table
Command:

SELECT * FROM Customers;

Output:

Page 3 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

ID Name Age City Country


Your notes
1 John Doe 30 New York USA

2 Jane Doe 25 London UK

3 Peter Lee 40 Paris France

Select the ID, name & age of customers who are older than 25
Command:

SELECT ID, name, age


FROM Customers
WHERE Age > 25;

Output:

ID Name Age

1 John Doe 30

3 Peter Lee 40

Select the name and country of customers who are from a country that begins with 'U'
Command:

SELECT Name, Country


FROM Customers
WHERE Country LIKE 'U%';

Output:

Name Country

Page 4 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

John Doe USA


Your notes
Jane Doe UK

Select all fields of customers who are from 'London' or 'Paris'


Command:

SELECT *
FROM Customers
WHERE City = 'London' OR City = 'Paris';

Output:

ID Name Age City Country

2 Jane Doe 25 London UK

3 Peter Lee 40 Paris France

Worked Example
Below is a table of animals called tbl_animals

Animal Breeding Number of Young

Red Fox Yes 4-6

Rabbit Yes 4-12

African Elephant Yes 1

Blue Whale No 1

Orangutan Yes 1

Polar Bear Yes 1-3

Dolphin Yes 1

Page 5 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Kangaroo Yes 1

Lion Yes 1-6 Your notes

Penguin Yes 1

Complete this SQL statement to display all of the animal breeds that are currently breeding and
there was only one young born this year [3]
SELECT .................................................
FROM .................................................
WHERE .................................................
Answer
SELECT Animal [1]
FROM tbl_animals [1]
WHERE Number of Young == 1 [1]

Page 6 of 6
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Cambridge (CIE) IGCSE Your notes


Computer Science
Boolean Logic
Contents
Logic Gates
Logic Circuits
Truth Tables
Logic Expressions

Page 1 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Logic Gates
Your notes
Logic gates
What is Boolean logic?
Boolean logic is used in computer science and electronics to make logical decisions
Boolean operators are either TRUE or FALSE, often represented as 1 or 0
Inputs and outputs are given letters to represent them
To define Boolean logic we use special symbols to make writing expressions much easier

What are logic gates?


Logic gates are a visual way of representing a Boolean expression
The logic gates covered in this course are:
AND
OR
NOT
XOR
NAND
NOR

AND
Expression operator Circuit symbol Explanation

(A AND B) Returns TRUE only if both inputs are TRUE


TRUE AND TRUE = TRUE
Otherwise = FALSE

OR

Page 2 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Expression operator Circuit symbol Explanation


Your notes
(A OR B) Returns TRUE if either input is TRUE
TRUE OR FALSE = TRUE
FALSE OR FALSE = FALSE

NOT
Expression operator Circuit symbol Explanation

(NOT A) Reverses the input value


NOT TRUE = FALSE
NOT FALSE = TRUE

XOR (exclusive OR)


Expression operator Circuit symbol Explanation

(A XOR B) Returns TRUE if either input is TRUE but NOT both


TRUE OR FALSE = TRUE
FALSE OR FALSE = FALSE
TRUE OR TRUE = FALSE

NAND (not and)


Expression Circuit symbol Explanation
operator

Page 3 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

(A NAND B) Returns TRUE if either or both


inputs are FALSE
Your notes
TRUE OR FALSE = TRUE
FALSE OR FALSE = TRUE
TRUE OR TRUE = FALSE

NOR (not OR)


Expression Circuit symbol Explanation
operator

(A NOR B) Returns TRUE if both inputs


are FALSE
TRUE OR FALSE = FALSE
FALSE OR FALSE = TRUE
TRUE OR TRUE = FALSE

Examiner Tips and Tricks

Page 4 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

You will need to either draw a diagram of a logic circuit using these symbols, or you will have to write
the boolean expression from an existing diagram.
Your notes

Page 5 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Logic Circuits
Your notes
Logic Circuits
What is a logic circuit?
A logic circuit performs logical operations on binary information
Logic gates are core components of logic circuits
Based on the arrangement of logic gates and the input signals, the circuit performs a specific function
A logic diagram is a visual representation of a combinations of logic gates within a logic circuit
Brackets are used to clarify the order of operations
An example logic diagram for the Boolean expression Q = NOT(A OR B) would be:

In the logic diagram above, the inputs are represented by A and B


P is the output of the OR gate on the left and becomes the input of the NOT gate
Q is the final output of the logic circuit

Examiner Tips and Tricks


You may be asked to draw a logic circuit from a logic statement or a Boolean expression OR write
the logical expression that is expressed in the logic diagram using Boolean expression operators

Page 6 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Logic circuits will be limited to a maximum of three inputs and one output

Example of combining logic gates Your notes

P = (A OR B) AND NOT C

Worked Example
A sprinkler system switches on if it is not daytime (input A) and the temperature is greater than 40
(input B)
Draw a logic circuit to represent the problem statement above
[2]

Page 7 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Your notes

Page 8 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Truth Tables
Your notes
Truth Tables
What is a truth table?
A truth table is a tool used in logic and computer science to visualise the results of Boolean
expressions
They represent all possible inputs and the associated outputs for a given Boolean expression

AND
Circuit symbol Truth Table

A B A AND B

0 0 0

0 1 0

1 0 0

1 1 1

OR
Circuit symbol Truth Table

Page 9 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A B A OR B
Your notes
0 0 0

0 1 1

1 0 1

1 1 1

NOT
Circuit symbol Truth Table

Page 10 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A NOT
Your notes
0 1

1 0

XOR (exclusive)
Circuit symbol Truth Table

Page 11 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A B A XOR B
Your notes
0 0 0

0 1 1

1 0 1

1 1 0

NAND (not and)


Circuit symbol Truth Table

Page 12 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A B NOT (A AND B)
Your notes
0 0 1

0 1 1

1 0 1

1 1 0

NOR (not or)


Circuit symbol Truth Table

Page 13 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

A B NOT (A OR B)
Your notes
0 0 1

0 1 0

1 0 0

1 1 0

Truth Tables for Logic Circuits


How do you create truth tables for logic circuits?
To create a truth table for the expression P = (A AND B) AND NOT C
Calculate the numbers of rows needed (2number of inputs)
In this example there are 3 inputs (A, B, C) so a total of 8 rows are needed (23)
To not miss any combination of inputs, start with 000 and count up in 3-bit binary (0-7)

A B C

0 0 0

0 0 1

0 1 0

0 1 1

Page 14 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

1 0 0
Your notes
1 0 1

1 1 0

1 1 1

Add a new column to show the results of the brackets first (A AND B)

A B C A AND B

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Add a new column to show the results of NOT C

A B C A AND B NOT C

0 0 0 0 1

0 0 1 0 0

Page 15 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

0 1 0 0 1
Your notes
0 1 1 0 0

1 0 0 0 1

1 0 1 0 0

1 1 0 1 1

1 1 1 1 0

The last column shows the result of the Boolean expression (P) by comparing (A AND B) AND NOT C //
(A . B ) . C

A B C A AND B NOT C P

0 0 0 0 1 0

0 0 1 0 0 0

0 1 0 0 1 0

0 1 1 0 0 0

1 0 0 0 1 0

1 0 1 0 0 0

1 1 0 1 1 1

1 1 1 1 0 0

Examiner Tips and Tricks


Page 16 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

It is possible to create a truth table when combining expressions that show only the inputs and the
final outputs.
Your notes
The inclusion of the extra columns supports the process but can be skipped if you feel able to do
those in your head as you go.

Page 17 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

Logic Expressions
Your notes
Logic Expressions
A logic expression is a way of expressing a logic gate or logic circuit as an equation
The output appears on the left of the equals sign with the inputs and logic gates on the right

Gate Symbol Truth Table Logic


Expression

NOT A Z Z = NOT A

0 1

1 0

Page 18 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

AND A B Z Z = A AND B
Your notes
0 0 0

0 1 0

1 0 0

1 1 1

OR A B Z Z = A OR B

0 0 0

0 1 1

1 0 1

1 1 1

NAND A B Z Z = A NAND B

0 0 1

0 1 1

1 0 1

1 1 0

Page 19 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

NOR A B Z Z = A NOR B
Your notes
0 0 1

0 1 0

1 0 0

1 1 0

XOR A B Z Z = A XOR B

0 0 0

0 1 1

1 0 1

1 1 0

Logic circuits containing multiple gates can also be expressed as logic expressions/statements
An example logic circuit containing two inputs

The logic circuit above can be expressed as the logic expression Q= NOT(A OR B)

Page 20 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

An example logic circuit containing two inputs Your notes

The logic circuit above can be expressed as the logic expression Q= (NOT A) AND B

An example logic circuit containing three inputs

The logic circuit above can be expressed as the logic expression P = ((NOT A) OR B) NAND C

An example logic circuit containing three inputs

Page 21 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources

This logic circuit above can be expressed as X = NOT (A NAND B) OR (B NOR C)

Your notes

Examiner Tips and Tricks


You may be required to write a logic expression/statement from a truth table or a logic circuit.
You may also have to do the opposite - draw a logic circuit and complete a truth table for a
logic expression

Worked Example
Consider the logic statement: X = (((A AND B) OR (C AND NOT B)) XOR NOT C)
a. Draw a logic circuit to represent the given logic statement. [6]
Answer

One mark per correct logic gate, with the correct input

Page 22 of 22
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers

You might also like