As p1 Theory
As p1 Theory
Theory Fundamental
(9618)
Lesson Notes
Including Topical Past Papers
with Marking Scheme
Contents
About the developer of this workbook ....................................................................................................................7
Unit 1 Information Representation ..........................................................................................................................9
Data Representation.............................................................................................................................................9
1.2 Multimedia Graphics ................................................................................................................................... 56
1.2 Sound ........................................................................................................................................................... 95
1.3 Compression .............................................................................................................................................. 124
1.3 Data Storage .............................................................................................................................................. 154
Unit 2 Communication......................................................................................................................................... 156
Unit 3 Hardware .................................................................................................................................................. 221
Unit 4 Processor Fundamentals........................................................................................................................... 272
4.1 Central Processing Unit ............................................................................................................................. 272
4.2 Assembly language .................................................................................................................................... 312
4.3 Bit Manipulation ........................................................................................................................................ 358
Unit 5 System Software ....................................................................................................................................... 384
5.1 Operating System ...................................................................................................................................... 387
5.2 Language translators ................................................................................................................................. 446
Unit 6 Security, Privacy and Data Integrity .......................................................................................................... 473
6.1 Data Security.............................................................................................................................................. 475
6.2 Data Integrity ............................................................................................................................................. 491
Unit 7 Ethics and Ownership ............................................................................................................................... 501
Unit 8 Databases.................................................................................................................................................. 602
Unit 1 Information Representation
Topic You should be able to R A G
• Understand binary integers including, magnitudes, addition and subtraction
and understand how overflow can occur
Data • Convert between binary, denary, hexadecimal and Binary Coded
Representation Decimal(BCD)
• Understand binary representation of character data including
ASCII(American Standard Code for Information Interchange) and Unicode
• Understand bitmapped and vector image encoding and justify their use
• Estimate bitmap image sizes
Multimedia
• Understand representation of sound and the impact of changing the
sampling rate and resolution
• Understand the need for and use methods (lossy and lossless) of
Compression
compression for text, bitmap, vector graphics and sound files
Data Representation
Quick Revision
Binary – base two number system based on the values 0 and 1 only.
Bit – abbreviation for binary digit. A digit in the binary number system written using either of the
symbols 0 and 1
Byte: a group of eight bits treated as a single unit
Nibble: a group of four bits
Decimal prefix: A prefix to define the magnitude of a value. Examples are kilo, mega, giga and tera
representing factors of 103, 106, 109 and 1012 respectively.
Binary prefix: A prefix to define the magnitude of a value. Examples are kibi, mebi, gibi and tebi
representing factors of 210, 220, 230 and 240 respectively.
One’s complement – each binary digit in a number is reversed to allow both negative and positive
numbers to be represented.
Two’s complement – each binary digit is reversed and 1 is added in right-most position to produce
another method of representing positive and negative numbers.
Sign and magnitude – binary number system where left-most bit is used to represent the sign (0 = +
and 1 = –); the remaining bits represent the binary value.
Overflow: a condition when the result of a calculation is too large to fit into the number of bits
defined for storage
Hexadecimal – a number system based on the value 16 (uses the denary digits 0 to 9 and the letters A
to F).
Memory dump – contents of a computer memory output to screen or printer.
Binary-coded decimal (BCD) – number system that uses 4 bits to represent each denary digit.
Packed BCD: when two BCD nibbles are stored in one byte
ASCII (American Standard Code for Information Interchange) code – 7 bit coding system for all the
characters on a keyboard and control codes. It has codes for 128 characters.
Character set – a list of characters that have been defined by computer hardware and software. It is
necessary to have a method of coding, so that the computer can understand human characters.
Extended ASCII code is an 8-bit character set that represents 256 different characters, making it
possible to use characters such as é or ©. Extended ASCII is useful for European languages.
Unicode – 8 to 32 bit coding system which represents all the languages of the world (first 128
characters are the same as ASCII code). Global companies, like Facebook and Google, use the Unicode
character set because their users communicate in many different languages.
Representation of Text and Numbers in Computer
Text and numbers can be represented in computer as patterns of binary digits. To represent each character
(letter, digit or symbol) a character set is used. Character set is a set of characters can be understood by
computer.
1.1 Data Representation
Data is set of raw facts and figures required to solve a problem. Data can be in the form of numbers,
text, images, audio and video.
Number System:
Online lecture on youtube: https://www.youtube.com/watch?v=IxWau-hdg9c
“The system of counting and calculating is called number system.”
Number system is based on some characters called digits.
The word “digit” is derived from Latin word digitus means “finger” or “toe”, and English borrowed
from this to mean number.
In fact, the practice of calling numbers digits comes from the digits on your hands as these digits are
used in counting.
The number of digits is known as base or radix of the number system. For example binary number
system uses two characters 0 and 1 and its base is 2.
Some of the number systems, those are studied in A Level Computer Science are:
i) Denary (Decimal) number system
ii) Binary number system
iii) Hexadecimal number system
iv) BCD
TTh Th H T O
7 6 8 5 4
Position 4 3 2 1 0
104=10000 103=1000 102=100 101=10 100=1
10,000s 1,000s 100s 10s 1s
Weight(Decimal Ten Thousands Thousands Hundreds Tens Units
Notation)
Binary Number System:
In computer data is stored in the form of electric charge ON and OFF,
represented by 1s and 0s. These “1’s” and “0’s” are called bit (being a
contraction of BInary digiT), and 8 bits make a byte to represent a single
character.
Its value is usually held in memory as an electrical charge stored in a capacitor. Modern
memory chips contain millions of these tiny capacitors, each of which is capable of storing
exactly one bit of information. A single bit can have one of two values
at any given time - one or zero. As we shall see, in order to represent
a number greater than one, we will have to use several bits.
“The number system which is based on 2 characters 0 and 1 is called
binary system.”
Using only 0 and 1 makes it easier to design the electronic circuits
that the computers will use. This is because, if the computer wants to
check a value in any part of the circuit, it only needs to detect whether
or not there is any electricity. If there is electricity, the value is 1, if
there is no electricity, the value is 0.
Binary numbers are fundamental to the way that all modern computers work. They are used
to represent any data stored within a computer system.
1 1 1 1 1 1 1 1
Bit bit bit bit bit bit bit bit
Nibble Nibble
Byte
INTEGERS:
Integers are whole numbers. The range of values that can be stored as an integer depends
on whether or not the number is signed (i.e. positive or negative), and how much memory is
allocated for it in memory. Programming languages can generally represent integers that are
signed or unsigned, and of different sizes.
A single byte can represent unsigned numbers ranging in value from 0 to 255, or signed
integers ranging from -128 to +127. If two bytes are used, unsigned numbers
from 0 to 65,535 or signed numbers from -32,768 to 32,767 can be stored. Much larger
numbers can be represented if more bytes are made available.
For signed numbers, one bit is used to store the sign (+ or -) of the number, so the absolute
value of the biggest number that can be stored is only half that for unsigned numbers. The
number of bits used to represent an integer value will equal the number of bytes multiplied by
eight. An integer represented by n bits can represent 2n numbers.
The magnitude of a four-byte integer can thus be anything up to 2 (4×8) or 2 32 which means it
can hold an unsigned value of up to 4,294,967,296 (a tad over two billion). Negative numbers
can be represented in several different ways in binary number systems, although the most
commonly used method is two's complement (the subject of two's complement is dealt with
below).
Courtesy : http://www.technologyuk.net/mathematics/about-numbers/representing-numbers-
in-computers.shtml
Put the 1 under notations which are required to find sum equals to the number and 0 in
remaining places as 64+32+16+8=120
= 128 64 32 16 8 4 2 1
= 0 1 1 1 1 0 0 0
Division Remainder
Quotient
by 2 (decimal)
25 25/2 12 1
2 12 1 12/2 6 0
2 6 0 6/2 3 0
2 3 0 3/2 1 1
1 1
Conversion of Negative Integers into Binary:
There are two different methods to represent negative integers into binary
1) Sign-Magnitude Method
2) One’ Complement
3) Twos Complement Method
1) Sign-Magnitude Method:
In this method the left most bit (most-significant bit) is used for sign and remaining bits for
magnitude. 0 represents positive while 1 represents negative integers.
Here is the representation of +120 and -120 in sign magnitude method:
2) One’s Complement
The one’s complement of a negative binary number is the complement of its
positive counterpart, so to take the one’s complement of a binary number, all we
need to do is flip all bits. Thus the one’s complement of “1” is “0” and vice versa,
then the one’s complement of 100101002 is simply 011010112 as all the 1’s are
changed to 0’s and the 0’s to 1’s. For this NOT gate is applied on each bit.
3) Two’s Complement Method
The procedure to convert negative decimal numbers to binary is give below:
#1. Remove the negative sign (but don't forget about it)
#2. Convert the positive decimal number to binary
#3. Flip all bits (All 0s in 1s and all 1s in 0s) to obtain One’s complement.
#4. Add 1, two’s complement is obtained, it is the binary equivalent of negative integer
For example to convert -120 into binary
First binary equivalent of +120 is calculated
+120 = 0111 1000
Flip all bits to obtain One’s complement
1000 0111
Then 1 is added in the flipped binary number two’s complement is obtained
1000 0111
+1
-------------
-120 1000 1000
Binary-to-Denary Conversion:
1) Conversion of positive binary into denary:
Binary notation is used to convert binary number into denary numbers.
For example 0111 10002 can be converted as:
0111 10002
= 0 x 27 +1 x 26 +1 x 25 + 1 x 24 + 1 x 23 + 0 x 22 + 0 x 21 + 0 x 20
= 0 x 128 + 1 x 64 + 1 x 32 + 1 x 16 + 1 x 8 + 0 x 4 + 0 x 2 + 0 x 1
= 0+64+32 + 16 + 8 + 0 + 0 + 0
= 12010
2) Sign-Magnitude Method:
The sign bit (the left-most bit) is removed and then remaining bits (the magnitude bits) are
converted in denary and – sign is added.
For example 1111 10002 can be converted as:
(-) 111 10002
= (-) 1 x 26 +1 x 25 + 1 x 24 + 1 x 23 + 0 x 22 + 0 x 21 + 0 x 20
= (-) 1 x 64 + 1 x 32 + 1 x 16 + 1 x 8 + 0 x 4 + 0 x 2 + 0 x 1
= (-) 64+32 + 16 + 8 + 0 + 0 + 0
= -12010
3) Two’s complement method:
Firstly all bits are flipped to obtain one’s complement.
Then 1 is added to obtain two’s complement
And this two’s complement number is converted into denary number
For example
1000 1000 Original Value (sign bit separated for clarification)
0111 0111 One's Complement (Toggle all bits)
+1 Add 1 in One’s Complement
0111 1000 Result- Two’s Complement
0111 10002 = 12010 Convert the Two’s Complement into Denary
0 111 10002 = - 12010 so, because the original number was a negative number, we have
to remember that as a part of the result.
One of the benefits of using two's complement is that addition and subtraction can both be
carried out using binary addition. As continuous addition can perform as multiplication
(e.g 2 * 5= 2+2+2+2+2) and continuous subtraction produces results of division). Means all
arithmetic operations can be performed just addition using two’s complement method.
Note: A simple way to perform the 2's complement operation is to scan the bits from right to
left, keeping all of the digits up to and including the first logical 1. Then, change each bit.
1 0111101 Original Value
1 Keep the first 1 that is found
0 100001 Toggle the remaining bits
0 1000011 Result.
Binary Arithmetic
Courtesy : http://www.technologyuk.net/mathematics/about-numbers/representing-numbers-
in-computers.shtml
A computer uses a fixed number of bits to store each of the common data types. For
example, a byte (8 bits) is commonly used to represent alphanumeric characters, unsigned
integer values from 0 to 255, or signed integer values from -128 to +127.
For signed integer data types, the range of values that can be represented is only half that for
unsigned integer data types because the most significant bit is used to signify whether the
number is positive (0) or negative (1), leaving one less bit available to represent the absolute
value of the number.
The range of signed 4-bit integers that can be represented using this system (known as sign
and magnitude) is shown in the table below, and illustrates how the system works. Note that
there are two possible representations for zero (00002 = +010 and 10002 = -010 ).
+0 0000 -0 1000
+1 0001 -1 1001
+2 0010 -2 1010
+3 0011 -3 1011
+4 0100 -4 1100
+5 0101 -5 1101
+6 0110 -6 1110
+7 0111 =7 1111
Binary Addition:
Binary addition is performed using sum and carry method just as we use in daily life for addition in
denary numbers.
Binary Subtraction
There are two different methods for binary subtraction.
1) Simple Borrowing method
Binary subtraction is one of the four binary operations, where we perform the subtraction
method for two binary numbers (comprising of only two digits, 0 and 1). This operation is
similar to the basic arithmetic subtraction performed on decimal numbers in Maths. Hence,
when we subtract 1 from 0, we need to borrow 1 from the next higher order digit, to reduce
the digit by 1 and the remainder left here is also 1.
(i) 0 – 0 = 0 (0 subtracted from 0 results 0)
(ii) 1 – 0 = 1 (0 subtracted from 1 results 1)
(iii) 1 – 1 = 0 (1 subtracted from 1 results 0)
(iv) 0 – 1 = 1 (1 cannot be subtracted from 0 so 1 is borrowed, 0 becomes 10 means 2, 2-1
results 1)
2) Two’s complement method
One of the benefits of using two's complement is that addition and subtraction can both be
carried out using binary addition. As continuous addition can perform as multiplication (e.g 2
* 5= 2+2+2+2+2) and continuous subtraction produces results of division). Means all
arithmetic operations can be performed just addition using two’s complement method.
In this method firstly two’s complement of negative integer is found out and then this is added
in positive integer. For example:
Overflow – the result of carrying out a calculation which produces a value too large for the
computer’s allocated data size.
• An overflow error will occur if the value is greater than 255 in an unsigned 8-bit register
• An overflow error will occur if the value is greater than +127 in a signed 8-bit register
For example in 8 bit +127 is the largest value which can be represented, and the sum of two
numbers is larger than +127, will produce a negative number which causes an overflow.
e.g. on adding +120 and +50 result should be + 170
Since the digital system is to work with 8-bits, only the first eight digits are used to provide the
answer to the sum, and we simply ignore the last bit (bit 9). This bit is call an “overflow” bit.
Overflow occurs when the sum of the most significant (left-most) column produces a carry
forward. This overflow or carry bit can be ignored completely or passed to the next digital
section for use in its calculations. Overflow indicates that the answer is positive. If there is no
overflow then the answer is negative.
Underflow
The result of carrying out a calculation which produces a value too small for the computer’s allocated
data size.
• An overflow error will occur if the value is smaller than -128 in a 8-bit register
Hexadecimal Numbers
A number system that has 16 digits is known as hexadecimal number system.
The digits of hexadecimal system are 0, 1, 2,3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, & F, whereas A represents 10, B represents 11 and so on
until F that represents 15.
Hexadecimal has 16 digits so it is also known as base 16 number
system.
Hexadecimal numbers are less prone to error, It is easier to convert
long binary numbers in hexadecimal than in denary. Hexadecimal
numbers are easier to read and understand than binary number
numbers.
Uses of Hexadecimal System:
Uses of Hexadecimal in HTML:
Hyper Text Mark-up Language is used to develop Websites. In HTML a
colour is specified according to the intensity of its Red, Green and Blue
(RGB) components, each represented by eight bits. Thus, there are 24
bits used to specify a web colour, and 16,777,216 colours that may be so
specified. It's easier for the human programmer to represent a 24-bit
integer, often used for 32-bit colour values, as #FF0099 instead of
111111110000000010011001
w w w . r u k n u d d i n . c o m
%77 %77 %77 %2E %72 %75 %6B %6E %75 %64 %64 %69 %6E %2E %63 %6F %6D
Some characters are not allowed in URL. URL encoding converts characters into a format that can be
transmitted over the Internet.
For example
➢ %20 – is used in URL in place of <space> not allowed in a URL, %20 is the coding for a space (32
in denary)
➢ ? – separates the URL from all parameters or variables
e.g. for query to search Inqilabpatel in Google
https://www.google.com.pk/search?q=inqilab%20patel
here“q” is variable for query “?” separates it from URL
“https://www.google.com.pk/search”
BCD Representation
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
The BCD encoding for the number 476 would therefore be:
Computers usually store data in blocks of 8 bits (called bytes). Two main methods of storing
BCD digits are used. In the first method (called zoned BCD), each 4-bit BCD representation of
a decimal digit is stored in the right-most four bits of a byte. The left-most four bits are all set
to zero, or all set to one in systems such as mainframe computers that use Extended Binary
Coded Decimal Interchange Code (EBCDIC), or to 0011 (in systems that use the American
Standard Code for Information Interchange (ASCII).
Applications of BCD:
BCD is used to represent string on numbers for
example:
ISBN-13 Bar Code is a 13 digit International Standard
Book Number. It is not an integer but a string of
integers. It is represented in BCD
BCD Usage in Alpha-Numeric Display and RTC
BCD was commonly used for displaying alpha-numeric in the
past but in modern-day BCD is still used with real-time clocks
or RTC chips to keep track of wall-clock time and it’s
becoming more common for embedded microprocessors to
include an RTC.
It’s very common for RTCs to store the time in BCD format.
1
2
4
8
Character Set:
Text and numbers can be encoded in a computer as patterns of binary digits. Hexadecimal is a
shortcut for representing binary. ASCII and Unicode are important character sets that are used as
standard.
ASCII (American Standard Code for Information Interchange)
The ASCII character set is a 7-bit set of codes that allows 128 different characters. That is enough for
every upper-case letter, lower-case letter, digit and punctuation mark on most keyboards. ASCII is
only used for the English language.
This table shows some examples of letters represented using the ASCII character set:
The IEC convention for computer internal memories (including RAM) becomes:
Example Question: A company advertises its backup memory device as having 500 GB of storage. A
customer wishes to know how many 8 MB files could be stored on the device. The company claimed
that up to 62 500 files (assuming each file is 8 MB) could be stored. The customer calculated that 64
000 files could be stored.
Explain the difference between these two storage values. Show any calculations you use in your
explanation.
...................................................................................................................................................................
.......................................................................................................
–company calculation is based on 1 GByte = 1000 Mbyte – so (500 × 1000)/8 = 62 500 files
– customer calculation based on 1 GByte = 1024 Mbyte – so (500 × 1024)/8 = 64000 files
– giving the difference of 1500 files [3]
Specimen Paper 9618/01 - SoW
1 (a) State one difference between a kibibyte and a kilobyte.
...................................................................................................................................................
.............................................................................................................................................. [1]
(b) Give the number of bytes in a mebibyte.
.............................................................................................................................................. [1]
(c) (i) Complete the following binary addition. Show your working. [2]
1 0 0 1 1 0 1 0
+ 1 1 1 1 0 1 1 1
(ii) Describe the error that occurred when you added the binary numbers in part (c)(i).
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
(d) Complete the binary subtraction. Show your working.
01100111
–00110010 [2]
-------------------------------
1b 9618 S21 P12
6 A computer uses the ASCII character set.
(a) State the number of characters that can be represented by the ASCII character set and
the extended ASCII character set.
ASCII ...........................................................
Extended ASCII ........................................................... [2]
(b) Explain how a word such as ‘HOUSE’ is represented by the ASCII character set.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................................................................................... [2]
(c) Unicode is a different character set.
The Unicode value for the character ‘1’ is denary value 49.
(i) Write the hexadecimal value for the Unicode character ‘1’.
..................................................................................................................................... [1]
(ii) Write the denary value for the Unicode character ‘5’.
..................................................................................................................................... [1]
1ac 9618 S21 P12_13 - 1 Anya scans an image into her computer for a school project.
(c) One of the colours used in the image has the hexadecimal colour code:
#FC238A
FC is the amount of red, 23 is the amount of green and 8A is the amount of blue in the colour.
(i) Convert the hexadecimal code FC into denary.
..................................................................................................................................... [1]
(ii) The amount of green in binary is 00100011. This has the denary number 15 added to it to
create a second colour.
Add the denary number 15 to the binary number 00100011 and give your answer in binary.
Perform the addition in binary. Show your working.
Working .............................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................
Answer (in binary) ........................................ [3]
(iii) Hexadecimal 23 in two’s complement representation is 00100011. The denary number 10
needs to be subtracted from this value. Subtract the denary number 10 from the two’s
complement representation 00100011. Give your answer in binary. Show your working.
Working .............................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................................................................................................
Answer (in binary) ........................................ [3]
2b 9618 W21 P12 - 4 A register stores the following binary number
1 1 0 0 1 1 0 1
(a) The binary value in the register represents an unsigned binary integer.
Convert the unsigned binary integer into denary.
............................................................................................................................................. [1]
(b) The binary value in the register represents a two’s complement binary integer.
Convert the two’s complement binary integer into denary.
............................................................................................................................................. [1]
(c) The binary value in the register represents a hexadecimal number.
Convert the binary number into hexadecimal.
............................................................................................................................................. [1]
(d) State why the value in the register cannot be interpreted as a Binary Coded Decimal
(BCD).
.....................................................................................................................................................
.......................................................................................................................................... [1]
(e) The binary contents of two registers are:
Register 1 0 0 1 1 1 1 0 1
Register 2 0 0 1 0 1 1 0 1
(i) Add the contents of Register 1 and Register 2. Show your working.
Answer .............................................................................................................................. [2]
(ii) Subtract the contents of Register 2 from the contents of Register 1. Show your working.
8 bits 1 gigabyte
1 mebibyte
(b) (i) Perform the following binary addition. Show your working.
10101010
+ 00110111 [2]
(ii) State how an overflow can occur when adding two binary integers.
.....................................................................................................................................................
......................................................................................................................... [1]
(c) Convert the hexadecimal value F0 into denary.
.....................................................................................................................................................
......................................................................................................................................... [1]
3a 9618 S22 P11 -
1 Computers store data in binary form.
(a) State the difference between a tebibyte and a terabyte.
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Convert the signed denary value –100 into an 8-bit two’s complement binary integer.
Working .....................................................................................................................................
...................................................................................................................................................
Answer ............................................................................ [1]
(c) Convert the denary number 251 into hexadecimal. Show your working.
Working .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...............................................................................................................................................
Answer ............................................................................ [2]
(d) Add the following unsigned binary integers.
01010000
+00111110 [1]
------------------------
3b 9618 S22 P12
3 (e) Convert the denary numbers 127 and 12 to 8-bit binary and then perform the subtraction
12 - 127 in binary.
Show your working.
127 in binary .............................................................................................................................
12 in binary ...............................................................................................................................
12 - 127 in binary .....................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................... [3]
Working space
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................
5a 9608 S17 P11 – SoW
Q 4(d) (d) Computer scientists often write binary representations in hexadecimal.
(i) Write the hexadecimal representation for this instruction:
0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0
.......................................................................................................................................[2]
(ii) A second instruction has been written in hexadecimal as:
05 3F
Write the equivalent assembly language instruction, with the operand in denary.
.......................................................................................................................................[2]
- 93
Q 2 Summer 15 P13 - 1 (a) (i) Using two’s complement, show how the following denary
numbers could be stored in an8-bit registers: [2]
124
- 77
(ii) Convert the two numbers in part (a) (i) into hexadecimal.
124 ............................................................................................................................................
–77 ........................................................................................................................................[2]
(b) Binary Coded Decimal (BCD) is another way of representing numbers.
(i) Write the number 359 in BCD form.
............................................................................................................................................... [1]
(ii) Describe a use of BCD number representation.
.....................................................................................................................................................
............................................................................................................................................... [2]
Q 3 Winter 15 P12 - 3 A touch screen has three squares where a selection can be made:
(a) The x-coordinate of the centre of the three squares is held in three memory locations:
Address Memory contents
S 40 0000 1011 0100
T 41 0010 0101 0100
U 42 0100 0110 1100
(i) Give the hexadecimal value of the memory contents for U.
.....................................................................................................................................................
.............................................................................................................................................. [1]
(ii) Convert the denary number 40 into binary.
.....................................................................................................................................................
................................................................................................................................................ [1]
(b) Bitmap graphics are used to represent squares S, T and U.
These can be saved in a number of different image resolutions.
(i) Give the number of bits required to store each pixel for a black and white bitmap.
.......................................................................................................................................[1]
(ii) Identify how many bits are required to store each pixel for a 256-colour bitmap.
Explain your answer.
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................... [2]
Q 4 Summer 16 P11, 122 (a) Convert the following denary integer into 8-bit binary.
55 [1]
(b) Convert the following Binary Coded Decimal (BCD) number into denary.
10000011
...............................................................................................................................................[1]
(c) Convert the following denary integer into 8-bit two’s complement.
-102 [2]
(iv) State in denary, the range of integer values that it is possible to represent in two’s
complement integers using a single byte.
Lowest value ..................................................
Highest value .................................................. [1]
(b) (i) Convert the following denary integer into Binary Coded Decimal (BCD).
653
.......................................................................................................................................[1]
(ii) A 3-digit BCD representation has been incorrectly copied. It is shown as:
0 1 0 0 1 1 1 0 0 0 1 0
State how you can recognise that this is not a valid BCD representation.
...........................................................................................................................................
.......................................................................................................................................[1]
(iii) Describe a practical application where BCD is used.
...........................................................................................................................................
.......................................................................................................................................[1]
Q 6) Winter 2016 P12 -
4 Hexadecimal, Binary Coded Decimal (BCD) and binary values are shown
below. Draw a line to link each value to its correct denary value. [4]
Hexadecimal, BCD, binary Denary
93
Hexadecimal:
3A –65
BCD representation: 58
0100 1001
–63
Binary integer:
01011101 73
-93
Q 10) Winter 2018 P11 - 4 (c) The current contents of a general purpose register (X) are:
X: 1 0 1 1 1 0 1 0
(i) The contents of X represent an unsigned binary integer.
Convert the value in X into denary.
.......................................................................................................................................[1]
(ii) The contents of X represent an unsigned binary integer.
Convert the value in X into hexadecimal.
.......................................................................................................................................[1]
(iii) The contents of X represent a two’s complement binary integer.
Convert the value in X into denary.
.......................................................................................................................................[1]
Q 11) Winter 2018 P11 - 3 (c) The current contents of a general purpose register (X) are:
X 1 1 0 0 0 0 0 1
(i) The contents of X represent an unsigned binary integer. Convert the value in X into denary.
...................................................................................................................................... [1]
(ii) The contents of X represent an unsigned binary integer. Convert the value in X into
hexadecimal.
...................................................................................................................................... [1]
(iii) The contents of X represent a two’s complement binary integer.
Convert the value in X into denary.
...................................................................................................................................... [1]
Q 12) Summer 2019 P12 - 3 (d) The ASCII character code for ‘A’ is 65 in denary.
(i) Convert the denary ASCII character code for ‘A’ into 8-bit binary. [1]
(ii) Convert the denary ASCII character code for ‘A’ into hexadecimal.
........................................................................................................................................... [1]
(iii) The Unicode character code for ‘G’ is 0047 in hexadecimal.
State, in hexadecimal, the Unicode character code for ‘D’.
............................................................................................................................................... [1]
Q 13) Winter 2019 P11
5 (a) The bit depth of an image dictates how many different colours can be represented by each pixel.
(i) State the number of different colours that can be represented by a bit depth of 8 bits.
..................................................................................................................................... [1]
(ii) One binary colour is represented by 0100 1110, Convert the unsigned binary number 0100 1110
into denary.
..................................................................................................................................... [1]
(b) Convert the denary number -194 into 12-bit two’s complement.
............................................................................................................................................. [1]
(c) (i) Convert the Binary Coded Decimal (BCD) value 0110 1001 into denary.
..................................................................................................................................... [1]
(ii) Identify one practical application where BCD is used.
...........................................................................................................................................
..................................................................................................................................... [1]
(d) One example of a character set used by computers is ASCII.
Describe how one character is represented in a character set.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................................. [2]
Q 14) Winter 2019 P13 - 4 (a) Convert the unsigned binary number 0101 1111 1100 into denary.
............................................................................................................................................. [1]
(b) Convert the denary number -239 into 12-bit two’s complement.
............................................................................................................................................. [1]
(c) Convert the two’s complement number 0110 0101 into denary.
............................................................................................................................................. [1]
(d) Convert the Binary Coded Decimal (BCD) value 0110 0101 into denary.
............................................................................................................................................. [1]
(e) Convert the denary number 222 into hexadecimal.
............................................................................................................................................. [1]
Q 15) Summer 20 P1 -1(c) The digital camera allows a user to add text to an image. The text
is encoded as ASCII values. The table shows the ASCII denary values for five characters.
Character ASCII denary value
a 97
b 98
c 99
d 100
e 101
(i) Give the 8-bit binary value for the ASCII character ‘b’.
.....................................................................................................................................................
............................................................................................................................................... [1]
(ii) Complete the table by writing the ASCII denary value for the character ‘t’ and its
hexadecimal equivalent. [2]
Character t
ASCII denary value
Hexadecimal value
Q 16) Summer 2020 P12 - 5 (a) The steps 1 to 6 describe the first pass of a two-pass assembler.
The following three statements are used to complete the sequence of steps.
A If it is already in the symbol table, it checks to see if the absolute address is known
When it meets a symbolic address, it checks to see if it is already in the symbol
B
table
C If it is known, it is entered
Write one of the letters A, B or C in the appropriate step to complete the sequence.
1. The assembler reads the assembly language instructions
The assembler translates assembly code into machine code.
The table shows the denary values for three assembler op codes.
Op code Denary value
LDD 194
ADD 200
STO 205
(i) Convert the denary value for the op code LDD into 8-bit binary. [1]
(ii) Convert the denary value for the op code STO into hexadecimal.
..................................................................................................................................... [1]
(iii) State why the denary value for the op code ADD cannot be represented in 8-bit two’s complement
form. Justify your answer.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
.....................................................................................................................................................
............................................................................................................................................... [1]
Q 19) Winter 20 P12 - 1 Different types of data can be represented in a computer system.
(a) Numeric is one type of data.
(i) Convert the following denary number into Binary Coded Decimal (BCD).
105
..................................................................................................................................... [1]
(ii) Convert the following two’s complement binary integer into denary.
10111111
..................................................................................................................................... [1]
(iii) Convert the following hexadecimal number into denary.
AB
..................................................................................................................................... [1]
(b) Character is another type of data.
The following tables show part of the ASCII code character set.
Denary Denary
Character Character
value value
A 65 a 97
B 66 b 98
C 67 c 99
D 68 d 100
E 69 e 101
(i) Describe how the computer uses ASCII codes to represent characters.
.....................................................................................................................................................
.....................................................................................................................................................
...................................................................................................................................................
(ii) Convert the following string into ASCII codes.
Bed
.....................................................................................................................................................
............................................................................................................................................. [1]
(iii) Give the denary ASCII code for the following character.
H
…..................................................................................................................................... [1]
Q 20) Winter 20 P12 - 5 (d) The current contents of a general-purpose register X are:
X 1 1 0 0 1 0 1 0
(i) The contents of X represent an unsigned binary integer.
Convert the contents of X into denary.
............................................................................................................................... [1]
(ii) The contents of X represent a two’s complement binary integer.
Convert the contents of X into denary.
................................................................................................................................ [1]
(iii) State why the binary number in X cannot represent a Binary Coded Decimal (BCD).
.....................................................................................................................................................
.......................................................................................................................................... [1]
1.2 Multimedia Graphics
1.2 Multimedia Notes and guidance
Graphics
Candidates should be able to:
Show understanding of how data for a Use and understand the terms: pixel, file
bitmapped image are encoded header, image resolution, screen resolution,
colour depth, bit depth
Perform calculations to estimate the file size
for a bitmap image
Show understanding of the effects of Use the terms: image resolution, colour
changing elements of a bitmap image on the depth
image quality and file size
Show understanding of how data for a Use the terms: drawing object, property,
vector graphic are encoded drawing list
Justify the use of a bitmap image or a vector
graphic for a given task
Bitmap Images
Bit-map image – The images that are made up of small picture elements (pixels) are called bitmap
image.
Pixel – the smallest picture element that makes up an image, that has only one colour. It is the
smallest identifiable component of image.
Bit depth – number of bits used to represent the smallest unit in, for example, a sound or image file –
the larger the bit depth, the more the available colours in image and better the quality of the sound.
Colour depth – number of colours available in a pixel, e.g. 8 bit depth has colour depth of 256 (28 =
256).
Image resolution – number of pixels that make up an image, for example, an image could contain
4096 × 3192 pixels (12 738 656 pixels in total).
Screen resolution – number of horizontal and vertical pixels that make up a screen display. If the
screen resolution is smaller than the image resolution, the whole image cannot be shown on the
screen, or the original image will become lower quality.
Resolution – number of pixels per column and per row on a monitor or television screen.
Pixel density – number of pixels per square centimeter or per square inch.
Vector graphics – images that use 2D points to describe lines and curves and their properties that
are grouped to form geometric shapes.
Vector graphics are computer graphics, defined using mathematics and geometry such as
points, lines, curves, and shapes or polygon(s). Allowing for scalability. Objects and
properties stored mathematically.
Drawing list is a set of commands, the list of shapes involved in list an image, it a list that
stores the command and description required to draw each object.
Vector graphics are made up of drawing lists (set of command used to define objects and
their properties).
An object is a mathematical or geometrically defined construct such as a rectangle, line or
circle.
Property is data about the shapes, it defines one aspect of the appearance of the drawing
object.
Each of the objects has properties to tell the size, colour, position etc.
Bitmap Image
These images can be divided up into a grid of smaller elements, as shown below:
Each element in the grid of picture is called a pixel. The more pixels used, the finer the details
that can be represented.
As we mentioned earlier, computers can only handle and store 1s and 0s. Therefore let a
single colour within each pixel be represented by binary 1 (say for white) and let a different
colour (black perhaps) be represented by binary 0.
Image display
When a monitor or a printer displays a vector image it is rasterised - converted into a grid of pixels.
Regardless of the file type, an image will always be outputted onto a screen or printed in pixels.
Colour Depth is the number of colours a bit can store is colour depth while Bit Depth is the
number of bits per pixel. Colour depth is determined by bit depth (the number of bits per
pixel).
In the black and white image, only two colours are needed. This means it has a colour depth of 1 bit.
In black and white image below shows each 1 bit pixel containing either binary 1 or binary 0.
A 2-bit colour depth would allow four different values: 00, 01, 10, 11. This would allow for a range of
colours such as:
Colour
Binary code Colour
Number
0 00 Black
1 01 Dark grey
2 10 Light grey
3 11 White
11 11 11 00 00 00 00 11 11 11
11 11 11 10 00 00 10 11 11 11
11 11 11 10 00 00 10 11 11 11
10 10 10 10 10 10 10 10 10 10
01 01 01 01 01 01 01 01 01 01
11 01 11 11 11 11 11 11 01 11
00 01 01 11 11 11 11 00 01 01
00 11 01 11 11 11 11 00 11 01
00 11 01 11 11 11 11 00 11 01
00 11 01 11 11 11 11 00 11 01
Image Resolution refers to the number of pixels that make up an image; for example, an
image could contain 4096 × 3192 pixels (12 738 656 pixels in total) i.e. 12 Mega Pixel (MP)
image.
Pixel density, usually measured in dots per inch (dpi). Images on websites usually have a pixel
density of 72 dpi. This means that a 1-inch square contains a grid of pixels that is 72 pixels
wide by 72 pixels high. 72 x 72 = 5184 pixels per square inch.
Pixel density determines the image quality, more the pixel density, better the image quality.
Effects of changing elements of a bitmap image on the image quality and file size
The image quality is determined by image resolution and pixel density. When magnifying an image,
the number of pixels that makes up the image remains the same but the area they cover is now
increased. This means some of the sharpness could be lost. For example, look at following image:
Image A is the original. By the time it has been scaled up to make image F it has become pixelated
(‘fuzzy’). This is because images A and F have different pixel densities.
The main drawback of using high resolution images is the increase in file size. As the number of pixels
used to represent the image is increased, the size of the file will also increase. This impacts on how
many images can be stored on, for example, a hard drive. It also impacts on the time to download an
image from the internet or the time to transfer images from device to device.
Screen resolution refers to the number of horizontal pixels and the number of vertical pixels
that make up a screen display (for example, if the screen resolution is smaller than the image
resolution then the whole image cannot be shown on the screen or the original image will
now.
JPG or JPEG (Joint Photographic Experts Group)
PEG is the file compression format designed to make photo files smaller in size for storage and for
transmission. It uses lossy compression and compresses a file between factors of
5 to 15.
Image File Size Calculation
To calculate image file size, firstly number of pixels found out then these are
multiplied to find total number of pixels in an image that gives, image
resolution.
For example 2000 pixels wide and 2000 pixels high image will have 2000 ×
2000= 4,000,000 pixels. This is often referred to as a 4-megapixel image.
Then Image resolution is multiplied by bit depth.
Black & White image Grey Scale 8-Colour True Colour
Bit Depth=1 Bit Depth=2 Bit Depth= 3 Bit Depth=24
Image Size Image Size Image Size Image Size
= 4,000,000 x 1 bit = 4,000,000 x 2 bit = 4,000,000 x 3 bit = 4,000,000 x 24 bit
= 4,000,000 bit = 8,000,000 bit = 12,000,000 bit = 4,000,000 x 3 Byte
= 4,000,000 / 8 Byte = 8,000,000 / 8 Byte = 12,000,000 / 8 Byte = 12,000,000 Byte
= 500,000 Bytes = 1,000,000 Bytes = 1,500,000 Bytes = 12 MB
= 500 KB = 1 MB = 1.5 MB
Image Size = 500 KB Image Size = 1 MB Image Size = 1.5 MB Image Size = 12MB
Metadata
File header is also included in a bit-map image file. It usually also contains metadata.
Metadata means 'data about data' and provides information about the image. The information
includes:
• filename
<svg xmlns="http://www.w3.org/2000/svg">
<svg xmlns="http://www.w3.org/2000/svg">
<rect width="120" height="80” x="40" y="150"
stroke="blue" stroke-width="5" fill="green" />
<rect width="20" height="80" x="50" y="230"
fill="black" />
<rect width="20" height="80" x="130" y="230"
fill="black" />
<rect width="15" height="50" x="22" y="150"
fill="brown" />
<rect width="15" height="50" x="162" y="150" fill="brown" />
<line x1="20" y1="50"
x2="200" y2="50"
stroke="red" stroke-width="3"/>
<circle cx="100" cy="100" r="50"
fill="red" stroke="black" stroke-width="5" />
<text x="20" y="40"> CompSci with Inqilab Patel </text>
</svg></svg>
Comparison between vector graphics and bit-map images
Vector graphic images Bit-map images
made up of geometric shapes which require made up of tiny pixels of different colours
definition/attributes
they do not require large file size since it is because of the use of pixels (which give
made up of simple geometric shapes very accurate designs), the file size is very
large
file formats are usually .svg, .cgm, .odg file formats are usually .jpeg, .bmp, .png
1ac 9618 S21 P12_13 - 1 Anya scans an image into her computer for a school project.
(a) The scanned image is a bitmapped image.
(i) Complete the following table to describe the two terms about graphics.
Term Description
Pixel
………...........................................................................................................................
......................................................................................................................................
......................................................................................................................................
File
header ………...........................................................................................................................
......................................................................................................................................
......................................................................................................................................
(ii) The image is scanned with an image resolution of 1024 × 512 pixels, and a colour depth of
8 bits per pixel. Calculate an estimate for the file size, giving your answer in mebibytes. Show
your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer .......................................... mebibytes [3]
(a) (i) The stem of Question 1(a) indicates that the question is about a bitmapped image, therefore,
the descriptions of the terms in this part question should refer to a bitmapped image. Simply stating
that a pixel is a picture element is not enough at this level of study. There needs to be a description of
what is meant by a picture element. While the inclusion of examples of the contents of a file header is
commendable, candidates must be aware that when asked for a description a list is not enough and
some further explanation is needed which should refer to the context given, in this case, a bitmap.
(ii) There were many good answers to this part question. The method for calculating the file size of an
image was usually correct. Some candidates multiplied the number of pixels by 8 to calculate the
number of bits required to store the image, but then did not divide by 8 to convert the bits to bytes.
Example Candidate Response – high Examiner comments
2
2 The candidate gives a correct
description, together with an
appropriate example.
Mark for (a)(i) = 1 out of 2
6
7 6 The two’s complement of -10
(negative 10) is seen.
7 The candidate adds the correct
value and the carry bits are clearly
visible.
Mark for (c)(iii) = 3 out of 3
Example Candidate Response – high, continued Examiner comments
13
1
1 The candidate gives a description of
a pixel.
Mark for (a)(i) = 1 out of 2
5
6 The candidate’s conversion of
denary 10 to binary is correct.
7 The candidate adds the value
instead of subtracting it.
7
Example Candidate Response – low, continued Examiner comments
(a) Complete the table by writing a description of each vector graphic term and give an
example for this logo. [4]
Term Description Example from logo
Property
Drawing
list
(b) Riya takes a photograph using a digital camera. The photograph is stored as a bitmap
image.
(i) Describe two differences between a vector graphic and a bitmap image.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [4]
Examiner Report
(a) Many candidates need to improve their understanding of the terms associated with vector graphics. There
was considerable confusion between a drawing list and a drawing object. Some candidates attempted to
describe a property without using a different word or without associating the property with a drawing object. A
suitable answer would be, ‘a property is an aspect of the appearance of a drawing object’. Examples given
were often generic rather than from the logo shown in the question.
(b) (i) The command word in this question is ‘describe’. This means that, at this level, it is not enough to
write, for example, ‘bitmap images pixelate when enlarged, vector graphic images do not’. A description
is expected to include the reasons why a bitmap image pixelates and why a vector graphic does not. The
question also asks for two differences.
(ii) Questions need to be read carefully. This question asks for two lossy methods of compression that can be
used on a photograph. Incorrect answers frequently described lossy compression and the effects of the
compression on the image, not methods of lossy compression. Statements such as, ‘use JPEG’ or ‘remove
colours the eye cannot see’ are not enough at this level when the question asks for a description. The
answer needs to include how using a JPEG or removing the colours would compress the photograph.
Y Y P Y Y Y P Y Y Y
R R M R P K T T R R
B O P Y Y Y P G P P
R O R P P P R R R R
The complete image can have up to 256 colours.
(i) Identify the smallest number of bits that can be used to represent each colour in the complete
bitmap image.
..................................................................................................................................... [1]
(ii) Calculate an estimate for the file size of the section of the bitmap image shown, giving your answer
in bytes. Use your answer from part (b)(i). Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ................................... bytes [2]
(c) Describe how changing the colour depth of an image affects its file size.
5...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(d) The first row of pixels in the image from part (b) is shown:
B B B B B B B B
Explain how this row of pixels can be compressed using lossless compression.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Examiner Comments
(a) (a) There were many correct answers to this question. Some answers seemed to confuse the number of pixels
wide by the number of pixels high (the image resolution) with the number of bits used to represent each colour
(the bit depth).
(b) (b) (i) This question was also answered well, the most common incorrect answer was 9, presumably because
there were 9 different colours in the diagram.
(ii) The question asked for the answer in bytes, the answer to part 1(b)(i) was in bits. This was an example
of a situation where the questions needed to be read carefully. Some answers correctly calculated the size of the
image in bits, but then omitted to divide by 8 to bring the answer to bytes.
(c) (c) This was a question where answers needed to be exact. Vague answers such as ‘a change in colour depth
will increase the size of the file’ were common. This answer does not specify whether the change in colour
depth is an increase or a decrease. A precise answer is, ‘an increase in the colour depth will increase the size
of the file’.
(d) (d) Many answers correctly named or described a method of lossless compression. Run-length encoding was
easily the most popular choice. Some answers did not achieve both of the marks because their answer did not
explain how the method would have been applied to the row of pixels given in the question. This question was
set in a specific context and needed an answer to be applied rather than being completely generic.
9608 W15 P11, P13
8 (a) Six computer graphics terms and seven descriptions are shown below.
Draw a line to link each term to its correct description. [6]
Term Description
Value quoted for a monitor specification, such as 1024 × 768.
The larger the numbers, the more picture elements will be
displayed.
Image file
Picture element
header
Screen Specifies the image size, number of colours, and other data
resolution needed to display the image data
(a) The x-coordinate of the centre of the three squares is held in three memory locations:
Address Memory contents
S 40 0000 1011 0100
T 41 0010 0101 0100
U 42 0100 0110 1100
(b) Bitmap graphics are used to represent squares S, T and U.
These can be saved in a number of different image resolutions.
(i) Give the number of bits required to store each pixel for a black and white bitmap.
.......................................................................................................................................[1]
(ii) Identify how many bits are required to store each pixel for a 256-colour bitmap.
Explain your answer.
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................[2]
(iii) A second picture has width 2048 pixels and height 512 pixels. It is saved as a 256-colour
image.
Calculate the file size in kilobytes. Show your working.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................[3]
(iv) The actual bitmap file size will be larger than your calculated value.
State another data item that the bitmap file stores in addition to the pixel data.
...........................................................................................................................................,,,,,,,,,,
,,,,.......................................................................................................................................[1]
Q 4) 9608 S 17 P12
(b) The computer also has bitmap software.
(i) Define the term image resolution.
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) A picture is drawn and is saved as a 16-colour bitmap image.
State how many bits are used to encode the data for one pixel.
.......................................................................................................................................[1]
(iii) A second picture has width 8192 pixels and height 256 pixels. It is saved as a 256-
colourbitmap.
Calculate the file size in kilobytes.
Show your working.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.................................................................................................................................................[3]
(iv) The actual bitmap file size will be larger than your calculated value as a bitmap file has a
file header. State two items of data that are stored in the file header.
1 ........................................................................................................................................
2 ....................................................................................................................................[2]
Q 5) 9608 S18 P11
2 A logo is designed as a bitmap image.
(a) Describe what is meant by a bitmap image.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.........................................................................................................................................[2]
(b) A black and white bitmap image is shown.
(a) State the minimum number of bits needed to represent each pixel in this image.
...............................................................................................................................................[1]
(b) Run-length encoding (RLE) is used to store the image with the following colour codes.
Colour Code
Black 1A
White 3B
Show how run-length encoding is used to store the image.
.....................................................................................................................................................
.....................................................................................................................................................
........................................................................................................................................... [3]
(c) An image has 30 different colours.
State the minimum number of bits needed to represent each pixel in the 30-colour image.
...............................................................................................................................................[1]
(d) When the image is saved, a header is added to the file.
State the purpose of the file header. Give two examples of the file header contents.
Purpose ....................................................................................................................................
...................................................................................................................................................
Example 1 .................................................................................................................................
...................................................................................................................................................
Example 2 .................................................................................................................................
...............................................................................................................................................[3]
(e) Graphics software is used to edit a digital photograph.
Give three features of graphics software that can be used to edit the photograph.
Describe the effect each has on the photograph.
Feature 1 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 2 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 3 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
................................................................................................................................................[6]
Q 7) 9608 W18 P11
1 A company is designing a website.
(a) The company creates a 4-colour bitmap image for the website as shown.
Each colour is represented by a letter, for example, G = grey, K = black.
G R G K W R
G R G K W R
G R G K W R
G R G K W R
G G G K K R
W W W W K R
(i) State the minimum number of bits needed to represent each pixel in the image in part (a).
...................................................................................................................................... [1]
(ii) Calculate the minimum file size of the image shown in part (a). Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
File size ............................................................................................................................. [3]
(b) The company takes a photograph of their office to put on the website. The photograph has
a resolution of 1000 pixels by 1000 pixels. Two bytes per pixel are used to represent the
colours.
(i) Estimate the file size of the photograph in megabytes. Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Estimated file size ............................................................................................................. [4]
(ii) The file size of the photograph needs to be reduced before it is placed on the website.
Draw lines to link each method of reducing the file size of the image to:[5]
• its description and
• its compression type, where appropriate.
Compression
Description Method
type
Lossless
Stores colour code
Use fewer colours
and count of
repetitions
(c) The company has created a logo for the website. The logo is a vector graphic.
Describe two reasons why a vector graphic is a sensible choice for the logo.
Reason 1 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Reason 2 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................[4]
Q 8) 9608 S19 P13
5 Xander creates a presentation that includes images, video and sound.
(a) The images are bitmap images. A bitmap image can be made up of any number of
colours.
Each colour is represented by a unique binary number.
Draw one line from each box on the left, to the correct box on the right to identify the
minimum number of bits needed to store each maximum number of colours.
68 2
256 3
127 7
2 8
249 9
Q 9) 9608 W19 P12
6(d) Dominic’s tablet captures a video of Dominic to send to other people. The video is made
of a sequence of images and a sound file.
(i) Describe how the images and sound are encoded into a digital form.
Images ..............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Sound ................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [4]
Q 10) 9608 S 20 P1
4 A digital camera takes a bitmap image. The image is 2000 pixels wide by 1000 pixels high
with a colour depth of 24-its.
(a) Calculate an estimate of the file size for the image. Give your answer in megabytes. Show
your working.
Working .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.................................................................................................................................................
Answer .......................................................... MB [3]
(b) A second image is taken, this time in black and white. It has the same number of pixels,
but the file size is smaller. Explain why the file size is smaller.
.....................................................................................................................................................
.....................................................................................................................................................
...................................................................................................................................... [2]
Q 11) 9608 S20 P12
1 (b) Samira uses a computer to draw a logo for her hotel and saves it as a vector graphic.
The logo will be placed on the multimedia presentation and elsewhere, such as on signs at
the entrance of the hotel.
Samira emails the logo to a company that prints signs, and other documentation for the hotel.
(i) Describe how the logo is represented by the computer.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
........................................................... [3]
(ii) State two reasons why the hotel logo is saved as a vector graphic instead of a bitmapped
graphic.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
Q 12) 9608 S 20 P13
7 Xiaoming created the following logo using bitmapped graphics software.
(a) Describe how one typical feature of bitmapped graphics software was used to create the
logo.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.......................................................................................................................................[2]
(b) The finished logo is 160 pixels wide and 160 pixels high. The image has a colour depth of
3 bytes per pixel.
Calculate an estimate of the file size for the logo. Give your answer in kilobytes. Show your
working.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ........................................................ KB [3]
(c) Xiaoming needs to use his logo on his business card, on his website and on large display
boards. He is told that he should have created a vector graphic logo instead of a bitmapped
graphic logo.
Describe one benefit of creating a vector graphic logo instead of a bitmapped graphic logo.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................ [2]
Q 13) 9608 W20 P13 - 7 Wilbur uses vector graphics to create a logo for his company.
(a) Describe how the logo is represented and encoded by the computer.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................ [4]
(b) Wilbur scans a hand drawn image. The scanned image uses 8 bits to store the colour for
each pixel. The image is 2048 pixels wide by 1024 pixels high.
(i) Calculate an estimate of the file size of the scanned image. Give your answer rounded to
the nearest MB. Show your working.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................Answer
................................. MB [2]
(ii) Wilbur wants to compress the scanned image before emailing it to his colleague.
Describe one lossy compression technique that Wilbur can use to compress this image.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
1.2 Sound
1.2 Multimedia Sound
Candidates should be able to: Notes and guidance
Show understanding of how sound is Use the terms: sampling, sampling rate,
represented and encoded sampling resolution, analogue and digital
data
Show understanding of the impact of Impact on file size and accuracy
changing the sampling rate and resolution
Sampling: Taking amplitude of sound wave at a regular interval of time is called Sampling,
for that sound wave is broken down into smaller pieces at a regular interval of time. These
smaller pieces are known as Sample and this process is known as Sampling.
Sampling resolution – number of bits used to represent sound amplitude (also known as bit
depth).
Sampling rate – number of sound samples taken per second.
2ac 9618 W21 P11 P13 – 7 Bobby is recording a sound file for his school project.
(a) He repeats the recording of the sound several times, with a different sample rate each
time.
(i) Describe the reasons why the sound is closer to the original when a higher sample rate is
used.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Describe the reasons why the sound file size increases when a higher sample rate is
used.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
Example Question: A company advertises its backup memory device as having 500 GB of storage. A
customer wishes to know how many 8 MB files could be stored on the device. The company claimed
that up to 62 500 files (assuming each file is 8 MB) could be stored. The customer calculated that 64
000 files could be stored.
Explain the difference between these two storage values. Show any calculations you use in your
explanation.
...................................................................................................................................................................
.................................................................................................................................................
Example Question : Bytes, Kilobytes and Megabytes are units used for the amount of data stored in a
computer.
(a) State which of these units is most appropriate for the following items of data.
A one page text document: ...............................................................................................................
A ten minute movie clip: ....................................................................................................................
A person’s surname: .................................................................................................................... [3]
(b) A computer has a hard disk of 2 Terabytes.
How much is this in Gigabytes? You must show your working.
...................................................................................................................................................................................
...................................................................................................................................................................................
.................................................................................................................................................. [2]
Q 6) Summer2018 P12
5 A student has recorded a sound track for a short film.
(a) Explain how an analogue sound wave is sampled to convert it into digital format.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(b) Explain the effects of increasing the sampling resolution on the sound file.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) The original sound was sampled at 44.1kHz. The sample rate is changed to 22.05kHz.
Explain the effects of this change on the sound file.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(d) The student uses sound editing software to edit the sound file.
Name two features of sound editing software the student can use to edit the sound file.
Describe the purpose of each feature.
Feature 1 ...................................................................................................................................
Purpose .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 2 ...................................................................................................................................
Purpose .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Q 7) Winter 2018 P11
1 A student is creating a short video and needs to record music to play in the background.
(a) The student uses a microphone to capture the music.
Explain how the microphone captures the music.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(b) An analogue-to-digital converter uses sampling to encode the sound.
Explain how different sampling resolutions affect the sound file and the sound it represents.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) The student needs to edit the sound file.
Describe two features of sound editing software that can be used to edit the sound file.
Feature 1 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 2 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................[4]
Q 8) Summer 2019 P11
1 (d) A recording of a concert is stored as a file. The file is compressed using lossy
compression before it is streamed to users.
(i) State why this file needs to be compressed.
.....................................................................................................................................................
................................................................................................................................................ [1]
(ii) Define the term lossy compression.
.....................................................................................................................................................
............................................................................................................................................... [1]
(iii) The file could be compressed using lossless compression.
Explain why lossy compression is a more appropriate compression technique than lossless
for this file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [3]
6 A student records a video using a digital camera.
(d) A sound track is recorded for the video.
(i) Describe how a computer encodes the sound track.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
........................................................... [3]
(ii) Explain how the sampling rate and sampling resolution affect the file size of the
soundtrack.
Sampling rate .............................................................................................................................
....................................................................................................................................................
Sampling resolution ...................................................................................................................
.............................................................................................................................................. [2]
Q 9) Summer 2019 P13
5 Xander creates a presentation that includes images, video and sound.
(c) The sound track has a sampling rate of 88.2kHz and a sampling resolution of 32 bits.
State what is meant by a sampling rate of 88.2kHzand a sampling resolution of 32 bits.
Sampling rate of 88.2kHz
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................................................................................................
Sampling resolution of 32 bits
................................................................................................................................……………...
.....................................................................................................................................................
................................................................................................................................................[2]
Q 10) Winter 2019 P12
6(d) Dominic’s tablet captures a video of Dominic to send to other people. The video is made of a
sequence of images and a sound file.
(i) Describe how the images and sound are encoded into a digital form.
Images ..............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Sound ................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [4]
Q 11) Winter 2019 P13
2 (b) Leonardo uses the mobile phone to record his voice.
(i) Describe how sound sampling is used by the mobile phone to encode the sound.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Leonardo records his voice twice. Each recording is the same length and has the same sampling
resolution.
The first recording has a sampling rate of 44100Hz. The second recording has a sampling rate of
21000Hz.
Describe how the different sampling rates will affect the recording and the sound file.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(iii) Leonardo transfers the recordings to his laptop computer. He uses sound editing software to
delete some sections of the recordings, and copy and paste to replicate other sections.
Describe two other features of sound editing software Leonardo can use to edit the recordings.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [4]
....................................................................................................................
Sampling ....................................................................................................................
....................................................................................................................
....................................................................................................................
....................................................................................................................
Sampling
....................................................................................................................
resolution
....................................................................................................................
....................................................................................................................
(b) The file is too large to be emailed and the file size needs to be reduced.
(i) Name one lossless compression technique that can be used to reduce the size of the
sound file.
.....................................................................................................................................................
............................................................................................................................................... [1]
(ii) Describe one lossy compression technique that can be used to reduce the size of the
sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
Q 13) Winter 20 P11
5 Oscar is watching a concert on his laptop computer.
(a) The concert is streamed to his computer at the same time as it is taking place.
(i) Identify whether Oscar is using real-time or on-demand bit streaming. Justify your choice.
Streaming method .............................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [3]
(ii) The video of the concert repeatedly stops and restarts while Oscar is watching it on his
laptop computer. His friend is watching the same video of the concert at the same time, in a
different location, but he does not experience the same problem as Oscar.
Give three possible reasons why Oscar’s video constantly stops and starts again.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
........................................................................................................................................... [3]
(b) (iii) Give another type of redundancy technique that can be used to compress a video.
.....................................................................................................................................................
............................................................................................................................................ [1]
(iv) MP4, WMV and AVI are all examples of a type of format that combines sound and image
components into a video.
Identify the type of format that combines the sound and image components into a video.
.....................................................................................................................................................
.............................................................................................................................................. [1]
7 Anne is downloading a sound file from a web server. She had the choice of a sampling rate
of 44.1kHz or 98kHz before she downloaded the sound file.
Explain the differences between the two sound files stored on the server.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................... [4]
Marking Scheme
Q 1) Summer 15 P11-12
Q 2) Winter 15 P12
Q 3) Summer 16 P11, 12
Q 5) Summer 17 P12
Q 6) Summer2018 P12
Q 7) Winter 2018 P11
Q 8) Summer 2019 P11
Q 9) Summer 2019 P13
Lossless file compression – file compression method where the original file can be restored following
decompression. Lossless compression can compress up-to 50%
Lossy file compression – file compression method where parts of the original file cannot be recovered
during decompression, so some of the original detail is lost. (in MP3, 90% reduction in file size).
JPEG – Joint Photographic Expert Group – a form of lossy file compression based on the inability of
the eye to spot certain colour changes and hues.
MP3/MP4 files – file compression method used for music and multimedia files.
Audio compression – method used to reduce the size of a sound file using perceptual music shaping.
Perceptual music shaping – method where sounds outside the normal range of hearing of humans,
for example, are eliminated from the music file during compression.
Bit rate – number of bits per second that can be transmitted over a network. It is a measure of the
data transfer rate over a digital telecoms network.
Run length encoding (RLE) – a lossless file compression technique used to reduce text and photo files
in particular.
RLE: a lossless file compression method used for text, images and sound. It identifies
repeated characters in text/ repeated pixels in images/ repeated samples in sound, replaces
them with a one copy of character/pixel/sample and the number of times it occurs.
Compression Compression is a useful tool for reducing file sizes. When images, sounds or videos
are compressed, data is removed to reduce the file size.
Advantage of File Compression
➢ Compressed file occupies lesser storage space.
➢ Compressed file occupies lesser space in memory.
➢ File can be uploaded and download quickly.
➢ Lesser internet data is used in transmission of compressed file.
➢ To make it small enough to attach to an email.
This is very helpful when streaming and downloading files.
Streamed music and downloadable files, such as MP3s, are usually between 128 kbps and
320 kbps - much lower than the 1,411 kbps of an uncompressed file.
Videos are also compressed when they are streamed over a network. Streaming HD video
requires a high-speed internet connection. Without it, the user would experience buffering and
regular drops in quality. HD video is usually around 3 mbps. SD is around 1,500 kbps.
Lossy and lossless compression
Compression can be lossy or lossless.
Lossless compression means that as the file size is compressed but data is restored back to its
original state on uncompressing. Run Length Encoding is a method of lossless file
compression. Lossless compression is mostly used for documents and software, sometime
images and audio are also compressed using lossless compression.
Lossless compression can compress up-to 50%
Lossy compression permanently removes data. For example, an image file compressed to jpeg
using factor of 5 to 15 while an audio WAV file compressed to an MP3 (90% reduction in file
size). Lossy file compression is mostly used for images, audio and video files.
Benefits and drawbacks of file compression.
Lossy File Compression: Unnecessary data is removed permanently; file is compressed to smallest
possible file size.
Lossless File Compression: Nothing of the data is lost. Compressed file is not as small as in lossy
file compression.
Text file compression
Text and numbers are usually stored in an ASCII format.
Text files are also compressed. Lossless compression method is used for text and numbers.
Algorithm 1- Dictionary Coding:
These use complex algorithms that work on redundancy or repeated sections of words (e.g. OU in
yOUr, ctOUntry or mOUntain). Here in the original text there are 42 characters including spaces, after
compression the size become 31 characters long.
THIS 1
HOW 2
OU 3
Text compression typically works by finding similar strings within a text file, and replacing those
strings with a temporary binary representation to make the overall file size smaller. Computers can
compress text by finding repeated sequences and replacing them with shorter representations, a
character that isn't part of the original text.
For example, a quote having 84 characters
“Think left and think right and think low and think high. Oh, the thinks you can think up if only
you try!"
The computer also needs to store the table of replacements that it made, so that it can reconstruct the
original.
replacement original
$ think
& and
# you
The repeated words replaced with the character and the compressed file has 50 characters.
The compressed file is “$ left & $ right & $ low & $ high. Oh, the $s # can $ up if only # try!"
Algorithm 2: Run length encoding (RLE) on text data
One of the simplest examples of compression is RLE.
RLE is a basic form of data compression that converts consecutive identical values into a
code consisting of the character and the number marking the length of the run.
The more similar values there are, the more values can be compressed.
The sequence of data is stored as count and a single value.
For example, to compress a text string “aaaabbbbcccccccddddd” as “4a4b7c5d”
a4 b4 C7 d5
3c 9618 S22 P13
1 Text and numbers are examples of data stored in a computer.
(a) (iii) Describe how lossless compression can be used to reduce the file size of a text file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
(iv) Explain why lossy compression should not be used on a text file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
Reducing bit depth and pixel density reduces the file size but the removed data cannot be
put back so original image cannot be recreated.
Effect of reducing pixel density Effect on reducing bit depth
In run-length encoding, the computer replaces each row with numbers that say how many consecutive
pixels are the same color, For example, to compress 1st two rows of the image has 20 consecutive
11111111111111111111 0000 0000 0011 or WWWW WWWW WWWW WWWW WWWW BBBB
BBBB BBWW
This would be represented after Run Length Encoding as follows (1st colour code then number of
pixels) : 1 20 0 10 1 2 or W 20 B 10 W 2
1 20 0 10 12
or W 20 or B 10 or W 2
2b 9618 W21 P12 - 5 Riya has created the following logo as a vector graphic.
b (ii) Riya needs to email the photograph. She compresses the photograph before sending it
using an email. Describe two lossy methods that Riya can use to compress the image.
Method 1 .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
Method 2 .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................ [4]
1 mark for each bullet point to max 2 for each method
Reduce bit depth
... reduces the number of bits per colour / pixel which means each pixel has fewer bits
5(b)(ii) Reduce colour palette // reduce number of colours
... fewer colours mean fewer bits needed to store each colour
Reduce image resolution
... fewer pixels per unit measurement means less binary to store
7c 9608 Summer 2018 P13
6 A black and white bitmap image is shown.
(a) State the minimum number of bits needed to represent each pixel in this image.
...............................................................................................................................................[1]
(b) Run-length encoding (RLE) is used to store the image with the following colour codes.
Colour Code
Black 1A
White 3B
Show how run-length encoding is used to store the image.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) An image has 30 different colours.
State the minimum number of bits needed to represent each pixel in the 30-colour image.
...............................................................................................................................................[1]
(d) When the image is saved, a header is added to the file.
State the purpose of the file header. Give two examples of the file header contents.
Purpose ....................................................................................................................................
...................................................................................................................................................
Example 1 .................................................................................................................................
...................................................................................................................................................
Example 2 .................................................................................................................................
............................................................................................................................................... [3]
(e) Graphics software is used to edit a digital photograph.
Give three features of graphics software that can be used to edit the photograph.
Describe the effect each has on the photograph.
Feature 1 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 2 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Feature 3 ...................................................................................................................................
Effect .........................................................................................................................................
...................................................................................................................................................
................................................................................................................................................ [6]
6(a) 1 1
1 mark for correct method (colour code and number of pixels)
1 mark for first 7 groups correct
6(b) 3
1 mark for remainder correct
3B 9 1A3 3B3 1A2 3B1 1A2 3B21A1 3B3 1A1 3B2 1A2 3B1 1A2 3B3 1A3 3B9
6(c) 5 1
1 mark for purpose
• Stores data about the file contents/image/metadata
Max 2 marks for examples of contents
•Confirmation that the file is a BMP // confirmation of file type
6(d) •File size 3
•Location / offset of image data within the file
•Dimensions of the image (in pixels) // image resolution
•Colour depth (bits per pixel, 1, 4, 8, 16, 24 or 32)
•Type of compression used (if any)
1 mark for naming tool,
1 mark for describing effect on the photograph e.g.
•Resize
•Increase / decrease the size of the image
•Crop
6(e)
•Remove part of the image
•Blur
•Reduce the focus
•Red eye reduction
•Reduces red (light reflected from human eyes)
Audio File Compression
Lossy File Compression of Audio using MP3:
This has become the standard for distributing digital music files on the internet. To perform
lossy file compression on audio file following steps are taken:
Lossy file compression algorithm is used Perceptual Music Shaping algorithm is the lossy file
compression for audio file.
It removes the background noise.
It removes sounds that are generally beyond the limits of most people’s hearing and does not
noticeably affect the quality of sound.
When using MP3 format, the size of the music track will be reduced by a factor of 10 (i.e. the size is
reduced by 90% and remaining file size is only 10% of original size).
The quality of MP3 files depends on the BIT RATE – this is the number of bits per second used when
creating the file. Bit rates are roughly between 80 and 320 kilobits per second; usually 200 or higher
gives a sound quality close to a normal CD.
For example, a 50-megabyte music CD can be reduced to 5 megabytes.
50 MB x 90/100= 45 MB reduced. 50 MB x 10/100=5 MB new file size.
Lossless File Compression of Audio File
For lossless file compression of audio file following steps are taken:
➢ A lossless file compression algorithm RLE is used
➢ Consecutive sound patterns are identified.
➢ Consecutive identical values converted into a code consisting of the sound pattern
and the number marking the length of the run.
➢ The more similar values there are, the more values can be compressed.
➢ The sequence of data is stored as a single value and count.
Video File Compression: a video is actually combination of sound and images
➢ A compression algorithm is used
➢ Redundant data is removed
➢ Reduce colour depth
➢ Reduce image resolution
➢ Reduce sample rate
➢ Reduce sample resolution
➢ Reduce frame rate
➢ Use perceptual music shaping
➢ Data is permanently removed.
2ac W21 P11 P13 –
7 Bobby is recording a sound file for his school project.
(b) Bobby wants to email the sound file to his school email address. He compresses the file
before sending the email.
(i) Explain the reasons why Bobby compresses the sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
(ii) Bobby uses lossless compression.
Describe how lossless compression can compress the sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
1 mark per bullet point
Reduces the file size
7(b)(i) 2
Faster to transmit/download
Original file is too large for email storage/attachment
1 mark per bullet point to max 2e.g.
Reduce amplitude to only the range used
… limited amplitudes mean fewer bits per sample
7(b)(ii) Run-length-encoding
… Where consecutive sounds are the same record the binary value of
the sound and number of times it repeats
Record the changes instead of the actual sounds
1ac 9618 S21 P12_13 - 1 Anya scans an image into her computer for a school project.
(b) The image is compressed using lossless compression.
Identify one method of lossless compression that can be used to compress the image and
describe how the method will reduce the file size.
Lossless compression method ...................................................................................................
Description ..................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................. [3]
2b 9618 W21 P12 - 5 Riya has created the following logo as a vector graphic.
b (ii) Riya needs to email the photograph. She compresses the photograph before sending it
using an email. Describe two lossy methods that Riya can use to compress the image.
Method 1 .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...................................................................................................................................................
Method 2 .....................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [4]
2ac W21 P11 P13 –
7 Bobby is recording a sound file for his school project.
(b) Bobby wants to email the sound file to his school email address. He compresses the file
before sending the email.
(i) Explain the reasons why Bobby compresses the sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [2]
(ii) Bobby uses lossless compression.
Describe how lossless compression can compress the sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [2]
Show how RLE will compress the first three rows of this image.
Row 1: ...............................................................................................................................
Row 2: ...............................................................................................................................
Row 3: ...........................................................................................................................[2]
Summer2018 P11
2 A logo is designed as a bitmap image.
(a) Describe what is meant by a bitmap image.
.....................................................................................................................................................
.................................................................................................................................................[2]
(b) A black and white bitmap image is shown.
(a) State the minimum number of bits needed to represent each pixel in this image.
...............................................................................................................................................[1]
(b) Run-length encoding (RLE) is used to store the image with the following colour codes.
Colour Code
Black 1A
White 3B
Show how run-length encoding is used to store the image.
.....................................................................................................................................................
.....................................................................................................................................................
.................................................................................................................................................[3]
(c) An image has 30 different colours. State the minimum number of bits needed to represent
each pixel in the 30-colour image. .....................................................................................[1]
(d) When the image is saved, a header is added to the file.
State the purpose of the file header. Give two examples of the file header contents.
Purpose ....................................................................................................................................
...................................................................................................................................................
Example 1 .................................................................................................................................
...................................................................................................................................................
Example 2 .................................................................................................................................
............................................................................................................................................... [3]
(e) Graphics software is used to edit a digital photograph.
Give three features of graphics software that can be used to edit the photograph.
Describe the effect each has on the photograph.
Feature 1 ...................................................................................................................................
Effect .........................................................................................................................................
.....................................................................................................................................................
.................................................................................................................................................
Feature 2 ...................................................................................................................................
Effect .........................................................................................................................................
.....................................................................................................................................................
.................................................................................................................................................
Feature 3 ...................................................................................................................................
Effect ........................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................. [6]
6(a) 1 1
1 mark for correct method (colour code and number of pixels)
1 mark for first 7 groups correct
6(b) 3
1 mark for remainder correct
3B 9 1A3 3B3 1A2 3B1 1A2 3B21A1 3B3 1A1 3B2 1A2 3B1 1A2 3B3 1A3 3B9
6(c) 5 1
1 mark for purpose
• Stores data about the file contents/image/metadata
Max 2 marks for examples of contents
•Confirmation that the file is a BMP // confirmation of file type
6(d) •File size 3
•Location / offset of image data within the file
•Dimensions of the image (in pixels) // image resolution
•Colour depth (bits per pixel, 1, 4, 8, 16, 24 or 32)
•Type of compression used (if any)
1 mark for naming tool,
1 mark for describing effect on the photograph e.g.
•Resize
•Increase / decrease the size of the image
•Crop
6(e)
•Remove part of the image
•Blur
•Reduce the focus
•Red eye reduction
•Reduces red (light reflected from human eyes)
Q 6) Winter 2018 P11
1 A company is designing a website.
(a) The company creates a 4-colour bitmap image for the website as shown.
Each colour is represented by a letter, for example, G = grey, K = black.
G R G K W R
G R G K W R
G R G K W R
G R G K W R
G G G K K R
W W W W K R
(i) State the minimum number of bits needed to represent each pixel in the image in part (a).
...................................................................................................................................... [1]
(ii) Calculate the minimum file size of the image shown in part (a). Show your working.
Working ......................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
File size ............................................................................................................................. [3]
(b) The company takes a photograph of their office to put on the website. The photograph has
a resolution of 1000 pixels by 1000 pixels. Two bytes per pixel are used to represent the
colours.
(i) Estimate the file size of the photograph in megabytes. Show your working.
Working .............................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...................................................................................................................................................
Estimated file size ............................................................................................................. [4]
(ii) The file size of the photograph needs to be reduced before it is placed on the website.
Draw lines to link each method of reducing the file size of the image to: [5]
• Its description and
• Its compression type, where appropriate.
Description Method Compression type
(c) The company has created a logo for the website. The logo is a vector graphic.
Describe two reasons why a vector graphic is a sensible choice for the logo.
Reason 1 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Reason 2 ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [4]
Summer 2019 P11
1 (d) A recording of a concert is stored as a file. The file is compressed using lossy
compression before it is streamed to users.
(i) State why this file needs to be compressed.
.....................................................................................................................................................
.............................................................................................................................................. [1]
(ii) Define the term lossy compression.
.....................................................................................................................................................
.............................................................................................................................................. [1]
(iii) The file could be compressed using lossless compression.
Explain why lossy compression is a more appropriate compression technique than lossless
for this file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [3]
9608 2019 P11
5 (e) Data can be compressed using either lossy or lossless compression.
Tick (✓) one box in each scenario to identify whether lossy or lossless compression should be
used. Justify your choice.
(i) A program written in a high-level language.
Lossy Lossless
Justification ................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
(ii) A photograph that needs to be emailed to a friend.
Lossy Lossless
Justification ................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
(iii) You need to upload a video that you have created to a website.
Lossy Lossless
Justification ................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [2]
Q 9) 9608 20 P1
9 Utility programs are examples of system software.
(b) File compression is one example of a utility program. [1]
Tick (✓) one box on each row to indicate whether the action is an example of lossy
compression or lossless compression.
Action Lossy Lossless
Reducing the resolution of an image
Using run-length encoding on a text file
Reducing the sampling rate of a sound file
9608 2020 P12
2 (b) The file is too large to be emailed and the file size needs to be reduced.
(i) Name one lossless compression technique that can be used to reduce the size of the
sound file.
.....................................................................................................................................................
........................................................................................................................................... [1]
(ii) Describe one lossy compression technique that can be used to reduce the size of the
sound file.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [2]
9608 Winter 20 P12
7 (b) Wilbur scans a hand drawn image. The scanned image uses 8 bits to store the colour
for each pixel. The image is 2048 pixels wide by 1024 pixels high.
(i) Calculate an estimate of the file size of the scanned image. Give your answer rounded to
the nearest MB. Show your working.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................
Answer ................................. MB [2]
(ii) Wilbur wants to compress the scanned image before emailing it to his colleague.
Describe one lossy compression technique that Wilbur can use to compress this image.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................ [3]
1.3 Data Storage
Candidates should be able to: Notes and guidance
1 Understand how data storage is measured • Including:
– bit
– nibble
– byte
– kibibyte (KiB)
– mebibyte (MiB)
– gibibyte (GiB)
– tebibyte (TiB)
– pebibyte (PiB)
– exbibyte (EiB)
• The amount of the previous denomination
present in the data storage size, e.g.:
– 8 bits in a byte
– 1024 mebibytes in a gibibyte
2 Calculate the file size of an image file and a • Answers must be given in the units specified in
sound file, using information given the question
• Information given may include:
– image resolution and colour depth
– sound sample rate, resolution and length of
track
It should be pointed out here that there is some confusion in the naming of memory sizes.
There are two different methods:
1. Denary Prefix System used in SI Units. It is base 10 system. In this system 103 = 1000 i.e. Kilo
2. Binary Prefix System used in IEC Units (International Elcrtro-Technical Commission).
It is a base 2 system. In this system 210=1024 i.e. kibi
SI Units IEC units
1 Kilo Byte = 103= 1,000 byte 1 kibibyte (1 KiBi) = 210= 1024 bytes
1 Mega Byte = 106=1,000,000 bytes 1 mebibyte (1 MiBi) = 220= 1024 *1024 bytes
1 Giga Byte = 109=1,000,000,000 bytes 1 gibibyte (1 GiBi) =230= 1024 MiBi bytes
1 Tera Byte = 1012 = 1,000 GB 1 tebibyte (1 TiBi) =240= 1024 GiBi bytes
1 Peta Byte = 10151,000 TB 1 pebibyte (1 PiBi) =250= 1024 TiBi bytes
1 Exa Byte = 10121,000 PB 1 exbibyte (1 XiBi) =260= 1024 PiBi byte
and so on. and so on.
Image File Size Calculation
To calculate image file size, firstly number of
pixels found out then these are multiplied to
find total number of pixels in an image that
gives, image resolution.
For example 2048 pixels wide and 2048 pixels
high image will have 2048 × 2048 pixels. This
is often referred to as a 4-megapixel image.
Uncompressed raw Then Image resolution is multiplied by bit depth.
image
Black & White image Grey Scale 8-Colour True Colour
Bit Depth=1 Bit Depth=2 Bit Depth= 3 Bit Depth=24
Image Size Image Size Image Size Image Size
= 2048* 2048 * 1 bit = 2048* 2048 * 2 bit = 2048*2048*3 bit = 2048*2048*24 bit
= 2048*2048*1/8 Byte = 2048*2048*2/8 Byte = 2048*2048*3/8 Byte = 2048*2048*24/8
= 2048*2048*1/(8*1024) = 2048*2048*2 = 2048*2048*3 Byte
= 512 KiB /(8*1024*1024) /(8*1024*1024) = 2048*2048*24
= 1 MiB = 1.5 MiB /(8*1024*1024)
= 12 MiB
Image Size = 512 KiB Image Size = 1 MiB Image Size = 1.5 MiB Image Size = 12MiB
Unit 2 Communication
Topic You should be able to R A G
• Understand networking including LANs (local area networks), WANs (wide
area networks), devices, models (client-server and peer-to-peer), wireless and
wired communication, routers, ethernet
Communication • Understand the difference between the World Wide Web (WWW) and the
Internet
• Understand the use of IP addressing, Uniform Resoruce Locator (URL) and
Domain Name Service (DNS)
In a LAN there is the added benefit of being able to share hardware. For example, the
classroom with 20 computers may only have one or two printers. Also, those printers may be
of different types and used for different tasks. This means that the type of printer used is
dependent on the job that the user wants it to do rather than on the type of printer that
happens to be connected to the computer from which the printout is sent.
• A file server could be attached to the LAN that allowed users to store larger files and
also allowed files to be shared between users.
• The ‘paper-less office’ became a possibility, where files were to be stored in digital
form
on a file server rather than as paper copies in a filing cabinet.
• The LAN will contain a device that allows connection to other networks.
When devices are connected across a wider geographical area, they form a wide area
network (WAN). Often lots of LANs are connected together to create a WAN. There are many
examples of WANs, such as a bank connecting all of its cash machines together across the
country, or regional police stations connecting together to share information.
The largest example of a WAN is the internet, which allows LANs in homes, businesses,
universities, or anywhere else to connect to each other by utilising an internet service provider
(ISP). For example, if you connect your mobile phone to your WiFi router when you are at
home, you are connecting to your home LAN. If you then use your phone to access a website
or a social media app, you have connected to the internet, which is a WAN.
The benefits of having the computers connected by a WAN were:
• a ‘job’ could be run on a remote computer that had the required application software
• a data archive that was stored on a remote computer could be accessed
• a message could be transmitted electronically to a user on a remote computer.
Today, a typical WAN is characterised by the following.
• It will be used by an organisation or a company to connect sites or branches.
• It will not be owned by the organisation or company.
• It will be leased from a public switched telephone network company (PSTN).
• A dedicated communication link will be provided by the PSTN.
• The transmission medium will be fibre-optic cable.
• Transmission within the WAN will be from switch to switch.
• A switch will connect the WAN to each site.
• There will not be any end-systems connected directly to the WAN.
Following are different types of networks.
These services constitute what is known as the Cloud Computing Stack with SaaS at the top,
PaaS in the middle, and IaaS on the bottom.
Types of cloud computing
Not all clouds are the same and not one type of cloud computing is right
for everyone. Several different models, types, and services have evolved
to help offer the right solution for your needs.
First, you need to determine the type of cloud deployment, or cloud
computing architecture, that your cloud services will be implemented on.
There are three different ways to deploy cloud services: on a public
cloud, private cloud, or hybrid cloud.
Private cloud
Private cloud is cloud infrastructure owned, operated and accessed by an organisation,
whether managed internally or by a third party, and hosted either internally or externally.
A private cloud refers to cloud computing resources used exclusively by a single business or
organization. A private cloud can be physically located on the company’s on-site datacentre.
Some companies also pay third-party service providers to host their private cloud. A private
cloud is one in which the services and infrastructure are maintained on a private network.
Public cloud
Public cloud is owned by a cloud service provider for general access. Cloud services are
considered "public" when they are delivered over the public Internet, and they may be offered
as a paid subscription, or free of charge.
Public clouds are owned and operated by a third-party cloud service providers, which deliver
their computing resources, like servers and storage, over the Internet.
Hybrid cloud
Hybrid cloud is a composition of a public cloud and a private environment, such as a private
cloud or on-premises resources, that remain distinct entities but are bound together, offering
the benefits of multiple deployment models. Hybrid cloud can also mean the ability to connect
collocation, managed and/or dedicated services with cloud resources.
Advantages of Cloud Computing
Advantages of cloud computing are given below:
1) Back-up and restore data
Once the data is stored in the cloud, it is easier to get back-up and restore that data using the
cloud.
2) Improved collaboration
Cloud applications improve collaboration by allowing groups of people to quickly and easily
share information in the cloud via shared storage.
3) Excellent accessibility
Cloud allows quickly and easily access store information anywhere, anytime in the whole
world, using an internet connection. An internet cloud infrastructure increases organization
productivity and efficiency by ensuring that data is always accessible.
4) Low maintenance cost
Cloud computing reduces both hardware and software maintenance costs for organizations.
5) Mobility
Cloud computing allows us to easily access all cloud data via mobile.
6) Services in the pay-per-use model
Cloud computing offers Application Programming Interfaces (APIs) to the users for access
services on the cloud and pays the charges as per the usage of service.
7) Unlimited storage capacity
Cloud offers a huge amount of storing capacity for storing important data such as documents,
images, audio, video, etc. in one place.
8) Data security
Data security is one of the biggest advantages of cloud computing. Cloud offers many
advanced features related to security and ensures that data is securely stored and handled.
Disadvantages of Cloud Computing
A list of the disadvantage of cloud computing is given below -
1) Internet Connectivity
Good internet connectivity is the basic requirement for cloud computing. Data from the cloud
cannot be accessed from cloud without good internet connectivity.
2) Vendor lock-in
Vendor lock-in is the biggest disadvantage of cloud computing. Organizations may face
problems when transferring their services from one vendor to another. As different vendors
provide different platforms, that can cause difficulty moving from one cloud to another.
3) Limited Control
As we know, cloud infrastructure is completely owned, managed, and monitored by the
service provider, so the cloud users have less control over the function and execution of
services within a cloud infrastructure.
4) Security
Although cloud service providers implement the best security standards to store important
information. But, before adopting cloud technology, user should be aware that all data and
organization's sensitive information is sent to a third party, i.e., a cloud computing service
provider. While sending the data on the cloud, there may be a chance that organization's
information is hacked by Hackers.
Explain the benefits and drawbacks of a client-server and peer-to-peer network.
Peer-to-peer network
A network where there is not central computer, workstations known as peers or nodes are
equally participants in data sharing. They are equally privileged and equipped in the
application. Each peer (workstation or node) can act as a client and request a file from
another peer or it can act as a server when another peer requests the download of a file.
A peer-to-peer network operates with each peer (networked computer) storing some of the
files.
Characteristics of Peer to Peer Computing
The different characteristics of peer to peer networks are as follows −
• There is no central computer
• Computers in this network are known as
Peer or Node
• It is suitable for small networks like a
groups of a dozen or less computers.
• All peers can act as both client (request
a file or resource) and as servers
(provide file or resources)
• Peers store their data using individually
Advantages of Peer to Peer Computing
Some advantages of peer to peer computing are as follows −
• Each computer in the peer to peer network manages itself. So, the network is quite
easy to set up and maintain.
• It is easy to scale the peer to peer network and add more nodes. This only increases
the data sharing capacity of the system.
• None of the nodes in the peer to peer network are dependent on the others for their
functioning.
Disadvantages of Peer to Peer Computing
Some disadvantages of peer to peer computing are as follows −
• It is difficult to backup the data as it is stored in different computer systems and there is
no central server.
• It is difficult to provide overall security in the peer to peer network as each system is
independent and contains its own data.
Client-Server Model
Client Server Architecture is a computing model in which the server hosts, delivers and
manages most of the resources and services to be consumed by the client. This type of
architecture has one or more client computers connected to a central server over a network or
internet connection. This system shares computing resources. Client/server architecture is
also known as a networking computing model or client/server network because all the
requests and services are delivered over a network.
In modern days the client is a web browser connected to the Internet. The server is a web
server hosted on the Internet.
Advantages of Client-Server Model
– files and resources are centralised
– creation of security / manage security
– user needs user name and password to access network
– centralised back-up
– intranet capability
– Internet monitoring
– clients can be less powerful machines, therefore less expensive to buy
– saving resources on server reduces the burden on the client
The server provides an application and the client uses the application. There are two options
for how the client functions a thin-client and a thick-client
Thin Clients Thick Clients
a client that only provides input and a client that carries out at least some of
Definition
receives output from the application the processing itself
chooses an application to run on chooses an application provided by the
the server server
Sends input data to the server possibly carries out some processing
when requested by the application. before running the application on the
How they
server and also after receiving output
work
from the application
Receives output from the Alternatively, possibly downloads the
application application from the server and runs the
application itself.
• less expensive to expand (low • more robust (device can carry out
Pros powered and cheap devices can processing even when not connected
be used) to server)
• all devices are linked to a server • clients have more control (they can
(data updates and new software store their own programs and
installation done centrally) data/files)
• server can offer protection against
hacking and malware
• high reliance on the server; if the • less secure (relies on clients to keep
server goes down or there is a their own data secure)
break in the communication link • each client needs to update data and
Cons then the devices cannot work software individually
• despite cheaper hardware, the • data integrity issues, since many
start-up costs are generally higher clients access the same data which
than for thick clients can lead to inconsistencies
Software •always relies on a connection to a •can run some of the features of the
remote server or computer for it to software even when not connected to
work a server
•requires very few local resources •relies heavily on local resources
(such as SSD, RAM memory or •more tolerant of a slow network
computer processing time) connection
•relies on a good, stable and fast • can store data on local resources
network connection for it to work such as HDD or SSD
•data is stored on a remote server
or computer
Comparison of peer-to-peer network and client-server architecture
Peer-to-Peer Model Client-Server model
There is no central computer, all computers In this network some computers are servers
are equally participant in file and resource and others are clients
sharing Some computers are servers and others host,
deliver and manages most of the resources
There is one or more central computers work
as server
Peer or node is a computer in this model Servers are computers provides resources
A client is a computer that provides a user with
access to a network
Suitable for small networks suitable for large networks
Easy to setup and add or remove peers Difficult to setup and add or remove servers
or clients
Data is saved individually Data is saved centrally
No control on downloading and using files File downloading and access can be
controlled
Less secure Can be better protected
Parts of files can be downloaded from
different peers
Network Topologies
Describe the characteristics, benefits and drawbacks, of different network topologies.
Network Topology
Topology defines the structure of the network of how all the components are interconnected
to each other.
Bus Topology:
The bus topology is the simplest network arrangement. It has one cable that connects every
device on the network, which is called the backbone. At each end of the main cable there is a
small device called a terminator which absorbs the signals when they reach the end, to
prevent interference. Each device must be connected to the main cable to join the network.
Advantages Disadvantages
A relatively low number of cables are A collision of signals occur if more than one
needed so it is cheap to install device transmit data at the same time
Simple to add additional devices The possibility of collisions increases on
networks with high traffic
If the backbone cable breaks the whole
network will fail
Star Topology
In a star topology, each device is connected to a central device, either a switch or a hub,
which gives it a star formation.
The main difference between a hub and a switch is that a hub will send every signal to every
device on the network, while a switch will only send each signal to the intended recipient
device.
Routers
A router is a networking device that forwards data packets between computer networks.
Routers perform the traffic directing functions on the Internet. Data sent through the internet,
such as a web page or email, is in the form of data packets. A packet is typically forwarded
from one router to another router through the networks that constitute an internetwork (e.g.
the Internet) until it reaches its destination node.
A router is connected to two or more data lines from different IP networks. When a data
packet comes in on one of the lines, the router reads the network address information in the
packet header to determine the ultimate destination. Then, using information in its routing
table or routing policy, it directs the packet to the next network on its journey.
The role of the router is to forward data to the correct recipient.
Bridge
A network bridge is a computer networking device that creates a single, aggregate network
from multiple communication networks or network segments. This function is called network
bridging. Bridging is distinct from routing. Routing allows multiple networks to communicate
independently and yet remain separate, whereas bridging connects two separate networks as
if they were a single network
Gateway
A gateway, as the name suggests, is a passage to connect two networks together that may
work upon different networking models. They basically work as the messenger agents that
take data from one system, interpret it, and transfer it to another system. Gateways are also
called protocol converters and can operate at any network layer. Gateways are generally
more complex than switch or router.
Transmission media
There are two main cable technologies used for the transmission of data on a network:
copper and fiber-optic cables.
Copper cables
Copper cables are the most common type used
in Ethernet networks. Copper cables use
electrical signals to transmit information. There
are three types of copper cables:
• Coaxial: the same type as the cable used to connect TVs to aerials. It has one single
copper core wire.
• Unshielded twisted pair (UTP): up to eight copper wires are twisted around each
other in pairs and then all pairs are twisted around each other. The arrangement
reduces electrical interference. UTPs are the most common type of cables used in
Ethernet networks.
• Shielded twisted pair (STP): the same structure as the unshielded twisted pair cable.
However, a layer of shielding is added to further prevent interference.
Fibre-optic cables can preserve a good signal strength for up to 100km and are not affected
by electrical interference therefore, they exceed the performance of copper wires, although
they also can be very expensive.
Advantages of Fibre-optic
➢ fibre optic cables have greater bandwidth
➢ fibre optic cables need less signal boosting // can transmit over longer distances
➢ fibre optic cables have greater security (more difficult to “tap” into)
➢ fibre optic cables are immune to electromagnetic and other effects
➢ fibre optic cabling is lighter in weight (easier to install)
➢ fibre optic cables consume less power
Wi-Fi
Wi-Fi is the wireless technology used to connect computers, tablets, smartphones and
other devices to the internet.
Wi-Fi is the radio signal sent from a wireless router (WAP-Wireless Access Point) to a nearby
device, which translates the signal into data you can see and use. The device transmits a
radio signal back to the router, which connects to the internet by wire or cable.
What Are Collisions?
A network collision occurs when more than one device attempts to send a packet on a
network segment at the same time.
Ethernet uses CSMA/CD (Carrier Sense Multiple Access/Collision Detect) as its collision
detection method. Here is a simplified example of Ethernet operation:
1. Station A wishes to send a frame. First, it checks if the medium is available (Carrier
Sense). If it isn't, it waits until the current sender on the medium has finished.
2. Suppose Station A believes the medium is available and attempts to send a frame.
Because the medium is shared (Multiple Access), other senders might also attempt to
send at the same time. At this point, Station B tries to send a frame at the same time as
Station A.
3. Shortly after, Station A and Station B realize that there is another device attempting to
send a frame (Collision Detect). Each station waits for a random amount of time before
sending again. The time after the collision is divided into time slots; Station A and Station
B, each pick a random slot for attempting a retransmission.
4. Should Station A and Station B attempt to retransmit in the same slot, they extend the
number of slots. Each station then picks a new slot, thereby decreasing the probability of
retransmitting in the same slot.
Bit Streaming
Show understanding of bit streaming
Methods of bit streaming, i.e. real-time and on-demand
Importance of bit rates / broadband speed on bit streaming
1 mark for identifying that she is using both.1 mark per bullet point for justification
using internet because sending data on the infrastructure
using WWW because accessing a website (that is stored on a webserver operated by the webmail)
that is part of the WWW
Internet Hardware
Describe the hardware that is used to support the internet
Including modems, PSTN (Public Switched Telephone Network), dedicated lines, cell phone network
Following hardware are required to connect with internet
• Modem
• Router
• PSTN
• Dedicated Lines
• Cell phone network
Other requirements are
• ISP
• Web browser
Modem
A modem is a hardware device that changes the digital signal produced by the computer into
one that can be transmitted over the public telephone line, i.e. an analogue signal. A second
modem is required at the receiving device in order to convert the analogue signal back into a
digital signal, which can be then processed by the computer.
Routers
A router is a networking device that forwards data packets between computer networks.
Routers perform the traffic directing functions on the Internet. Data sent through the internet,
such as a web page or email, is in the form of data packets. A packet is typically forwarded
from one router to another router through the networks that constitute an internetwork (e.g.
the Internet) until it reaches its destination node.
A router is connected to two or more data lines from different IP networks. When a data
packet comes in on one of the lines, the router reads the network address information in the
packet header to determine the ultimate destination. Then, using information in its routing
table or routing policy, it directs the packet to the next network on its journey.
The role of the router is to forward data to the correct recipient.
Public Switch Telephone Network (PSTN)
The telephone network system, public switched telephone network (PSTN), is used to
connect computers/devices and LANs between towns and cities. Satellite technology is used
to connect to other countries.
PSTN (Circuit switching) uses a dedicated channel/circuit which lasts throughout the
connection: the communication line is effectively ‘tied up’.
Now telephone lines have changed from copper cables to fibre optic cables, which permits
greater bandwidth and faster data transfer rates (and less risk of data corruption from
interference). Fibre optic telephone networks are usually identified as ‘fast broadband’. High
speed broadband has allowed WLANs to be developed by using WAPs.
High speed communication links allow telephone and video calls to be made using a
computer and the internet. Telephone calls require either an internet-enabled telephone
connected to a computer (using a USB port) or external/internal microphone and speakers.
Video calls also require a webcam. When using the internet to make a phone call, the user’s
voice is converted to digital packages using Voice over Internet Protocol (VoIP). Data is split
into packages (packet switching) and sent over the network via the fastest route.
The number of networks and the number of hosts per class can be derived by this formula −
When calculating hosts' IP addresses, 2 IP addresses are decreased because they
cannot be assigned to hosts, i.e. the first IP of a network is network number and the last
IP is reserved for Broadcast IP.
Class A Address
The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 – 127,
i.e.
Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A
addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
Class A IP address format is thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B Address
An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e.
Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for Class
B is 255.255.x.x.
Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
Class B IP address format is: 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Class C Address
The first octet of Class C IP address has its first 3 bits set to 110, that is −
Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for
Class C is 255.255.255.x.
Class C gives 2097152 (221) Network addresses and 254 (28-2) Host addresses.
Class C IP address format is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
Class D Address
Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of
Class D has IP address range from 224.0.0.0 to 239.255.255.255. Class D is reserved for
Multicasting. In multicasting data is not destined for a particular host, that is why there is no
need to extract host address from the IP address, and Class D does not have any subnet
mask.
Class E Address
This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in
this class ranges from 240.0.0.0 to 255.255.255.254. Like Class D, this class too is not
equipped with any subnet mask.
Class IPv4 1st Octet Denary NetIDs Host IDs
A 1st octet starts with 0 0000 0000 – 0111 1111 0-127 8 24
B 1st octet starts with 10 1000 0000 – 1011 1111 128-191 16 16
C 1st octet starts with 110 1100 0000 – 1101 1111 192-223 24 8
D 1st octet starts with 1110 1110 0000 – 1110 1111 224-239 Multi cast
E 1st octet starts with 1111 1111 0000 – 1111 1111 240-255 E
Classless inter-domain routing (CIDR)
The first approach developed for improving the addressing scheme is called ‘classless inter-
domain routing’ (CIDR). This retains the concept of a netID and a hostID but removes the
rigid structure and allows the split between the netID and the hostID to be varied to buit
individual need. The simple method used to achieve this is to add an 8-bit suff ix to the
address that specifies the number of bits for the netID. If, for instance, we define the suff ix as
21, that means that 21 bits are used for the netID and there are 11 bits remaining (of a 32-bit
address) to specify hostIDs allowing 211 (i.e. 2048) hosts.
Sub-Net
By using sub-netting, one single IP address can be used to have smaller sub-networks which
provides better network management capabilities.
Sub-net Masking
A subnetwork or subnet is a logical subdivision of an IP network.[1]:1,16 The practice of
dividing a network into two or more networks is called sub-netting.
Computers that belong to a subnet are
addressed with an identical most-significant
bit-group in their IP addresses. This results
in the logical division of an IP address into
two fields: the network number or routing
prefix and the rest field or host identifier.
The rest field is an identifier for a specific host or network interface.
Public IP Addresses
Each LAN connected to the internet has a single public IP Address. This is the address seen
by other computers and networks on the Internet and is the address attached to packets sent
across the Internet.
Private IP Addresses
Computers within a LAN have their own private IP Address that is different to their Public IP
Address. This private IP Address is either:
o Issued by the Server / Router using Dynamic Host Configuration Protocol (DHCP)
o Set manually by the computer user themselves.
Range of private IP addresses
Lower bound Upper bound
10.0.0.0 10.255.255.255
172.16.0.0 172.31.255.255
192.168.0.0 192.168.255.255
Differences between public & private IP Address:
Private IP Address Public IP Address
Private address can only be reached Public address can be reached across the
internally/through the LAN/Intranet // private Internet.
address cannot be reached across the
Internet
NAT (Network Address Translation) is No need of NAT box
necessary for a private IP address to access
the Internet directly.
A private address is more secure than a A public address is less secure
public address
Private addresses are assigned by the router Public addresses are provided by ISP
or network administrator.
Private addresses (are unique within their Public addresses are unique (to the
network, but) can be duplicated within other Internet)
(discrete) networks.
10.0.0.1 to 10.255.255.254 and 172.16.0.1 to IP addresses from the private address
172.31.255.254 and 192.168.0.1.to space are never assigned as public
192.168.255.254 form the private address
space
There are 2 main types of Public IP Addresses: Static and Dynamic
Static IP Addresses
These are mainly used by:
o Businesses with LANs that need to be accessed externally from the internet
o Website Hosts
o Gamers who want the fastest, most reliable internet service
Static IP addresses stay the same, which mean that data is always sent in the most efficient
manner. However a static IP address opens your network up to attackers.
Dynamic IP addresses
Most home internet users are issued with a dynamic IP address when their router connects to
the internet and the IP address is renewed every month or so. Each time it is renewed a new
IP Address is drawn from the pool.
This sharing of IP addresses allows the internet to continue to function even when there are
more devices in the world than there are available IP addresses (4 billion different ip
addresses are available in total for IPV4 addresses). It is also potentially harder to hack as a
network’s IP address is constantly changing.
The limited number of addresses available on the internet using IPV4 led to the development
of IPV6, though this technology is still in the process of being rolled out…
IP Version 6
IPv6 is 128 Bit Address,
340,282,366,920,938,463,463,374,607,431,768,211,456 Addresses.
Probably enough for the foreseeable future.
Advantages
o Future proof – plenty of unique addresses for each device.
o Security built in to the profile
o Allows for QOS packet prioritising.
Disadvantages
o A bit more overhead in packet size
o Many legacy devices and systems still don’t fully support IPv6 so we still need IPv4 backup.
Compressing IPv6 Addresses
IP Version 6 addresses are incredibly long, which makes them difficult humans to read/write,
even when represented using hexadecimal. Fortunately IP Version 6 Addresses can be
Shortened (Compressed). Take a look at the video to see how this can be done.
Today there are combinations of 1Pv4 approaches in use and these allow the Internet to
continue to function. Respected sources argue that this cannot continue beyond the current
decade. There must soon be a migration to IP version 6 (1Pv6), which uses a 128-
bitaddressing scheme allowing 2128 different addresses, a huge number! In practice, this will
allow more complex structuring of addresses. Documenting these addresses is not going to
be fun. The addresses are written in a colon hexadecimal notation. The code is broken
into16-bit parts with each of these represented by four hexadecimal characters. Fortunately,
some abbreviations are allowed.
1Pv6 address Comment
68E6:7C48:FFFE:FFFF:3D20:1180:695A:FF01 A full address
72E6:0000:0000:CFFE:3D20:1180:295A:FF01
:0000:0000: has been replaced by::
72E6::CFFE:3D20:1180:295A:FF01
6C48:0023:FFFE:FFFF:3D20:1180:095A:FF01
Leading zeros omitted
6C48:23:FFFE:FFFF:3D20:1180:95A:FF01
192.31.20.46
An 1Pv4 address used in1Pv6
::192.31.20.46
NAT
Network Address Translation (NAT) is designed for IP address conservation. It enables
private IP networks that use unregistered IP addresses to connect to the Internet. NAT
usually connecting two networks together, and translates the private (not globally unique)
addresses in the internal network into legal addresses, before packets are forwarded to
another network.
As part of this capability, NAT can be configured to advertise only one address for the entire
network to the outside world. This provides additional security by effectively hiding the entire
internal network behind that address. NAT offers the dual functions of security and address
conservation and is typically implemented in remote-access environments.
URL encoding:
Web addresses can be written using hexadecimal rather than denary. Hexadecimal codes are
preceded by a % sign. For example, the word “www.ruknuddin.com” is written as:
r u k n u d d i n
in hex %72 %75 %6B %6E %75 %64 %64 %69 %6E
w w w . r u k n u d d i n . c o m
%77 %77 %77 %2E %72 %75 %6B %6E %75 %64 %64 %69 %6E %2E %63 %6F %6D
Some characters are not allowed in URL. URL encoding converts characters into a format that can be
transmitted over the Internet.
For example
➢ %20 – is used in URL in place of <space> not allowed in a URL, %20 is the coding for a space (32
in denary)
➢ ? – separates the URL from all parameters or variables
e.g. for query to search Inqilabpatel in Google
https://www.google.com.pk/search?q=inqilab%20patel
here “q” is variable for query “?” separates it from URL
“https://www.google.com.pk/search”
HYPERTEXT MARK-UP LANGUAGE (HTML) is used when writing and developing web pages.
HTML isn’t a programming language but is simply a mark-up language. A mark-up language is used in
the processing, definition and presentation of text (for example, specifying the colour of the text).
HTML uses <tags> which are used to bracket a piece of code;
Example Question 2.4:
DNS Server
3. DNS looks up IP address to browser
User
Web Server 5. Web Server HTTP response in the form of html data
Example Question2.5:
(a) A web page offers a link for users to request another web page. The requested web page contains
HTML code.
Put each statement in the correct sequence by writing the numbers 1 to 5 in the right-hand column.
Statement Sequence
No
The requested web page is displayed on the client computer
The user clicks on the hyperlink and the web page is requested from the
web server
The requested web page content is transmitted to the client computer
The client computer processes the html code using the web browser
software
The web server locates the requested web page
0 9618/1 Specimen paper Q2 - SoW
2 Yvette runs a company that books walking holidays for groups of people. She has a website that
customers use to book the holidays.
(a) The website has a URL and an IPv6 address. Describe, using an example, the format of an IPv6
address.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.............................................................................................................................................................. [4]
(b) An IP address can be static or dynamic. Describe static and dynamic IP addresses.
Static .........................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
..................................................................................................................................................................
Dynamic ……………......................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................................................................................. [4]
(c) Yvette’s company has a LAN (Local Area Network) that has hybrid topology.
(i) Describe the characteristics of a LAN.
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................................................................................... [2]
(ii) The LAN has a range of different topologies. One subnetwork connects four computers and one
server set up as a star topology.
Describe how packets are transmitted between two of the computers in this subnetwork.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.......................................................................................................................................................... [3]
(d) The LAN has both wired and wireless connections.
(i) Ethernet cables connect the computers to the server.
Identify three other hardware components that might be used to set up the LAN.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
...................................................................................................................................... [3]
(ii) Describe how Carrier Sense Multiple Access/Collision Detection (CSMA/CD) manages collisions
during data transmission.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
......................................................................................................................................................... [3]
0 9618/1 Specimen paper Q2 - SoW
1b 9618 S21 P12
5 (c) Seth accesses both software and data using cloud computing.
(i) Give two benefits of storing data using cloud computing.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
(ii) Give two drawbacks of Seth using cloud computing.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
5 (d) Draw one line from each term to its most appropriate description. [4]
Term Description
It is only visible to devices within the
Local Area Network (LAN)
(b) There are four statements in the following table. For each statement, place a tick (✓) in
the appropriate column to indicate whether it is true or false. [4]
Statement True False
The server can send packets to Computer B and Computer C at the same
time.
The network software on each computer needs to include collision detection
and avoidance.
Computer B can read a packet sent from the server to Computer C.
Computer A can send a packet to Computer B and at the same time the
server can be sending a packet to Computer C.
(c) The LAN shown in part (a) will be connected to the Internet.
(i) A router will be attached to one of the devices on the LAN.
State the device used. Give a reason for your choice.
Device ........................................................................................................................................
Reason ......................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [2]
(ii) Explain why a router is required.
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [2]
6a 9608/31 Nov 17 Q1 – SoW
6b 9608/32 Nov 17 Q1 - SoW
1 A Local Area Network (LAN) consists of three computers, one server and a router
connected to the Internet. The LAN uses a bus topology.
(a) Complete the following diagram to show how the computers, the server and the router
could be connected.
[2]
(b) There are four statements in the following table. For each statement, place a tick (3) in the
appropriate column to indicate whether it is true or false.
[4]
Statement True False
The server can send packets to Computer B and the router at the same time.
Computer C uses the IP address of a web server to send a request for a web page
on the web server.
Computer B can read a packet sent from Computer A to Computer C.
The server can read all incoming packets from the Internet.
(c) The user on Computer A and the user on Computer B are both using the Internet at the
same time. On a few occasions, Computer A and Computer B start transmitting packets to the
router at exactly the same time. This causes a problem called a collision.
(i) Explain what is meant by a collision in this context.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
..................................................................................................................................................[2
]
(ii) As a result of the collision, both Computer A and Computer B stop transmitting.
Computer A must carry out a number of steps to ensure the successful transmission of its
packet.
Give two of the steps.
Step 1 ................................................................................................................................
Step 2 ................................................................................................................................ [2]
(d) The LAN topology is redesigned.
(i) Describe the changes that could be made to the LAN topology to overcome the problem
identified in part (c).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(ii) Explain how the redesign has overcome the problem.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
6b 9608/32 Nov 17 Q1 - SoW
7a 9608/31 Jun 18 Q3a - SoW
3 Star and bus are two types of topology that can be used in a Local Area Network (LAN)
(a) (i) State one benefit and one drawback of the star topology.
Benefit .....................................................................................................................................................
.................................................................................................................................................................
Drawback ................................................................................................................................................
...........................................................................................................................................................[2]
(ii) State one benefit and one drawback of the bus topology.
Benefit .....................................................................................................................................................
.................................................................................................................................................................
Drawback ................................................................................................................................................
...........................................................................................................................................................[2]
7a 9608/31 Jun 18 Q3a - SoW
3a 9608 Summer 16 Paper 31-32-33 – SoW
1 A Local Area Network (LAN) consists of four computers and one server. The LAN uses a bus
topology.
(a) Complete the diagram below to show how the computers and the File server could be connected.
[2]
(c) Computer A starts transmitting a packet to Computer C. At exactly the same time, the Fileserver
starts transmitting a packet to Computer D. This causes a problem.
(i) State the name given to this problem.
...........................................................................................................................................
....................................................................................................................................... [1]
(ii) Give three steps taken by both Computer A and the File server to allow them to transmit their
packets successfully.
Step 1 ................................................................................................................................
...........................................................................................................................................
Step 2 ................................................................................................................................
...........................................................................................................................................
Step 3 ................................................................................................................................
....................................................................................................................................... [3]
(d) Adding a switch to the LAN changes its topology. Explain how the use of a switch removes the
problem identified in part (c)(i).
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
................................................................................................................................................. [4]
Unit 3 Hardware
Topic You should be able to R A G
• Understand the need for and the operation of input, output and
storage devices including embedded systems
Hardware
• Understand and use logic gates with a maximum of two inputs
• Construct logic circuits, truth tables and logic expressions
System
A system is an arrangement in which all its unit assemble work together according to a set of rules and
all its subcomponents depend on each other.
Embedded System
As its name suggests, Embedded means something that is attached to
another thing.
In an embedded system, microprocessor is installed in different devices so as they can be programmed.
Smart phones, tablet and computers are used to set values in these devices and to control them.
Embedded system may or may not be connected with internet.
The Internet of things (IoT) describes the network of physical
objects—“things”—that are embedded with sensors, software,
and other technologies for the purpose of connecting and
exchanging data with other devices and systems over
the Internet.
Memory cache – high speed memory external to processor
which stores data which the processor will need again.
Random access memory (RAM) – primary memory unit that can be written to and read from.
Read-only memory (ROM) – primary memory unit that can only be read from.
Dynamic RAM (DRAM) – type of RAM chip that needs to be constantly refreshed.
Static RAM (SRAM) – type of RAM chip that uses flip-flops and does not need refreshing.
Refreshed – requirement to charge a component to retain its electronic state.
Programmable ROM (PROM) – type of ROM chip that can be programmed once.
Erasable PROM (EPROM) – type of ROM that can be programmed more than once using ultraviolet
(UV) light.
Hard disk drive (HDD) – type of magnetic storage device that uses spinning disks.
Latency – the lag in a system; for example, the time to find a track on a hard disk, which depends on
the time taken for the disk to rotate around to its read-write head.
Fragmented – storage of data in non-consecutive sectors; for example, due to editing and deletion of
old data.
Removable hard disk drive – portable hard disk drive that is external to the computer; it can be
connected via a USB part when required; often used as a device to back up files and data.
Solid state drive (SSD) – storage media with no moving parts that relies on movement of electrons.
Electronically erasable programmable read-only memory (EEPROM) – read-only (ROM) chip that can
be modified by the user, which can then be erased and written to repeatedly using pulsed voltages.
Flash memory – a type of EEPROM, particularly suited to use in drives such as SSDs, memory cards
and memory sticks.
Optical storage – CDs, DVDs and Blu-rayTM discs that use laser light to read and write data.
Dual layering – used in DVDs; uses two recording layers.
Birefringence – a reading problem with DVDs caused by refraction of laser light into two
beams.
Binder 3D printing – 3D printing method that uses a two-stage pass; the first stage uses dry powder
and the second stage uses a binding agent.
Direct 3D printing – 3D printing technique where print head moves in the x, y and z
directions. Layers of melted material are built up using nozzles like an inkjet printer.
Digital to analogue converter (DAC) – needed to convert digital data into electric currents that can
drive motors, actuators and relays, for example.
Analogue to digital converter (ADC) – needed to convert analogue data (read from sensors, for
example) into a form understood by a computer.
Organic LED (OLED) – uses movement of electrons between cathode and anode to produce an on-
screen image. It generates its own light so no back lighting required.
Screen resolution – number of pixels in the horizontal and vertical directions on a
television/computer screen.
Touch screen – screen on which the touch of a finger or stylus allows selection or manipulation of a
screen image; they usually use capacitive or resistive technology.
Capacitive – type of touch screen technology based on glass layers forming a capacitor, where fingers
touching the screen cause a change in the electric field.
Resistive – type of touch screen technology. When a finger touches the screen, the glass layer
touches the plastic layer, completing the circuit and causing a current to flow at that point.
Virtual reality headset – apparatus worn on the head that covers the eyes like a pair of goggles. It
gives the user the ‘feeling of being there’ by immersing them totally in the virtual reality experience.
Sensor – input device that reads physical data from its surroundings
Key terms
Memory cache – high speed memory external to processor which stores data which the processor will
need again.
Random access memory (RAM) – primary memory unit that can be written to and read from.
Read-only memory (ROM) – primary memory unit that can only be read from.
Dynamic RAM (DRAM) – type of RAM chip that needs to be constantly refreshed.
Static RAM (SRAM) – type of RAM chip that uses flip-flops and does not need refreshing.
Refreshed – requirement to charge a component to retain its electronic state.
Programmable ROM (PROM) – type of ROM chip that can be programmed once.
Erasable PROM (EPROM) – type of ROM that can be programmed more than once using ultraviolet
(UV) light.
Hard disk drive (HDD) – type of magnetic storage device that uses spinning disks.
Latency – the lag in a system; for example, the time to find a track on a hard disk, which depends on
the time taken for the disk to rotate around to its read-write head.
Fragmented – storage of data in non-consecutive sectors; for example, due to editing and deletion of
old data.
Removable hard disk drive – portable hard disk drive that is external to the computer; it can be
connected via a USB part when required; often used as a device to back up files and data.
Solid state drive (SSD) – storage media with no moving parts that relies on movement of electrons.
Electronically erasable programmable read-only memory (EEPROM) – read-only (ROM) chip that can
be modified by the user, which can then be erased and written to repeatedly using pulsed voltages.
Flash memory – a type of EEPROM, particularly suited to use in drives such as SSDs, memory cards
and memory sticks.
Optical storage – CDs, DVDs and Blu-rayTM discs that use laser light to read and write data.
Dual layering – used in DVDs; uses two recording layers.
Birefringence – a reading problem with DVDs caused by refraction of laser light into two beams.
Binder 3D printing – 3D printing method that uses a two-stage pass; the first stage uses dry powder
and the second stage uses a binding agent.
Direct 3D printing – 3D printing technique where print head moves in the x, y and z directions. Layers
of melted material are built up using nozzles like an inkjet printer.
Digital to analogue converter (DAC) – needed to convert digital data into electric current.
Analogue to digital converter (ADC) – needed to convert analogue data (read from sensors, for
example) into a form understood by a computer.
Organic LED (OLED) – uses movement of electrons between cathode and anode to produce an on-
screen image. It generates its own light so no back lighting required.
Screen resolution – number of pixels in the horizontal and vertical directions on a
television/computer screen.
Touch screen – screen on which the touch of a finger or stylus allows selection or manipulation of a
screen image; they usually use capacitive or resistive technology.
Capacitive – type of touch screen technology based on glass layers forming a capacitor, where fingers
touching the screen cause a change in the electric field.
Resistive – type of touch screen technology. When a finger touches the screen, the glass layer
touches the plastic layer, completing the circuit and causing a current to flow at that point.
Virtual reality headset – apparatus worn on the head that covers the eyes like a pair of goggles. It
gives the user the ‘feeling of being there’ by immersing them totally in the virtual reality experience.
Sensor – input device that reads physical data from its surroundings.
A B
(ii) The following table shows some assembly language instructions for a processor which
has one general purpose register, the Accumulator (ACC).
Instruction
Op Explanation
Operand
code
AND #n Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>
XOR #n Bitwise XOR operation of the contents of ACC with the operand
Bitwise XOR operation of the contents of ACC with the contents of
XOR <address>
<address>
OR #n Bitwise OR operation of the contents of ACC with the operand
OR <address> Bitwise OR operation of the contents of ACC with the contents of <address>
Bits in ACC are shifted logically n places to the left. Zeros are introduced on
LSL #n
the right hand end
Bits in ACC are shifted logically n places to the right. Zeros are introduced
LSR #n
on the left hand end.
At the end of each day, the register is reset to 0. Write the assembly language statement to
reset the register to 0.
.....................................................................................................................................................
.......................................................................................................................................... [2]
(iii) A two-place logical shift to the left is performed on the binary number shown in part (d).
Show the result of this logical shift. [1]
(iv) State the mathematical result of a one-place logical shift to the right on a binary
number.
.....................................................................................................................................................
............................................................................................................................ [1]
(e) The factory servers run software that makes use of Artificial Intelligence (AI).
Explain how the use of AI can help improve the safety and efficiency of the factory.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [3]
5 (a) Draw a logic circuit diagram for the logic expression:
X = NOT (A OR B OR C) OR (B AND C AND D) [4]
(b) Complete the truth table for the logic expression: [4]
X = (A XOR B) OR NOT (A OR B OR C)
Working
A B C X
space
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
1b 9618 S21 P12
3 A logic expression is given:
S = (A AND B AND C) OR (B XOR C)
(a) Draw the logic circuit for the given expression. [4]
(b) Complete the truth table for the logic expression: [2]
S = (A AND B AND C) OR (B XOR C)
A B C Working space S
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
3a 9608/31 Jun 16 Q6 – SoW
6 An intruder detection system for a large house has four sensors. An 8-bit memory location
stores the output from each sensor in its own bit position. The bit value for each sensor
shows:
• 1 – the sensor has been triggered
• 0 – the sensor has not been triggered
The bit positions are used as follows:
(a) (i) State the name of the type of system to which intruder detection systems belong.
....................................................................................................................................... [1]
(ii) Justify your answer to part (i).
.....................................................................................................................................................
............................................................................................................................. [1]
(b) Name two sensors that could be used in this intruder detection system. Give a reason for
your choice.
Sensor 1 ...................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Sensor 2 ...................................................................................................................................
Reason .....................................................................................................................................
...............................................................................................................................................[4]
The intruder system is set up so that the alarm will only sound if two or more sensors have
been triggered. An assembly language program has been written to process the contents of
the memory location. The table shows part of the instruction set for the processor used.
Instruction
Explanation
Op code Operand
LDD <address> Direct addressing. Load the contents of the given address to ACC
STO <address> Store the contents of ACC at the given address
INC <register> Add 1 to the contents of the register (ACC or IX)
ADD <address> Add the contents of the given address to the contents of ACC
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>
CMP #n Compare the contents of ACC with the number n
JMP <address> Jump to the given address
Following a compare instruction, jump to <address> if the compare
JPE <address>
was True
Following a compare instruction, jump to <address> if the content of
JGT <address>
ACC is greater than the number used in the compare instruction
END End the program and return to the operating system
(c) Part of the assembly code is:
Op code Operand
SENSORS: B00001010
COUNT: 0
VALUE: 1
LOOP: LDD SENSORS
AND VALUE
CMP #0
JPE ZERO
LDD COUNT
INC ACC
STO COUNT
ZERO: LDD VALUE
CMP #8
JPE EXIT
ADD VALUE
STO VALUE
JMP LOOP
EXIT: LDD COUNT
TEST: CMP …
JGT ALARM
(i) Dry run the assembly language code. Start at LOOP and finish when EXIT is reached.[4]
BITREG COUNT VALUE ACC
B00001010 0 1
(ii) The operand for the instruction labeled TEST is missing. State the missing operand.
....................................................................................................................................... [1]
(iii) The intruder detection system is improved and now has eight sensors.
One instruction in the assembly language code will need to be amended.
Identify this instruction .......................................................................................................
Write the amended instruction ...................................................................................... [2]
5a 9608/12 Jun 17 Q2 – SoW
2 (a) The first column of the following table gives features of different types of printer.
Put a tick (3) in the cells to show which features describe a laser and an inkjet printer. [2]
Type of printer
Laser Inkjet
Impact printer
Non-impact printer
Line printer
Page printer
(b) Two of the components of an inkjet printer are a stepper motor and a print head.(c) A
student has an old working laptop computer. It has a small capacity internal disk drive with
almost all the storage space taken up by the operating system and application programs. She
needs to buy an external storage device to store her data files.
(i) List two suitable devices.
Device 1 ............................................................................................................................
Device 2 ............................................................................................................................[2]
(ii) Describe one advantage of choosing one of the devices.
Advantage of choosing device 1 / 2 (circle)
...........................................................................................................................................
.......................................................................................................................................[1]
Describe how each component is used when printing a page.
(i) Print head ..........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
(ii) Stepper motor
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...............................................................................................................................................[2]
5c 9608/13 Jun 17 Q2- SoW
2(a) (i) The following sequence of steps (1 to 7) describe how a single page is printed on a
laser printer.
The statements A, B, C and D are used to complete the sequence.
The paper passes through a fuser, which heats up the paper. The toner melts and
A
forms a permanent image on the paper.
B The electrical charge is removed from the drum and the excess toner is collected.
C The image is converted on the drum into an electrostatic charge.
The oppositely-charged paper picks up the toner particles from the drum. After
D
picking up the toner, the paper is discharged to stop it clinging to the drum.
Complete the sequence by writing one of the letters A, B, C or D on the appropriate row.
1. A laser beam and a rotating mirror are used to draw an image of the page on the
photosensitive drum.
2. .........................
3. Electrostatic charge attracts toner.
4. The charged paper is rolled against the drum.
5. .........................
6. .........................
7. ......................... [3]
(ii) A computer user has a laser printer to print letters and documents. The user also prints
digital photographs taken using a digital camera.
State the most suitable type of printer for printing the photographs.
.......................................................................................................................................[1]
(b) The user is considering the purchase of a new laptop computer. She has read many
product reviews and knows that there are different types of internal secondary storage
available.
List two options for internal secondary storage.
Option 1 ....................................................................................................................................
Option 2 ....................................................................................................................................
Describe one advantage of one of the options.
Advantage of choosing option 1 / 2 (circle)
...................................................................................................................................................
...............................................................................................................................................[3]
6a 9608/11 Nov 17 Q5 - SoW
5 A Personal Computer (PC) has a number of input and output devices.
(a) (i) Name three components of a speaker.
1 .................................................................................................................................................
2 .................................................................................................................................................
3 ............................................................................................................................................ [3]
(ii) Explain the basic internal operation of a speaker.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................................................................................. [4]
(b) (i) The user is considering the purchase of a removable device for secondary storage.
Name one suitable device.................................................................................................................. [1]
(ii) Describe two possible uses for this device on a home Personal Computer (PC).
1 ................................................................................................................................................................
..................................................................................................................................................................
2 ................................................................................................................................................................
............................................................................................................................................................. [2]
6b 9608/12 Nov 17 Q6 - SoW
6 (a) A personal computer (PC) is extensively used for a wide range of applications, including
the three shown in the following table. Write in the table, a suitable input device, output
device, or both needed for each application.
Do not give a monitor, keyboard or mouse in your answers. [3]
Input Output
Application
device device
Capture the text from a paper document, in order that the text can be
word processed
Producing a replica of a small plastic component from a washing machine
A museum has interactive information facilities throughout the building
(b) Explain the basic internal operation of a hard disk drive.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................[4]
7a 9608 S18 P11
4 (a) An alarm system (X) is enabled and disabled using either a switch (A) or a remote
control (B). There are two infra-red sensors (C, D) and one door pressure sensor (E).
Parameter Description ofparameter Binary value Condition
1 Switch enabled
A Switch
0 Switch disabled
1 Remote enabled
B Remote control
0 Remote disabled
1 Activated
C Infra-red sensor
0 Not activated
1 Activated
D Infra-red sensor
0 Not activated
Door pressure 1 Activated
E
sensor 0 Not activated
The alarm sounds (X = 1) if the alarm is enabled and any one or more of the sensors is
activated. Draw a logic circuit to represent the alarm system. [3]
(b) Complete the truth table for the logic expression: X = A OR (B XOR C) [4]
A B C Working space X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
7 A student plays computer games on a games console.
(a) Identify two input devices and one output device used in a games console.
Input device 1 ...........................................................................................................................
Input device 2 ...........................................................................................................................
Output device .........................................................................................................................[3]
(b) The games console has random access memory (RAM) and read only memory (ROM).
(i) State two differences between RAM and ROM.
Difference 1 .......................................................................................................................
...........................................................................................................................................
Difference 2 .......................................................................................................................
........................................................................................................................................... [2]
(b) Complete the truth table for the logic expression: X = NOT A AND (B NAND C) [4]
A B C Working space X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
8a 9608/11 Nov 18 Q1a - SoW
1 A student is creating a short video and needs to record music to play in the background.
(a) The student uses a microphone to capture the music.
Explain how the microphone captures the music.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...............................................................................................................................................[3]
5a 9608/31 Jun 17 Q3a, b, 6 - SoW
3 Consider the following logic circuit, which contains a redundant logic gate.
(a) Write the Boolean algebraic expression corresponding to this logic circuit.
X = ........................................................................................................................................[3]
(b) Complete the truth table for this logic circuit. [2]
A B C Working space X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
6 A computer system is used to manage some of the functions in a vehicle. The vehicle has a
number of sensors and actuators. One sensor is used to monitor the moisture on the screen.
If the moisture exceeds a pre-set value, the windscreen wiper motor turns on automatically.
The software used in the computer system is dedicated to the sensor management functions.
When the system starts, the software runs some initial tasks. It then loops continuously until
the system is switched off.
(a) (i) State the name given to the type of system described.
....................................................................................................................................... [1]
(ii) Explain your answer to part (i).
.....................................................................................................................................................
............................................................................................................................. [1]
(b) Within the software loop, the value of each sensor is read in turn. The value read from the
sensor is then processed.
State two drawbacks with this method of reading and processing sensor data.
Drawback 1 ...............................................................................................................................
...................................................................................................................................................
Drawback 2 ...............................................................................................................................
..............................................................................................................................................[2]
(c) An alternative method of reading and processing sensor data is to use interrupts. Each
sensor is connected so that it can send an interrupt signal to the processor if its value
changes. On receipt of an interrupt signal, the processor carries out a number of steps as
shown in the following diagram.
(i) State the purpose of step 1.
…………………............................................................................................................................
.....................................................................................................................................................
............................................................................................................................................ [1]
(ii) State the purpose of step 6.
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [1]
(iii) Explain how the current task is saved in step 2.
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [2]
(iv) State two benefits of using interrupts to read and process the sensor data.
Benefit 1 ....................................................................................................................................
..................................................................................................................................................
Benefit 2 ...................................................................................................................................
........................................................................................................................................... [2]
(v) The interrupt handler in step 3 has to test each bit of a 16-bit register to discover the
source of the interrupt.
The contents of the 16-bit register are loaded into the 16-bit accumulator:
(a) Write the Boolean algebraic expression corresponding to this logic circuit:
S = ........................................................................................................................................[4]
(b) Complete the truth table for this logic circuit: [2]
Working space
P Q R S
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
6 A large office building has many floors. On each floor there are security sensors and
security cameras. There is the same number of sensors on each floor. The building has a
single security room. The images from the security cameras are output on monitors (one
monitor for each floor) placed in the security room.
The data from the sensors are read and processed by a computer system. Sensor readings
and warning messages can be displayed on the monitors.
(a) (i) State the name given to the type of system described.
.......................................................................................................................................[1]
(ii) Explain your answer to part (i).
.....................................................................................................................................................
..............................................................................................................................................[1]
(iii) State two sensors that could be used in this system.
Sensor 1 ............................................................................................................................
Sensor 2 ............................................................................................................................ [2]
(b) A software routine:
• checks the readings from the sensors
• outputs readings and warning messages to the monitors
• loops continuously.
The routine uses the following pseudocode variables:
Identifier Data type Description
FloorCounter INTEGER Loop counter for number of floors
SensorCounter INTEGER Loop counter for number of sensors
NumberOfFloors INTEGER Stores the number of floors
NumberOfSensors INTEGER Stores the number of sensors
ForEver BOOLEAN Stores value that ensures continuous loop
(i) Complete the following pseudocode algorithm for the routine.
01 ForEver ...............................................................................................................
02 REPEAT
03 FOR FloorCounter1 TO NumberOfFloors
04 FOR SensorCounter 1 TO
......................................................................
05 READ Sensor(SensorCounter)on Floor(FloorCounter)
06 IF Sensor value outside range
07 THEN
08 OUTPUT “Problem on Floor ”, FloorCounter
09 ENDIF
10 ENDFOR
11 ENDFOR
12 //
13 // Delay loop
14 // Delay loop
15 //
16 UNTIL
.........................................................................................................................[3]
(ii) A delay needs to be introduced before the loop is processed again.
Write a FOR loop, in pseudocode, to replace lines 13 and 14.
...........................................................................................................................................
.......................................................................................................................................[1]
(iii) Give a reason for this delay in the system.
...........................................................................................................................................
.......................................................................................................................................[1]
(c) An alternative method of reading and processing sensor data is to use interrupts. Each
sensor is connected so that it can send an interrupt signal to the processor if its value
changes.
On receipt of an interrupt signal, the processor carries out a number of steps as shown in the
following diagram.
(ii) Explain why the operand of the instruction labelled Q1 has the value 32.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [2]
(iii) The code beginning at the instruction labelled HEATON must make the system turn on
the heaters in those areas that are below the minimum temperature.
Describe what this code will have to do.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
................................................................................................................................................ [3]
6b 9608/32 Nov 17 -Q6 – SoW
6 The environment in a very large greenhouse is managed by a computer system. The
system uses a number of different sensors that include temperature sensors. In addition, the
system controls a number of heaters, windows and sprinklers.
(a) State one other type of sensor that could be used with this system.
Justify your choice.
Sensor ......................................................................................................................................
Justification ...............................................................................................................................
..............................................................................................................................................[2]
(b) Describe why feedback is important in this system.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...............................................................................................................................................[3]
(c) (i) The system makes use of a number of parameters. These parameters are used in the
code that runs the system.
State one of the parameters used in controlling the temperature in the greenhouse.
.......................................................................................................................................[1]
(ii) Explain how the parameter identified in part (c)(i) is used in the feedback process.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................[2]
(d) There are eight temperature sensors numbered 1 to 8. Readings from these sensors are
stored in four 16-bit memory locations. The memory locations have addresses from 4000 to
4003. Each memory location stores two sensor readings as two unsigned binary integers.
Sensor 1 reading is stored in bits 8 to 15 of address 4000; Sensor 2 reading is stored in bits 0
to 7 of address 4000 and so on. The diagram shows that the current sensor 1 reading has a
value of 97.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
4000 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 1
4001 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0
4002 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1
4003 1 0 0 0 0 0 1 0 1 1 0 0 0 1 0 1
(i) Give the denary value of the current reading for Sensor 5.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) The following table shows part of the instruction set for a processor. The processor has
one general purpose register, the Accumulator (ACC).
Instruction
Explanation
Op code Operand
Direct addressing. Load the contents of the location at the given
LDD <address>
address to ACC.
AND #n Bitwise AND operation of the contents of ACC with the operand.
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>.
XOR #n Bitwise XOR operation of the contents of ACC with the operand.
Bitwise XOR operation of the contents of ACC with the contents of
XOR <address>
<address>.
OR #n Bitwise OR operation of the contents of ACC with the operand.
Bitwise OR operation of the contents of ACC with the contents of
<address>.
OR <address>
LDD ............................ // load the contents of the 16-bit location containing the
value for Sensor 5 into the Accumulator
.................................... // move the bits in the Accumulator so that the
Accumulator stores the value of Sensor 5 as an
unsigned 16-bit binary integer [3]
7a 9608 P31 Q7
Q 7 A museum stores antique items that need to be kept at constant temperature.
The museum is not sure about the actual temperatures. The museum installs some
equipment. This records the temperatures every hour and ensures the temperature stays
within a set range.
(a) Identify the type of system described.
...............................................................................................................................................[1]
(b) The system has a temperature sensor. Identify two other items of hardware that the
museum can use for the type of system identified. Describe the purpose of each item.
Item 1 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Purpose ....................................................................................................................................
...............................................................................................................................................[4]
(c) The equipment records the temperature in all seven rooms in the museum.
Each recording is stored as two successive bytes in memory. The format is as shown.
Temperature Room
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The room is indicated by the setting of one of the bits in Byte 2 to 1. For example, room 7 is
indicated by setting bit 7 to 1. Bit 0 of Byte 2 is a flag:
• The flag’s initial value is zero.
• When the reading has been processed, the flag’s value is set to 1.
Byte 1 contains the temperature reading as an unsigned integer.
One reading returns the following binary data.
Temperature Room
7 6 5 4 3 2 1 0
1 0 1 1 0 0 1 1 0 0 1 0 0 0 0 1
Byte 1 Byte 2
(i) Analyse the data contained in the two bytes.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
......................................................[3]
(ii) The system receives a temperature reading of 238 from room number 4. [2]
Complete the bytes to show the two bytes for this recording. The reading has not yet been
processed.
7 6 5 4 3 2 1 0
Byte 1 Byte 2
7b 9608 S18 P32
6 (a) There are five scenarios on the left and two types of system on the right.
Draw a line to link each scenario to its correct type of system. [2]
Scenario System
Car speed display
Rollercoaster
Byte 1 Byte 2
The fish tank number is indicated by setting one of the bits in Byte 1 to 1. For example, fish
tank number 5 is indicated by setting bit 5 to 1.
Bit 7 of Byte 1 is a flag:
• the flag’s initial value is zero
• when the reading has been processed, the flag’s value is set to 1
Bit 0 of Byte 1 is unused.
Byte 2 contains the temperature reading as a two’s complement integer.
(i) After a temperature reading has been taken, the bytes contain the following data.
7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1
Byte 1 Byte 2
Analyse the data contained in the two bytes.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................[3]
(ii) The system receives a temperature reading of -2 from fish tank number 4.
Complete the bytes to show the values for this reading after it has been processed. [2]
7 6 5 4 3 2 1 0
Byte 1 Byte 2
(d) A hardware device to affect the temperature of each tank is on or off depending on the
value of a bit in memory location 6753.
If bit 4 is 1, then the hardware device in fish tank 4 is on.
Write assembly language instructions to set bit 4 of memory location 6753 to 1 without
changing any other bits. Use the instruction set provided.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
....................................................................[3]
Marking Schemes
3a 9608/31 Jun 16 Q6 – SoW
0 9618/1 Specimen paper Q4, 5 - SoW
5b 9608/32 Jun 17 Q3a, b, Q6a - SoW
5a 9608/11 Jun 17 Q2 – SoW
5c 9608/13 Jun 17 Q2- SoW
5b 9608/12 Jun 17 Q2 - SoW
6a 9608/11 Nov 17 Q5 - SoW
6b 9608/12 Nov 17 Q6 - SoW
7a 9608 S18 P11
Key terms
Von Neumann architecture – computer architecture which introduced the concept of the stored
program in the 1940s.
Arithmetic logic unit (ALU) – component in the processor which carries out all arithmetic and logical
operations.
Control unit – ensures synchronisation of data flow and programs throughout the computer by
sending out control signals along the control bus.
System clock – produces timing signals on the control bus to ensure synchronisation takes place.
Immediate access store (IAS) – holds all data and programs needed to be accessed by the control
unit.
Accumulator – temporary general purpose register which stores numerical values at any part of a
given operation.
Register – temporary component in the processor which can be general or specific in its use that
holds data or instructions as part of the fetch-execute cycle.
Status register – used when an instruction requires some form of arithmetic or logical processing.
Flag – indicates the status of a bit in the status register, for example, N = 1 indicates the result of an
addition gives a negative value.
Address bus – carries the addresses throughout the computer system.
Data bus – allows data to be carried from processor to memory (and vice versa) or to and from
input/output devices.
Control bus – carries signals from control unit to all other computer components. Unidirectional –
used to describe a bus in which bits can travel in one direction only. Bidirectional – used to describe a
bus in which bits can travel in both directions.
Clock cycle – clock speeds are measured in terms of GHz; this is the vibrational frequency of the clock
which sends out pulses along the control bus – a 3.5 GHZ clock cycle means 3.5 billion clock cycles a
second.
Overclocking – changing the clock speed of a system clock to a value higher than the
factory/recommended setting.
BIOS – basic input/output system.
Cache memory – a high speed auxiliary memory which permits high speed data transfer and retrieval.
Core – a unit made up of ALU, control unit and registers which is part of a CPU. A CPU may contain a
number of cores.
Dual core – a CPU containing two cores.
Quad core – a CPU containing four cores.
Port – external connection to a computer which allows it to communicate with various peripheral
devices. A number of different port technologies exist.
Universal Serial Bus (USB) – a type of port connecting devices to a computer.
Asynchronous serial data transmission – serial refers to a single wire being used to transmit bits of
data one after the other. Asynchronous refers to a sender using its own clock/timer device rather
sharing the same clock/timer with the recipient device.
High-definition multimedia interface (HDMI) – type of port connecting devices to a computer
transmitting audio and video both.
Video Graphics Array (VGA) – type of port connecting devices to a computer, transmitting video
signals only.
High-bandwidth digital copy protection (HDCP) – part of HDMI technology which reduces risk of
piracy of software and multimedia.
Fetch-execute cycle – a cycle in which instructions and data are fetched from memory and then
decoded and finally executed.
Program counter (PC) – a register used in a computer to store the address of the instruction which is
currently being executed.
Current instruction register – a register used to contain the instruction which is currently being
executed or decoded.
Register Transfer Notation (RTN) – short hand notation to show movement of data and instructions
in a processor, can be used to represent the operation of the fetch-execute cycle. Interrupt – signal
sent from a device or software to a processor requesting its attention; the
processor suspends all operations until the interrupt has been serviced.
Interrupt priority – all interrupts are given a priority so that the processor knows which need to be
serviced first and which interrupts are to be dealt with quickly.
Interrupt service routine (ISR) or interrupt handler – software which handles interrupt requests (such
as ‘printer out of paper’) and sends the request to the CPU for processing.
AL CU
CP
U
Register
U
Store
Fetch
Cach
RAM
Save
Load
Components of von Neumann Model
Von Neumann Model has following four components:
1. Input/Output Devices
2. Memory Unit
3. Control Unit
4. Arithmetic Logic Unit
Input/output (I/O) Devices
The Input/output (I/O) components of a computer are hardware devices that are responsible for getting data from the
computer to the user or from the user to the computer.
Data going from the user to the computer is called "input." The two main input devices are the mouse and the keyboard.
Output devices are used to transmit data from the computer's memory to the user. The two output devices almost every
computer system has are the monitor and the printer.
Memory Unit
Computer has several types of memory. Memory unit in the Von Neumann model is the main memory, also called RAM or
Random Access Memory. It also refers as Immediate Access Store (IAS).
Immediate Access Store (i.e. main memory) holds data and instructions when they are waiting to be processed.
What distinguishes a computer from a calculator is the ability to run a stored program; main memory allows the computer
to do that.
RAM can be thought of as a sequence of boxes, called cells, each of which
can hold a certain amount of data.
The remaining three components of the von Neumann model of a computer
are found inside the Processor.
Control Unit
The control unit controls the sequencing and timing of all operations. It
contains a "clock," that is actually a quartz crystal that vibrates million times
per second. The clock emits an electronic signal for each vibration. Each
separate operation is synchronized to the clock signal. For example 1st pc
operates at 4.7 MHz means 4.7 million instructions per second.
The functions of CU are given below:
• Fetches the data and instructions from memory into CPU.
• Decodes the instructions.
• Controls processing speed using system clock.
• Manages all activities of computer.
Arithmetic & Logic Unit (ALU)
Arithmetic unit perform arithmetical operations like +, -, *, and / while logical unit are to compare two quantities. Logical
operations are important in computer programming.
ALU can be thought of as being similar to a calculator, except that, in addition to normal math, it can also do logical
(true/false) operations.
The functions of ALU are given below:
• The arithmetic unit carries out arithmetic like addition, division.
• The logic unit enables the processor to make comparison like =, <, > and logical decisions like AND, OR, NOT.
• The arithmetic logic unit carries out communication with peripheral devices.
• It also carries out bit shifting operation.
Register:
Registers are located on the CPU, and used temporarily for storing data. Because the registers are close to the
ALU, they are made out of fast memory, efficiently speeding up calculations.
Registers store data fetched from Immediate Access Store i.e. main memory.
Immediate Access Store (i.e. main memory) holds data and instructions when they are waiting to be processed.
Register Holds data or instructions temporarily when they are being processed.
There are 16 registers. Some examples are
a) Program Counter (PC) - an incrementing counter that keeps track of the next memory address of
the instruction that is to be executed once the execution of the current instruction is completed.
b) Memory Address Register (MAR) - the address in main memory that is currently being read or
written
c) Memory Buffer/Data Register (MBR/MBR) - a two-way register that holds data fetched from
memory (and ready for the CPU to process) or data waiting to be stored in memory
d) Current Instruction register (CIR) - a temporary holding ground for the instruction that has just
been fetched from memory
e) Accumulator Register (ACC) is used for storing data for ALU to process and the results those
are produced by the ALU.
f) Index Register (IX) A hardware element which holds a number that can be added to (or, in some
cases, subtracted from) the address portion of a computer instruction to form an effective address.
Also known as base register. An index register in a computer's CPU is a processor register used
for modifying operand addresses during the run of a program.
g) Status Register A status register, flag register, or condition code register (CCR) is a
collection of status flag bits for a processor. This is a list of the most common CPU status
register flags, implemented in almost all modern processors.
Flag Name Description
Z Zero flag Indicates that the result of an arithmetic or logical operation (or, sometimes,
a load) was zero.
S/N Sign flag Indicates that the result of a mathematical operation is negative. In some
Negative processors, the N and S flags are distinct with different meanings and usage:
flag One indicates whether the last result was negative whereas the other
indicates whether a subtraction or addition has taken place.
V / O / W Overflow Indicates that the signed result of an operation is too large to fit in the
flag register width using two's complement representation.
Buses: ''The set of wires used to travel signals to and from CPU and different components of computer is called
Bus.''
Bus is a group of parallel wires that is used as a communication path. As a wire transmits a
single bit so 8-bits bus can transfer 8 bits (1 byte) at a time and 16-bits bus can transfer 16 bits (2
bytes) and so on. There are three types of buses according to three types of signals, these are:
a) Data Bus: ''The buses which are used to transmit data between CPU, memory and peripherals are
called Data Bus.''
b) Address Bus: ''The buses which are connecting the CPU with main memory and used to identify
particular locations (address) in main memory where data is stored are called Address Buses.''
c) Control Bus: The wires which are used to transmit the control signals (instructions) generated by
Control Unit to the relevant component of the computer.
Example Question: Complete following figure using name of registers as abbreviations, like PC:
Example Question) (a) One of the key features of von Neumann computer architecture is the use of
buses. Three buses and three descriptions are shown below.
Draw a line to connect each bus to its correct description.
This bus carries signals used to coordinate
Address bus
the computer’s activities
The Little Man Computer (LMC) is an instructional model of a computer, created by Dr. Stuart
Madnick in 1965.[1] The LMC is generally used to teach students, because it models a simple von
Neumann architecture computer—which has all of the basic features of a modern computer. It can be
programmed in machine code (albeit in decimal rather than binary) or assembly code. [2][3][4]
The LMC model is based on the concept of a little man shut in a closed mail room (analogous to a
computer in this scenario). At one end of the room, there are 100 mailboxes (memory), numbered 0
to 99, that can each contain a 3 digit instruction or data (ranging from 000 to 999). Furthermore,
there are two mailboxes at the other end labeled INBOX and OUTBOX which are used for receiving
and outputting data. In the center of the room, there is a work area containing a simple two function
(addition and subtraction) calculator known as the Accumulator and a resettable counter known as
the Program Counter. The Program Counter holds the address of the next instruction the Little Man
will carry out. This Program Counter is normally incremented by 1 after each instruction is executed,
allowing the Little Man to work through a program sequentially.
LMC
Assembly
Numeric Operation Comments
Code
code
INPUT the first number, enter into
INP 901 INBOX --> ACCUMULATOR
calculator
STA 08 308 ACCUMULATOR --> MEMORY[08] STORE in memory location 08
INPUT the second number, enter into
INP 901 INBOX --> ACCUMULATOR
calculator (erasing whatever was there)
ACCUMULATOR = ADD the second number in the
ADD 08 108
ACCUMULATOR + MEMORY[08] calculator’s first number.
STA 09 309 ACCUMULATOR → MEMORY[09] STORE the sum in memory location 09
OUTPUT the calculator's result to the
OUT 902 ACCUMULATOR --> OUTBOX
OUTBOX
HLT 000 (no operation performed) HALT the LMC
Factors affecting performance of PC:
Performance of a PC is dependent on Bus Width, Clock
Speed, Cache and Cores.
1. Bus Width: Buses are wires used to transmit data. The
size of a bus, known as its width, it determines how much
data can be transmitted at one time. More the number of
wire higher the possible combinations. For example a 8-
wired address bus can transmit address ranging from 0000 0000 till 1111 1111 means 256
addresses.
2. Clock Speed: The clock speed - also known as clock rate - indicates how fast the CPU can run.
This is measured in megahertz (MHz) or gigahertz (gHz) and corresponds with how many
instruction cycles the CPU can deal with in a second. The clock defines the clock cycle which
synchronises all computer operations. As mentioned earlier, the control bus transmits timing
signals, ensuring everything is fully synchronised. By increasing clock speed, the processing
speed of the computer is also increased (a typical current value is 3.5 GHz – which means 3.5
billion clock cycles a second). Although the speed of the computer may have been increased, it is
not possible to say that a computer’s overall performance is necessarily increased by using a
higher clock speed. Four other factors need to be considered.
Overclocking: the clock speed can be changed by accessing the BIOS basic input/output
system (BIOS) and altering the settings. However, using a clock speed higher than the computer
was designed for can lead to problems, such as
– execution of instructions outside design limits, which can lead to seriously unsynchronised
operations (in other words, an instruction is unable to complete in time before the next one is due
to be executed) and the computer would frequently crash and become unstable
– serious overheating of the CPU leading to unreliable performance.
3. The use of cache memory can also improve processor performance. It is similar to RAM in that its
contents are lost when the power is turned off. Cache uses SRAM whereas most computers use
DRAM for main memory. Therefore, cache memories will have faster access times, since there is
no need to keep refreshing, which slows down access time.
When a processor reads memory, it first checks out cache and then moves on to main memory if
the required data is not there. Cache memory stores frequently used instructions and data that
need to be accessed faster. This improves processor performance.
4. The use of a different number of cores (one core is made up of an ALU, a CU and the registers)
can improve computer performance. Many computers are dual core (the CPU is made up of two
cores) or quad core (the CPU is made up of four cores). The idea of using more cores alleviates
the need to continually increase clock speeds. However, doubling the number of cores does not
necessarily double the computer’s performance since we have to take into account the need for
the CPU to communicate with each core; this will reduce overall performance. For example
– dual core has one channel and needs the CPU to communicate with both cores, reducing some
of the potential increase in its performance
– quad core has six channels and needs the CPU to communicate with all four cores, considerably
reducing potential performance.
Two cores, one channel (left) and four cores, six channels (right)
Fetch-Execute Cycle:
At its core, all the computer ever does is, execute one instruction in memory after another, over and over. Although there
are many different possible (assembly language) instructions that the computer can execute, the basic steps involved in
executing an instruction are always the same, and they are called the instruction cycle.
1. Fetch the instruction (transfer the instruction from main memory to the decoder)
2. Decode the instruction (from machine language)
3. Execute the instruction (e.g., add, divide, load, store...)
4. Store the result (for instructions like ADD, place the 'answer' in the specified register.)
The control unit guides the computer's components through this cycle to execute one instruction.
When that instruction is done, the cycle starts all over again with the next instruction.
Q 4.1) Summer 15 P11_P12Q 4.3 (a) Explain how the width of the data bus and system clock speed affect the
performance of a computer system.
Width of the data bus ......................................................................................................
Clock speed ..................................................................................................................[3]
(b) The table shows six stages in the von Neumann fetch-execute cycle. [6]
Put the stages into the correct sequence by writing the numbers 1 to 6 in the right hand column
Sequence
Description of stage
number
the instruction is copied from the Memory Data Register (MDR) and placed in the Current
Instruction Register (CIR)
the instruction is executed
the instruction is decoded
the address contained in the Program Counter (PC) is copied to the Memory Address Register
(MAR)
the value in the Program Counter (PC) is incremented so that it points to the next instruction to
be fetched
the instruction is copied from the memory location contained in the Memory Address Register
(MAR) and is placed in the Memory Data Register (MDR)
Marking Scheme
Width of the data bus
• the width of the data bus determines the number of bits that can be simultaneously transferred
• increasing the width of the data bus increases the number of bits/amount of data that can be moved at
one time (or equivalent)
• hence improving processing speed as fewer transfers are needed
• By example: e.g. double the width of the data bus moves 2x data per clock pulse
Clock speed
• determines the number of cycles the CPU can execute per second
• increasing clock speed increases the number of operations/number of fetch-execute cycles that can be
carried out per unit of time
• however, there is a limit on clock speed because the heat generated by higher clock speeds cannot be
removed fast enough
Register notation
To describe the cycle we can use register notation. This is a very simple way of noting all the steps
involved. In all cases brackets e.g. [PC], means that the contents of the thing inside the brackets are
loaded. In the case of the first line, the contents of the program counter are loaded into the Memory
Address Register.
MAR [PC]
MBR [Memory] ; PC [PC] +1 (Increment the PC for next cycle at the same time)
CIR [MBR]
CIR sends instruction to Decoder of control unit
Decoder decodes
Or ACC [MBR]
ACC sends data to ALU
ALU executes
Detailed description of Fetch-Decode-Execute Cycle
To better understand what is going on at each stage we'll now look at a detailed description:
The contents of the Program Counter, the address of the next instruction to be executed, is placed
into the Memory Address Register
The address is sent from the MAR along the address bus to the Main Memory. The instruction at that
address is found and returned along the data bus to the Memory Buffer Register. At the same time
the contents of the Program Counter is increased by 1, to reference the next instruction to be
executed.
The MBR loads the Current Instruction Register with the instruction to be decoded by decoder of
control unit or the MBR loads Accumulator with the data to be executed.
The instruction is decoded and executed using the ALU if necessary.
The Cycle starts again!
Q 4.4) Complete the following diagrams showing each step of the fetch decode execute cycle:
Interrupt Handling
Interrupt are signals sent by hardware, software, or user to seek attention of processor.
Interrupts may be generated by hardware like user has pressed a key on keyboard, moved mouse, or
printer become out of ink. Interrupts are also generated by software like antivirus has detected a virus,
or user has tried to divide a number by zero. In all these situations, processor’s instructions are
required.
Interrupt Service Routines ISRs are modules used to deal with the interrupts.
Interrupts have different priorities. When a higher priority interrupt is detected then associated ISRs
are immediately started. For lower priority interrupts, associated ISR are started after completion of
current Fetch execute cycle.
Before loading ISR all the contents of registers are stored in Interrupt Handler and then FE Cycles of
ISR are started, and new interrupts are disabled.
After completion of all FE Cycles of ISR, interrupts are enabled. If new interrupt is detected then its
ISR is loaded in CPU or the tasks from interrupt handler are loaded, to be resume the task has been
paused.
(b) Describe the ways in which the following factors can affect the performance of his laptop
computer.
Number of cores …...................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Clock speed ............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................ [4]
......................................................................................................
PC [PC] + 1
......................................................................................................
......................................................................................................
......................................................................................................
MDR [[MAR]]
......................................................................................................
......................................................................................................
......................................................................................................
MAR [PC]
......................................................................................................
......................................................................................................
(b) Explain how interrupts are handled during the F-E cycle.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................... [5]
4a 9618 W22 P11
5 (a) State what is meant by the stored program concept in the Von Neumann model of a computer system.
…................................................................................................................................................................................
............................................................................................................................................................................ [1]
(b) A Central Processing Unit (CPU) contains several special purpose registers and other components.
(i) State the role of the following registers.
Program Counter (PC) .............................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
Index Register (IX) ....................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
Status Register (SR) ..................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................................................. [3]
(i) Tick (✓) one box in each row to identify the system bus used by each CPU component. [1]
System clock
[1]
(ii) Describe the purpose of the Control Unit (CU) in a CPU.
…………………………………………………………………...............................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................................................. [2]
(c) Describe the purpose of an interrupt in a computer system.
…………………………………………………………………...............................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................................................. [2]
(d) Identify two causes of a software interrupt.
1 ..............................................................................................................................................................................
……………...................................................................................................................................................................
2 ..............................................................................................................................................................................
............................................................................................................................................................................ [2]
5(a) Instructions and data are stored in the same memory space / in main memory. 1
5(b)(i) 1 mark for each special purpose register: 3
Program Counter (PC):
• to store the address / location / memory location of the next instruction to be fetched
Index Register (IX):
• to store a value that is added to an address to give another address
Status Register (SR):
• to store flags which are set by events // from the results of arithmetic and logic
operations and interrupt flags
5(b)(ii) 1 mark for both rows: 1
System clock
3. Identify source of
interrupt
(b) Describe the role of the Status Register and Program Counter (PC).
Status Register .........................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................................
PC .............................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................. [4]
6b 9608/12 Nov 17 Q4 - SoW
4 The following diagram shows the components and buses found inside a typical personal
computer (PC).
(a) Some components and buses only have labels A to F to identify them.
For each label, choose the appropriate title from the following list. The title for label D is
already given.
• Control bus • Address bus • Arithmetic Logic Unit (ALU)
• General purpose registers • Secondary storage • System clock
A ...........................................................................................................................................
B ...........................................................................................................................................
C ...........................................................................................................................................
D Data bus
E ...........................................................................................................................................
F........................................................................................................................................... [5]
(b) Clock speed is a factor that affects the performance of a PC. Explain this statement.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
4.2 Assembly language
Shift – moving the bits stored in a register a given number of places within the register; there are different
types of shift.
Logical shift – bits shifted out of the register are replaced with zeros.
Arithmetic shift – the sign of the number is preserved.
Cyclic shift – no bits are lost, bits shifted out of one end of the register are introduced at the other end of
the register.
Left shift – bits are shifted to the left.
Right shift – bits are shifted to the right.
Monitor – to automatically take readings from a device.
Control – to automatically take readings from a device, then use the data from those readings to adjust the
device.
Mask – a number that is used with the logical operators AND, OR or XOR to identify, remove or set a single
bit or group of bits in an address or register.
Instruction Set
An instruction set is a collection of instructions that the CPU uses to carry out its tasks. For example,
an instruction might look like: 'LDD 101'. This instruction tells the CPU to load data from location
101 into the accumulator.
Machine Code
Computer can understand machine code. Machine
code is a binary programming language and is the
form most easily processed by a CPU. Each line of
code contains an opcode (an instruction) and
an operand (the data to be operated on by the given
instruction).
A programmer might wish to write a program where the actions taken by the processor are directly
controlled. It is argued that this can produce optimum efficiency in a program. However, writing a
program as a sequence of machine code instructions would be a very
time-consuming and error-prone process. The solution for this type of programming is to use
assembly language. As well as having a uniquely defined machine code language each processor
has its own assembly language.
Like to load data from location 101, following instructions are used in machine code and assembly
language:
Machine Code Assembly Language
1100 0010 0110 0101 LDD 101
The command LDD 101 tells the CPU to load data from memory location 101 into the
accumulator. This is clearly easier to understand compared to ‘1100 0010 0110 0101'.
The essence of assembly language is that for each machine code instruction there is an
equivalent assembly language instruction which comprises:
• a mnemonic (a symbolic abbreviation) for the opcode.
• a value or address representation for the operand.
If a program has been written in assembly language it has to be translated into machine code
before it can be executed by the processor. The translation program is called an 'assembler'. The
fact that an assembler is to be used allows a programmer to include some special features in an
assembly language program. Examples of these are:
• comments
• symbolic names for constants
• labels for addresses
• macros
• subroutines
• directives: an instruction to the assembler program
• system calls.
The first three items on this list are there to directly assist the programmer in writing the program
.Of these, comments are removed by the assembler and symbolic names and labels require a
conversion to binary code by the assembler.
A macro or a subroutine contains a sequence of instructions that is to be used more than once in
a program.
Directives and system calls are instructions to the assembler as to how it should construct the
final executable machine code. They can involve directing how memory should be used or defining
files or procedures that will be used. They do not have to be converted into binary code.
Each make of CPU will have its own unique instruction set which will contain hundreds of complex
instructions.
A single CPU instruction consists of a binary number, this is called machine code. The machine
code is denoted in Hexadecimal format, for example Hex '04D3'
The exact range of instructions available to a processor will vary for each processor. However,
there are different types of instructions available to any given processor.
1. Data Movement Instructions / Data Transfer Instructions
2. Arithmetic Operations Instruction Set
3. Logical Operations Instruction Set
4. Conditional and Unconditional Jump
5. Input & Output
6. Selection & Repetition
Data Transfer Instructions
Data transfer instructions are used to move data between registers and between registers
and main memory.
Instruction
Op code Op code Explanation
Operand
(mnemonic) (binary)
Immediate addressing. Load the denary number n
LDM #n 0000 0001
to ACC.
Direct addressing. Load the contents of the
LDD <address> 0000 0010
location at the given address to ACC.
Indirect addressing. At the given address is the
LDI <address> 0000 0101 address to be used. Load the contents of this
second address to ACC.
Indexed addressing. Form the address from
<address> + the contents of the Index
LDX <address> 0000 0110
Register(IX). Copy the contents of this calculated
address to ACC.
LDR #n 0000 0111 Immediate addressing. Load number n to IX.
Relative addressing. Move to the address n
locations from the address of the current
LDV #n 00001010
instruction. Load the contents of this address to
ACC.
STO <address> 0000 1111 Store the contents of ACC at the given address.
2b 9618 W21 P12 –
8b (iii) The opcode LDM uses immediate addressing. The opcode LDD uses direct addressing.
Identify and describe one additional mode of addressing.
Mode of addressing ...........................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [2]
3c 9618 S22 P13
3 (a) The table shows part of the instruction set for a processor. The processor has one general
purpose register, the Accumulator (ACC).
Instruction Explanation
Opcode Operand
LDM #n Immediate addressing. Load the number n to ACC
Direct addressing. Load the contents of the location at the
LDD <address>
given address to ACC
Indirect addressing. The address to be used is at the given
LDI <address>
address. Load the contents of this second address to ACC
<address> can be an absolute or symbolic address
# denotes a denary number, e.g. #123
The current contents of main memory are:
Address
100 101
101 67
102 104
103 100
104 68
Complete the table by writing the value stored in the accumulator after the execution of each
instruction. [3]
Instruction Accumulator
LDM #103
LDD 102
LDI 103
(b) The instructions in part (a) are examples of the data movement group.
Describe two other instruction groups.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................ [4]
Q 1) Summer 15 P11-12
3 Five modes of addressing and five descriptions are shown below.
Draw a line to connect each mode of addressing to its correct description.
Mode of
Description
addressing
Addressing Mode:
1. Direct Addressing: Direct addressing. Load the contents of the location at the given address to
ACC
2. Indirect Addressing: The address to be used is at the given address. Load the contents of this
second address to ACC
3. Immediate Addressing: Load the number n to ACC or IX
4. Relative Addressing: the operand is the offset from the current address where the value to be
used is stored
5. Indexed Addressing: Form the address from <address> + the contents of the Index Register.
Copy the contents of this calculated address to ACC.
0 address instruction (Opcode without Operand)
This type of instruction takes no parameters and involves Assembly code that doesn't need
variables. For example:
Absolute address
Symbolic Address
Absolute addresses are numerical address; it is convenient to use names for memory locations.
These names are called symbolic addresses.
Relative Address
Relative address means an address specified by indicating its distance from another address, called
the base address. For example, a relative address might be B+15, B being the base address and 15 the
distance (called the offset).
Assembler
It is impossible for a computer to execute this assembly language code because it is not in
machine code. It is now necessary for the computer to use a translator program to turn the
original program into machine code. This translator program is called an assembler and programs
written in this way are said to be written in assembly language.
The assembly process is relatively simple because assembly language has a one-to-one
relationship with machine code. That is, every assembly language instruction translates into
exactly one machine code instruction.
Two-pass assemblers
An assembler is a translator that translates an assembler program into a conventional machine
language program. Basically, the assembler goes through the program one line at a time, and
generates machine code for that instruction. Then the assembler proceeds to the next instruction.
In this way, the entire machine code program is created. For most instructions this process works
fine, for example for instructions that only reference registers, the assembler can compute the
machine code easily, since the assembler knows where the registers are.
ADD Value
...
...
Value: 70
This is known as a forward reference. If the assembler is processing the file one line at a time,
then it doesn't know what Value is when it first encounters the ADD instruction.
So, what is to be done to allow the assembler to generate the correct instruction?
Answer: scan the code twice. The first time, just count how long the machine code instructions will
be, just to find out the addresses of all the labels. Also, create a table that has a list of all the
addresses and where they will be in the program. This table is known as the symbol table. On the
second scan, generate the machine code, and use the symbol table to determine what value to
add, Value labels are, and to generate the most efficient instruction.
This is known as a two-pass assembler. Each pass scans the program, the first pass generates
the symbol table and the second pass generates the machine code.
Basically, the assembler must translate the mnemonics into binary, which is done by having a
simple lookup table with the mnemonics in one column and the binary machine code equivalents
alongside. The labels are a bit more complicated. The assembler does the translation in the same
way, but the table contents are not known before translation starts. The list of labels and their
actual memory address values have to be created by the assembler. As the program is read, the
assembler recognises the first label, NUM1, and allocates an actual memory location for NUM1
relative to the address used to store the first instruction. In this way, the assembler builds its own
lookup table of labels used by the assembly language program.
Assemblers translate from assembly language to machine code. Some assemblers scan the
assembly language program twice; these are referred to as two-pass assemblers.
First Pass:
1. Directives are acted upon
2. The assembler scans the assembly language instructions in sequence.
3. Ignore comments
4. Checks opcode in instruction set
5. Check the operand, is it absolute address or symbolic
6. Creates symbol tables for symbolic address
7. When it meets a symbolic address add it in symbol table
8. Place address of labelled instruction in the symbol table.
Pass 2:
9. Read the assembly language program one line at a time.
10. Generate object code, including opcode and operand, from the symbol table generated in
Pass
11. Save or execute the program.
5a 9608/11 Jun 17 Q4a – SoW
4 The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC) and an Index Register (IX).
Instruction
Op Operand Op code Explanation
code (binary)
Immediate addressing. Load the denary number n to
LDM #n 0000 0001
ACC.
Direct addressing. Load the contents of the location at
LDD <address> 0000 0010
the given address to ACC.
Indirect addressing. At the given address is the address
LDI <address> 0000 0101 to be used. Load the contents of this second address to
ACC.
Indexed addressing. Form the address from <address>
LDX <address> 0000 0110 + the contents of the Index Register(IX). Copy the
contents of this calculated address to ACC.
LDR #n 0000 0111 Immediate addressing. Load number n to IX.
STO <address> 0000 1111 Store the contents of ACC at the given address.
The following diagram shows the contents of a section of main memory and the Index Register
(IX).
(a) Show the contents of the Accumulator (ACC) after each instruction is executed.
5b 9608/12 Jun 17 Q5 - SoW
5 The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Op code Operand Op code Explanation
(mnemonic) (binary)
Direct addressing. Load the contents of the location
LDD <address> 0001 0011
at the given address to the Accumulator (ACC).
Indirect addressing. The address to be used is at the
LDI <address> 0001 0100 given address. Load the contents of this second
address to ACC.
Indexed addressing. Form the address
LDX <address> 0001 0101 from<address>+ the contents of the Index Register.
Copy the contents of this calculated address to ACC.
Immediate addressing. Load the denary number n to
LDM #n 0001 0010
ACC.
Immediate addressing. Load denary number into the
LDR #n 0001 0110
Index Register (IX).
STO <address> 0000 0111 Store the contents of ACC at the given address.
The following diagram shows the contents of a section of main memory and the Index Register
(IX).
(a) Show the contents of the Accumulator (ACC) after each instruction is executed.
(b) Each machine code instruction is encoded as 16 bits (8-bit op code followed by an 8-
bitoperand).
Write the machine code for these instructions: [3]
.......................................................................................................................................[2]
Instruction
Explanation
Op Code Operand
LDD <address> Direct addressing. Load the contents of the given address to ACC.
Index addressing. Form the address from <address> + the contents of the
LDX <address>
index register. Copy the contents of this calculated address to ACC.
Indirect addressing. The address to be used is at the given address. Load the
LDI <address>
contents of this second address to ACC.
STO <address> Store the contents of ACC at the given address.
INC <register> Add 1 to contents of the register (ACC or IX).
ADD <address> Add the contents of the given address to the ACC.
END Return control to the operating system.
The diagram shows the contents of a section of main memory:
Main memory
1001 1110
(a) (i) Show the contents of the Accumulator after the execution of the instruction:
LDD 102
ACC:
[1]
(ii) Show the contents of the Accumulator after the execution of the instruction:
LDX 101
IX: 0 0 0 0 0 1 0 0
ACC:
............................................................................................................................................................................................
............................................................................................................................................................................................
.........................................................................................................................................................[2]
(iii) Show the contents of the Accumulator after the execution of the instruction:
LDI 103
ACC:
............................................................................................................................................................................................
............................................................................................................................................................................................
............................................................................................................................................................................................
............................................................................................................................................................................................
..............................................................................[3]
(b) Complete the trace table below for the following assembly language program.
…
810
811 28
41
812
0
813
0
Trace table:
Memory address
ACC
810 811 812 813
28 41 0 0
[6]
6a 9608/11 Nov 17 Q4 - SoW
4 (b) The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Op code Operand Op code
Explanation
mnemonic (binary)
LDM #n 1100 0001 Immediate addressing. Load number n to ACC.
Direct addressing. Load the contents of the given
LDD <address> 1100 0010
address to ACC.
Relative addressing. Move to the address n locations
LDV #n 1100 0011 from the address of the current instruction. Load the
contents of this address to ACC.
STO <address> 1100 0100 Store the contents of ACC at the given address.
DEC 1100 0101 Decrement the contents of ACC.
Output the character corresponding to the ASCII
OUTCH 1100 0111
character code in ACC.
Following a compare instruction, jump to <address> if
JNE <address> 1110 0110
the compare was False.
JMP <address> 1110 0011 (Unconditionally) jump to the given address.
CMP #n 1110 0100 Compare the contents of ACC with number n.
Complete the trace table for the following assembly language program.
Trace table: [5]
ACC CountDown OUTPUT
15
67 C
15
(c) The program given in part (b) is to be translated using a two-pass assembler. The program has been
copied here for you. The program now starts with a directive which tells the assembler to load the first
instruction of the program to address 100.
On the first pass of the two-pass process, the assembler adds entries to a symbol table.
The following symbol table shows the first eleven entries, part way through the first pass.
The circular labels show the order in which the assembler made the entries to the symbol table.
Explain how the assembler made these entries to the symbol table.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(d) The assembler software must then complete the second pass building up the executable file.
(i) Name the second table needed when the assembler software carries out the second pass.
.......................................................................................................................................[1]
The following shows two of the program instructions in machine code.
Instruction
Machine
Binary Hexadecimal
code
1100
OUTCH C7
0111
JNE
A B
CarryOn
Each of the numbers A and B represents the complete instruction in two bytes, one byte for
the op code and one byte for the operand.
(ii) Use the following instruction set to write the numbers for A and B.
A (binary) ........................................................................................................................
B (hexadecimal) .............................................................................................................[3]
6b 9608/12 Nov 17 Q4 - SoW
4 (c) An assembly language program can contain both macros and directives.
(i) Explain what is meant by these terms.
Macro .........................................................................................................................................
............................................................................................................................................................
..............................................................................................................................................
Directive ......................................................................................................................................
............................................................................................................................................................
........................................................................................................................................ [3]
(ii) Give an example of the use of a directive.
............................................................................................................................................................
........................................................................................................................................ [1]
(d) The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Complete the trace table for the following assembly language program.
(e) The program given in part (d) is to be translated using a two-pass assembler. The program
has been copied here for you.
Label Instruction
StartProg: LDV #Offset
CMP Value
JPE EndProg
OUTCH
LDD Offset
INC
STO Offset
JMP StartProg
EndProg: END
Offset: 10
50
65
89
32
Value: 32
On the first pass, the assembly process adds entries to a symbol table.
The following symbol table shows the first five entries, part way through the first pass.
The circular labels show the order in which the assembler made the entries to the symbol table.
Complete the symbol table. Use circular labels to show the order in which the assembler makes
the entries.
7a 9608/11 Jun 18 Q8a, b - SoW
8 The Von Neumann model uses a series of registers.
(a) Explain what is meant by the term register.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................... [2]
(b) (i) Explain the purpose of the Memory Data Register (MDR).
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................... [2]
(ii) Name two registers, other than the MDR, that are used in the fetch-execute cycle.
Register 1 ...................................................................................................................................
Register 2 ............................................................................................................................... [2]
8a 9608/11 Nov 18 Q4a, b, d - SoW
4 The table shows assembly language instructions for a processor which has one general purpose
register, the Accumulator (ACC) and an index register (IX).
(a) (i) State what is meant by direct addressing and indirect addressing.
Direct addressing ..............................................................................................................
...........................................................................................................................................
Indirect addressing ............................................................................................................
........................................................................................................................................... [2]
(ii) Explain how the instruction ADD 20 can be interpreted as either direct or indirect addressing.
Direct addressing ..............................................................................................................
...........................................................................................................................................
Indirect addressing ............................................................................................................
........................................................................................................................................... [2]
(b) The assembly language instructions in the following table use either symbolic addressing or
absolute addressing.
Tick ( ) one box in each row to indicate whether the instruction uses symbolic or absolute
addressing. [2]
Instruction Symbolic Absolute
ADD 90
CMP found
STO 20
Complete the trace table for the given assembly language program. [8]
Instruction Memory Address
ACC IX OUTPUT
Address 200 201 202 203 204 205
70 130 130 133 130 0 0 2 0
4.3 Bit Manipulation
Candidates should be able to: Notes and guidance
Show understanding of and perform binary shifts logical, arithmetic and cyclic
Left shift, right shift
Show understanding of how bit manipulation can be Carry out bit manipulation operations
used to monitor / control a device Test and set a bit (using bit masking)
Bitwise operations are similar to Boolean logic operations except that they work on individual bits
in a byte rather than on whole codes or characters. In this section, we are going to look at the
commonest operators and how they are typically used.
Following are the bitwise operators
Label Instruction
Opcode Operand
Opcode Operand Bitwise AND operation of the contents of ACC with the
AND #n operand
Bitwise AND operation of the contents of ACC with the
AND <address>
contents of <address>
Bitwise XOR operation of the contents of ACC with the
XOR #n
operand
Bitwise XOR operation of the contents of ACC with the
XOR <address>
contents of <address>
Bitwise OR operation of the contents of ACC with the
OR #n
operand
Bitwise OR operation of the contents of ACC with the
contents of <address>
OR <address>
<address> can be an absolute address or a symbolic
address
Bits in ACC are shifted logically n places to the left. Zeros
LSL #n
are introduced on the right hand end
Bits in ACC are shifted logically n places to the right.
LSR #n
Zeros are introduced on the left hand end
<label>: <opcode> <operand> Labels an instruction
<label>: Gives a symbolic address <label> to the memory location
<data>
with contents <data>
Most of the time, data is handled in bytes and words. Sometimes, though, applications require
manipulating data at the bit level.
There are several types of bit manipulation you are required to know:
• Bitwise left shift
• Bitwise right shift signed and unsigned
• Circular shifts
• Masking (AND)
• Setting bits (OR)
• Toggling bits (XOR)
Logical left shift
With a single left shift, each bit is moved up one location with the leftmost bit discarded (the MSB)
and a zero pads out the right most bit (the LSB)
The left shift operation is shown below for the number 00110101
With logical shifts, the sign is not preserved. For example in the diagram below if the number is in
two's compliment, the 1 in the MSB means it is a negative number, but a logical shift results in the
sign being discarded.
Multiplication
Most of the time, when you shift a binary number left, the value is doubled. For example denary 53
is binary 0011 0101. Place this in a binary table and carry out a left shift. The resulting binary 0110
1010 is denary 106 which is double the original number.
This easy way of doubling works so long as the leftmost bit was a 0 before the shift. If it was a 1,
that value is lost and the number isn't doubled. So, for a byte, multiplying through left wise shifts
works for positive numbers up to 127.
Arithmetic shift – the sign of the number is preserved. For example, an 8-bit register containing
the binary value 10101111 shifted right arithmetically three places would become 11110101.
Arithmetic shifts can be used for multiplication or division by powers of two.
Cyclic shift – no bits are lost during a shift. Bits shifted out of one end of the register are
introduced at the other end of the register. For example, an 8-bit register containing the binary
value 1011 0101 shifted left cyclically one place would become 0110 1010.
Instruction
Explanation
Opcode Operand
Bits in ACC are shifted logically n places to the left. Zeros
LSL #n
are introduced on the right hand end
Bits in ACC are shifted logically n places to the right. Zeros
LSR #n
are introduced on the left hand end
Bit manipulation to control devices
In monitoring and control, each bit in a register or memory location can be used as a flag and
would need to be tested, set or cleared separately.
For example, a control system with eight different sensors would need to record when the data
from each sensor had been processed. This could be shown using 8 different bits in the same
memory location.
• AND is used to check if the bit has been set.
• OR is used to set the bit.
• XOR is used to clear a bit that has been set.
The controlling computer or microprocessor has to have a real-time program running continuously.
The program can set values for Boolean variables subject to what the sensors detect. For
instance, if a controlled environment had two properties to be monitored and controlled, four
Boolean variables could be used. Values could be set by assignment statements such as:
IF SensorDifference1 > 0 THEN Sensor1HighFlag ← TRUE
IF SensorDifference1 < 0 THEN Sensor1LowFlag ← TRUE
IF SensorDifference2 > 0 THEN Sensor2HighFlag ← TRUE
IF SensorDifference2 < 0 THEN Sensor2LowFlag ← TRUE
Another part of the monitoring and control program would then be checking whether any of the
four flags were set. The machine code for running such a program could use individual bits to
represent each flag. The way that flags could be set and read are illustrated by the following
assembly language code fragments. In these code fragments the three least significant bits
(positions 0, 1 and 2) of the byte are used as flags.
The following illustrates the setting of all bits to zero which might be used when the system is
switched on.
LDD 0034 Loads a byte into the accumulator from an address.
Uses a bitwise AND operation of the contents of the accumulator with
AND B00000000
the operand to convert each bit to 0.
STO 0034 Stores the altered byte in the original address.
The following illustrates the toggling of the value for one bit. This changes the value of the flag it
represents. It might be needed because a problem has been encountered or alternatively because
a problem has been solved.
LDD 0034 Loads a byte into the accumulator from an address.
Uses a bitwise XOR operation of the contents of the accumulator with the
XOR B00000001
operand to toggle the value of the bit stored in position 0.
STO 0034 Stores the altered byte in the original address.
The following illustrates the setting of a bit to have value 1 irrespective of its existing value. This
would be a simple way of just reporting a condition repetitively.
LDD 0034 Loads a byte into the accumulator from an address.
Uses a bitwise OR operation of the contents of the accumulator with the
OR B00000100 operand to set the flag represented by the bit in position 2. All other bit
positions remain unchanged.
STO 0034 Stores the altered byte in the original address.
The following illustrates setting all bits to zero except one bit which is of interest. Following this
operation, a comparison can be made with a binary value to check if the bit is set. In this example
the value would be compared to the binary equivalent of denary 2.
LDD 0034 Loads a byte into the accumulator from an address.
Uses a bitwise AND operation of the contents of the accumulator with the
AND B00000010 operand to leave the value in position 1 unchanged but to convert every
other bit to 0.
STO 0034 Stores the altered byte in the original address.
AND bitwise operator - both bits must be a 1 for the result to be a 1, otherwise the result is
a 0.
Example 1: 01011100 & 11001110
7 6 5 4 3 2 1 0 Bit position
0 1 0 1 1 1 0 0 Data 1
1 1 0 0 1 1 1 0 Data 2
0 1 0 0 1 1 0 0 AND result
OR bitwise operator - Either bit must be a 1, or both bits must be a 1, for the result to be a
1, otherwise the result is a 0.
Example 3: 10001000 | 11000001
7 6 5 4 3 2 1 0 Bit position
1 0 0 0 1 0 0 0 Data 1
1 1 0 0 0 0 0 1 Data 2
1 1 0 0 1 0 0 1 OR result
XOR bitwise operator - both bits must be different for the result to be a 1, otherwise the
result is a 0.
Example 5: 10011110 ^ 00010001
7 6 5 4 3 2 1 0 Bit position
1 0 0 1 1 1 1 0 Data 1
0 0 0 1 0 0 0 1 Data 2
1 0 0 0 1 1 1 1 XOR result
Example 6: 00001010 ^ 11001100
7 6 5 4 3 2 1 0 Bit position
0 0 0 0 1 0 1 0 Data 1
1 1 0 0 1 1 0 0 Data 2
1 1 0 0 0 1 1 0 XOR result
Example 8: ~ 10100010
1 0 1 0 0 0 1 0 Data
COMPLEMENT
0 1 0 1 1 1 0 1
result
7 6 5 4 3 2 1 0 Bit position
0 0 0 0 0 0 0 0 Data
1 0 0 1 0 0 0 0 Mask
1 0 0 1 0 0 0 0 OR Result
Resetting bits to 0
You can't force a bit to be 0 using the OR command. You can use the bitwise command AND
along with a suitable mask, however. For example, suppose you wanted to reset Bits 0, 1 and 2 in
a byte but leave all the other bits as they were. You would use the mask 1111 1000 along with the
AND bitwise operator.
7 6 5 4 3 2 1 0 Bit position
1 0 1 0 1 0 1 1 Data
1 1 1 1 1 0 0 0 Mask
1 0 1 0 1 0 0 0 AND Result
7 6 5 4 3 2 1 0 Bit position
0 1 1 0 1 0 0 0 Data
0 0 0 0 0 1 0 0 Mask
0 0 0 0 0 0 0 0 AND Result
We can test the result now. If the result is a zero as it is in this case, then Bit 2 in our data was a
0.
Now see what happens if Bit 2 in the previous data was actually a 1 to start with. When you AND a
1 with a 1, the result is a 1.
7 6 5 4 3 2 1 0 Bit position
0 1 1 0 1 1 0 0 Data
0 0 0 0 0 1 0 0 Mask
0 0 0 0 0 1 0 0 AND Result
As you can see, the result is now not zero anymore. In this situation, it tells us that Bit 0 in the
original piece of data must have been a 1 to start with.
Testing bits like this is very important. Based on the result of the test, we can branch off and do
different things in a program.
Toggling bits (making a 1 bit into a 0 and making a 0 bit into a 1).
We have seen how to turn bits on, and how to turn them off but we haven't seen how to do this at
the same time. For this, we need the XOR bitwise operator. Suppose we want to toggle bits 4, 5, 6
and 7 but leave Bits 0, 1, 2 and 3 in whatever state they are in. The mask we would need is 1111
0000 along with the XOR operator.
7 6 5 4 3 2 1 0 Bit position
1 0 1 0 1 0 1 0 Data
1 1 1 1 0 0 0 0 Mask
0 1 0 1 1 0 1 0 XOR Result
As you can see, the bits that we didn't want to toggle stayed as they were. However the bits that
we did want to toggle were indeed flipped over to the opposite state.
The bit on the left has the biggest value and is worth 128. It is called the Most Significant Bit
(MSB) and its position in the byte is Bit 7 (because in computing, we start counting from 0). The bit
on the right is the Least Significant Bit (LSB) is Bit 0 and is worth 1. When you work with bits, you
need to be very clear the number of the bit you are talking about, its value and terms like MSB and
LSB.
Specimen Paper 9618/01
4 A cake factory uses machines to make cakes .
(d) The machines have a counter to record the number of cake tins filled. Each time a cake tin is
filled, the counter is increased by 1. The value is stored in an 8-bit register, the current value is
shown.
0 0 0 0 1 0 0 1
(i) Show the value of the binary number after another five cake tins have been filled.
[1]
(ii) The following table shows some assembly language instructions for a processor which has one
general purpose register, the Accumulator (ACC).
Instruction
Explanation
Op code Operand
AND #n Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents
AND <address>
of <address>
XOR #n Bitwise XOR operation of the contents of ACC with the operand
Bitwise XOR operation of the contents of ACC with the contents
XOR <address>
of <address>
OR #n Bitwise OR operation of the contents of ACC with the operand
Bitwise OR operation of the contents of ACC with the contents of
OR <address>
<address>
Bits in ACC are shifted logically n places to the left. Zeros are
LSL #n
introduced on the right hand end
Bits in ACC are shifted logically n places to the right. Zeros are
LSR #n
introduced on the left hand end.
At the end of each day, the register is reset to 0. Write the assembly language statement to reset
the register to 0.
............................................................................................................................................................
....................................................................................................................................... [2]
(iii) A two-place logical shift to the left is performed on the binary number shown in part (d).
Show the result of this logical shift. [1]
(iv) State the mathematical result of a one-place logical shift to the right on a binary number.
............................................................................................................................................................
........................................................................................................................................ [1]
1b 9618 S21 P12
4 (b) Some bit manipulation instructions are shown in the table:
Instruction Explanation
Opcode Operand
AND #n Bitwise AND operation of the contents of ACC with the operand
AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>
XOR #n Bitwise XOR operation of the contents of ACC with the operand
XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>
OR #n Bitwise OR operation of the contents of ACC with the operand
OR <address> Bitwise OR operation of the contents of ACC with the contents of <address>
<address> can be an absolute address or a symbolic address
# denotes a denary number, e.g. #123
The contents of the memory address 300 are shown:
Bit Number 7 6 5 4 3 2 1 0
300 0 1 1 0 0 1 1 0
(i) The contents of memory address 300 represent an unsigned binary integer.
Write the denary value of the unsigned binary integer in memory address 300.
..................................................................................................................................... [1]
(ii) An assembly language program needs to test if bit number 2 in memory address 300 is a 1.
Complete the assembly language instruction to perform this test.
......................... #4 [1]
(iii) An assembly language program needs to set bit numbers 4, 5, 6 and 7 to 0, but keep bits 0 to
3 with their existing values. Write the assembly language instruction to perform this action.
............................................................................................................................................................
.................................................................................................................... [2]
Identify the mathematical operation that the following instruction will perform on the contents of the
accumulator.
LSR #3
............................................................................................................................................................
.................................................................................................................... [1]
3a 9618 S22 P11 –
6 (a) A computer system is designed using the basic Von Neumann model.
(c) The table shows part of the instruction set for a processor. The processor has one general
purpose register, the Accumulator (ACC).
Instruction
Explanation
Opcode Operand
AND #n Bitwise AND operation of the contents of ACC with the operand
XOR #n Bitwise XOR operation of the contents of ACC with the operand
OR #n Bitwise OR operation of the contents of ACC with the operand
Bits in ACC are shifted logically n places to the left. Zeros are
LSL #n
introduced on the right hand end
Bits in ACC are shifted logically n places to the right. Zeros are
LSR #n
introduced on the left hand end
# denotes a denary number, e.g. #123
(i) Complete the register to show the result after the instruction AND #2 is executed. [1]
Register before: 0 1 1 0 1 1 0 1
Register after:
(ii) Complete the register to show the result after the instruction OR #8 is executed. [1]
Register before: 0 1 1 0 1 1 0 1
Register after:
(iii) Complete the register to show the result after the operation LSL #4 is executed. [1]
Register before: 0 1 1 0 1 1 0 1
Register after:
3b 9618 S22 P12
3 The table shows part of the instruction set for a processor. The processor has one general purpose
register, the Accumulator (ACC).
Instruction
Explanation
Opcode Operand
AND #n Bitwise AND operation of the contents of ACC with the operand
AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>
XOR #n Bitwise XOR operation of the contents of ACC with the operand
XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>
OR #n Bitwise OR operation of the contents of ACC with the operand
OR <address> Bitwise OR operation of the contents of ACC with the contents of <address>
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
(a) The ACC currently contains the following positive binary integer:
0 1 1 0 0 1 0 1
Write the bit manipulation instruction that would change the binary integer in ACC to:
1 1 1 1 1 1 1 1
Opcode ..................................................... Operand ..................................................... [2]
(b) The ACC currently contains the following positive binary integer:
0 1 1 0 0 1 0 1
Write the bit manipulation instruction that would change the binary integer in ACC to:
1 0 0 1 1 0 1 0
Opcode ..................................................... Operand ..................................................... [2]
............................................................................................................................................. [1]
(d) A three-place logical shift to the left is performed on the following positive binary integer.
Show the result of this logical shift.
01111110
............................................................................................................................................. [1]
3c 9618 S22 P13
3 (c) The table shows part of the instruction set for a processor. The processor has one general
purpose register, the Accumulator (ACC).
The binary value 00111101 is stored in the memory address 200.
Each instruction in the diagram is performed on the data in memory address 200.
Draw one line from each instruction to its correct result. [3]
Instruction Result
01111101
XOR
00111101
B11110000
OR B01010101 11111111
AND
11000010
B11111111
11001101
MJ19 P31
6 Monitoring and control systems have many different applications.
(a) Explain the importance of feedback in a control system.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................ [3]
(b) An indoor swimming pool is to be kept at a constant temperature of 28 degrees.
Describe the use of feedback in this control system.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................ [4]
(c) Give one example of a monitoring system. Explain why this is a monitoring system.
Monitoring system ....................................................................................................................
...................................................................................................................................................
Explanation ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
MJ18P32
6 (a) There are five scenarios on the left and two types of system on the right.
Draw a line to link each scenario to its correct type of system.[2]
Scenario System
Car speed display
Rollercoaster
(b) Mary has six fish tanks. The temperature of the water in each tank needs to be within a specific
range. Identify three items of hardware that Mary can add to her tanks to help maintain the
temperature. Describe the purpose of each item.
Item 1 .........................................................................................................................................
Purpose ....................................................................................................................................
....................................................................................................................................................
Item 2 .....................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 3 ........................................................................................................................................
Purpose ....................................................................................................................................
...............................................................................................................................................[6]
(c) A temperature reading is taken from each tank once per minute. The temperature reading is
stored as two successive bytes. The format is shown:
Fish tank Temperature reading
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The fish tank number is indicated by setting one of the bits in Byte 1 to 1. For example, fish tank
number 5 is indicated by setting bit 5 to 1.
Bit 7 of Byte 1 is a flag:
• the flag’s initial value is zero
• when the reading has been processed, the flag’s value is set to 1
Bit 0 of Byte 1 is unused.
Byte 2 contains the temperature reading as a two’s complement integer.
(i) After a temperature reading has been taken, the bytes contain the following data.
7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1
Byte 1 Byte 2
Analyse the data contained in the two bytes.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
..........................[3]
(ii) The system receives a temperature reading of -2 from fish tank number 4.
Complete the bytes to show the values for this reading after it has been processed. [2]
7 6 5 4 3 2 1 0
Byte 1 Byte 2
(d) A hardware device to affect the temperature of each tank is on or off depending on the value of
a bit in memory location 6753.
If bit 4 is 1, then the hardware device in fish tank 4 is on.
Write assembly language instructions to set bit 4 of memory location 6753 to 1 without changing
any other bits. Use the instruction set provided.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
..........................[3]
Instruction set
Instruction Explanation
Op code Operand
Direct addressing. Load the contents of the location at the given address
LDD <address>
to ACC.
STO <address> Store the contents of ACC at the given address.
AND #n Bitwise AND operation of the contents of ACC with the operand.
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>.
XOR #n Bitwise XOR operation of the contents of ACC with the operand.
OR #n Bitwise OR operation of the contents of ACC with the operand.
Bitwise OR operation of the contents of ACC with the contents of
OR <address> <address>.
<address> can be an absolute address or a symbolic address.
MJ18P32
7 A museum stores antique items that need to be kept at constant temperature.
The museum is not sure about the actual temperatures. The museum installs some equipment.
This records the temperatures every hour and ensures the temperature stays within a set range.
(a) Identify the type of system described.
...............................................................................................................................................[1]
(b) The system has a temperature sensor. Identify two other items of hardware that the museum
can use for the type of system identified. Describe the purpose of each item.
Item 1 ........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
Item 2 ........................................................................................................................................
Purpose ....................................................................................................................................
.................................................................................................................................................[4]
(c) The equipment records the temperature in all seven rooms in the museum.
Each recording is stored as two successive bytes in memory. The format is as shown.
Temperature Room
7 6 5 4 3 2 1 0
Byte 1 Byte 2
The room is indicated by the setting of one of the bits in Byte 2 to 1. For example, room 7 is
indicated by setting bit 7 to 1.
Bit 0 of Byte 2 is a flag:
• The flag’s initial value is zero.
• When the reading has been processed, the flag’s value is set to 1.
Byte 1 contains the temperature reading as an unsigned integer.
One reading returns the following binary data.
Temperature Room
7 6 5 4 3 2 1 0
1 0 1 1 0 0 1 1 0 0 1 0 0 0 0 1
Byte 1 Byte 2
(i) Analyse the data contained in the two bytes.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...................[3]
(ii) The system receives a temperature reading of 238 from room number 4. [2]
Complete the bytes to show the two bytes for this recording. The reading has not yet been
processed.
7 6 5 4 3 2 1 0
Byte 1 Byte 2
Unit 5 System Software
Topic You should be able to R A G
• Describe an Operating System (OS), the tasks performed, why an OS is
needed, the role of utility programs and program libraries
System
• Understand the need for language translators, Integrated Development
Software
Environments (IDE), the role of compilers and interpreters and their
benefits and drawbacks
CMOS – complementary metal-oxide semiconductor.
Operating system – software that provides an environment in which applications can run and provides an
interface between hardware and human operators.
HCI – human–computer interface.
GUI – graphical user interface.
CLI – command line interface.
Icon – small picture or symbol used to represent, for example, an application on a screen. WIMP –
windows, icons, menu and pointing device.
Post-WIMP – interfaces that go beyond WIMP and use touch screen technology rather than a pointing
device.
Pinching and rotating – actions by fingers on a touch screen to carry out tasks such as move, enlarge,
reduce, and so on.
Memory management – part of the operating system that controls the main memory.
Memory optimisation – function of memory management that determines how memory is allocated and
deallocated.
Memory organisation – function of memory management that determines how much memory is allocated
to an application.
Security management – part of the operating system that ensures the integrity, confidentiality and
availability of data.
Contiguous – items next to each other.
Virtual memory systems – memory management (part of OS) that makes use of hardware and software to
enable a computer to compensate for shortage of actual physical memory.
Memory protection – function of memory management that ensures two competing applications cannot
use same memory locations at the same time.
Process management – part of the operating system that involves allocation of resources and permits the
sharing and exchange of data.
Hardware management – part of the operating system that controls all input/output devices connected to
a computer (made up of sub-management systems such as printer management, secondary storage
management, and so on).
Device driver – software that communicates with the operating system and translates data into a format
understood by the device.
Utility program – parts of the operating system which carry out certain functions, such as virus checking,
defragmentation or hard disk formatting.
Disk formatter – utility that prepares a disk to allow data/files to be stored and retrieved.
Bad sector – a faulty sector on an HDD which can be soft or hard.
Antivirus software – software that quarantines and deletes files or programs infected by a virus (or other
malware). It can be run in the background or initiated by the user.
Heuristic checking – checking of software for behaviour that could indicate a possible virus.
Quarantine – file or program identified as being infected by a virus which has been isolated by antivirus
software before it is deleted at a later stage.
False positive – a file or program identified by a virus checker as being infected but the user knows this
cannot be correct.
Disk defragmenter – utility that reorganises the sectors on a hard disk so that files can be stored in
contiguous data blocks.
Disk content analysis software – utility that checks disk drives for empty space and disk usage by
reviewing files and folders.
Disk compression – software that compresses data before storage on an HDD.
Back-up utility – software that makes copies of files on another portable storage device.
Program library – a library on a computer where programs and routines are stored which can be freely
accessed by other software developers for use in their own programs.
Library program – a program stored in a library for future use by other programmers.
Library routine – a tested and ready-to-use routine available in the development system of a programming
language that can be incorporated into a program.
Dynamic link file (DLL) – a library routine that can be linked to another program only at the run time stage.
Translator – the systems software used to translate a source program written in any language other than
machine code.
Compiler – a computer program that translates a source program written in a high-level language to
machine code or p-code, object code.
Interpreter – a computer program that analyses and executes a program written in a high-level language
line by line.
Integrated development environment (IDE) – a suite of programs used to write and test a computer
program written in a high-level programming language.
Pretty-printing – the practice of displaying or printing well set out and formatted source code, making it
easier to read and understand.
Syntax error – an error in the grammar of a source program.
Logic error – an error in the logic of a program.
Debugging – the process of finding logic errors in a computer program by running or tracing the program.
Single stepping – the practice of running a program one line/instruction at a time.
Breakpoint – a deliberate pause in the execution of a program during testing so that the contents of
variables, registers, and so on can be inspected to aid debugging.
Report window – a separate window in the run-time environment of the IDE that shows the contents of
variables during the execution of a program.
Context-sensitive prompt - Displays predictions of the code being entered
Dynamic syntax check - Underlines or highlights statements that do not meet the rules of the language
5.1 Operating System
Candidates should be able to: Notes and guidance
Explain why a computer system requires an
Operating System (OS)
Explain the key management tasks carried out Including memory management, file
by the Operating System management, security management, hardware
management (input / output / peripherals),
process management
Show understanding of the need for typical Including disk formatter, virus checker,
utility software provided with an Operating defragmentation software, disk contents
System analysis/disk repair software, file compression,
back-up software Including:
Show understanding of program libraries • software under development is often
constructed using existing code from program
libraries.
• the benefits to the developer of software
constructed using library files, including
Dynamic Link Library (DLL) files
Hardware is the physical parts of the computer and software is the programs that run on a
computer.
There is a close relationship between hardware and software. Without software, hardware is very
limited and without hardware, software would not be able to run. They need each other.
Software:
Data and programs of computer are known as software.
There are two main types of software: systems software and application software.
System Software
System software is a software that provides platform to other software.
Systems software includes the programs that are dedicated to managing the computer itself, such
as the operating system and utility software.
Operating System
An operating system (OS) is a type of system software that manages computer’s hardware and
software resources.
It provides common services for computer programs. An OS acts a link between the software and
the hardware. It controls and keeps a record of the execution of all other programs that are
present in the computer, including application programs and other system software.
Most operating systems comprise a large set of programs, only some of which are stored in the
computer’s memory all the time. Many of the routines available in the OS are stored on the hard
drive so that they can be accessed when required. This saves space in the computer’s main
memory.
When you are using applications software, you are not communicating directly with the computer
hardware. Your applications software communicates with OS program modules that communicate
with the computer hardware on its behalf. Without an operating system, a computer is useless no
matter how many programs you have.
Why an operating system is need?
An operating system is the most important software that runs on a computer. It manages
the computer's memory and processes, as well as all of its software and hardware. It also allows
user to communicate with the computer without knowing how to speak the computer's language.
The hardware is unusable without an OS. Operating system hides complexity of hardware from
user. It acts as an interface/ controls communication between user and hardware, hardware and
software. It provides software platform / environment on which other programs can be run.
The management tasks performed by the operating system are
1. Memory Management: The OS keeps track of every memory location and is responsible for
making memory available for different processes, such as allocating free space in memory to
programs. The OS also deals with virtual memory and swapping pages in and out of RAM.The OS
keeps track of the primary memory and allocates the memory when a process requests it.
a. Memory protection to ensure that two programs do not try to use the same space,
otherwise results of processing will be incorrect.
b. Memory optimisation: To optimise the use of memory
o operating system determines which processes need to be loaded in main memory at any
one time.
o and how memory is deallocated on termination of a process.
o It also keeps track of free memory locations.
o It also swaps data between memory and HDD or SSD
c. Memory organisation: to determine how much memory is allocated to an application, and
how the memory can be split up in the most appropriate or efficient manner.
o In embedded system, a single (contiguous) allocation, where all of the memory is made
available to a single application.
o partitioned allocation, where the memory is split up into contiguous partitions (or blocks)
and memory management then allocates a partition (which can vary in size) to an
application
o paged memory, which is similar to partitioned allocation, but each partition is of a fixed size.
This is used by virtual memory systems
o segmented memory, which is different because memory blocks are not contiguous – each
segment of memory will be a logical grouping of data (such as the data which may make up
an array).
2. File Management: Allocates and de-allocates the resources and decides who gets the
resources.
• Maintains directory structures,
• Provides file naming conventions
• Performing create, copy, rename, delete etc. tasks
• Controls access of files
• Specifying file storage format like FAT or NTFS
3. Security Management: To ensure privacy, integrity and availability of data. Prevents
unauthorized access to programs and data by means of passwords.
• Keeping operating system up-to-date
• Keeping anti-virus software up-to-date
• Investigating firewall, to prevent unauthorised access
• Makes provision for recovery when data is lost for example back-up
• Provides usernames and passwords /encryption / user accounts to ensure privacy of data
• offering the ability for the recovery of data (and system restore) when it has been lost or
corrupted using back-ups etc.
4. Hardware Management
Programmers write software and users run this software. The software uses the hardware. The
operating system has to ensure that the hardware does what the software wants it to do.
Hardware management involves all input and output peripheral devices.
The functions of hardware management include
• communicating with all input and output devices using device drivers
• translating data from a file (defined by the operating system) into a format that the input/output
device can understand using device drivers
• ensuring each hardware resource has a priority so that it can be used and released as required.
The management of input/output devices is essentially the control and management of queues
and buffers. For example, when printing out a document, the printer management
• locates and loads the printer driver into memory
• sends data to a printer buffer ready for printing
• sends data to a printer queue (if the printer is busy or the print job has a low priority) before
sending to the printer buffer
• sends various control commands to the printer throughout the printing process
• receives and handles error messages and interrupts from the printer.
5. Process /resource management
A program, during execution is referred as a process. Many process are running in computer at a
time and each process needs access to computer resources.
The OS must manage the physical resources of the computer. Some resources are limited and
must be managed to maximise the use of the computer system:
- A computer system has only a fixed number of processors.
- Secondary storage is of a fixed size.
- Some input/output devices (e.g. printers) are shared.
Following process management tasks are done by operating system:
• Scheduling of processes / multi-tasking / multi-programming etc.
• Resolution of conflicts when two or more processes require the same resource using queue
etc.
6. Provision of a software platform/ environment
• The OS provides a platform on which the applications software can run.
7. Interrupt handling
Interrupts are signals sent be a hardware or a software or a user to seek attention of operating
system. Interrupts are handled by operating system like:
• Identifies priorities of interrupts
• Save current memory / process values /saves data on power outage
• Loads appropriate Interrupt Service Routine (ISR)
Disk Mirroring
Disk mirroring is a form of disk backup in which anything that is written to a disk is simultaneously
written to a second disk. This creates fault tolerance in the critical storage systems. If a physical
hardware failure occurs in a disk system, the data is not lost, as the other hard disk contains an
exact copy of that data.
Mirroring can be either hardware or software based.
Disc Defragmenter
Defragmentation is the process of reorganizing the
data stored on the hard drive so that related pieces of
data are put back together, all lined up in a continuous
fashion. Defragmentation picks up all of the pieces of
data that are spread across hard drive and puts them
back together again.
Defragmentation physically organises the contents of
the mass storage device used to store files into the
smallest number of contiguous regions (fragments, extents). It also attempts to create larger
regions of free space using compaction to impede the return of fragmentation.
Defragmentation:
– Re-organises the disk contents
– Moves split files to rearrange blocks that are used for each file to make blocks contiguous
(so that file reading is faster)
– Reduces head movements
– Creates a larger area of (contiguous) free space
Anti-virus
A computer virus is a small program that can reproduce itself. If it “infects” a computer system, a
virus can cause a range of damage including deleting files.
Antivirus software is a type of utility software used for scanning and removing viruses from
your computer. While many types of antivirus (or "anti-virus") programs exist, their primary
purpose is to protect computers from viruses and remove any viruses that are found.
Anti-virus is a software that continuously checks for viruses and is running in the background. It
indicates when / if a virus is found.
It can remove or quarantine the virus.
It checks disks and downloads for viruses automatically and asks user if they want virus scan. It is
used to protect the computer from viruses / to detect viruses
Backup software
Data backup is a utility software used to create a duplicate copy of data to safeguard it and enable
recovery. It is used to store disk contents (somewhere else) in case of disk failure, theft, natural
disaster or accidentally loss.
Backup software will:
• establish a schedule for backups
• only create a new backup file when there has been a change.
Program library
A collection of standard programs and subroutines that are stored and available for immediate
use.
Library routines are very valuable to programmers because they have already been written and
tested so the programmer is saved a lot of work; the code exists in compiled form so it does not
need to be re-compiled when it is used. Library routine is a pre-existing, pre-compiled and pre-
written modules (code). They can be linked into other program (without amendment). They are
developed to perform common. Library routines are also written for complex tasks like math
functions.
Drawbacks:
When a library routine is linked in a program, its copy is added in the executable code (every
program using a routine has to have its own copy of the routine). This increases the storage space
requirement for the executable file. It also increases memory usage when more than one process
uses the routine.
Sometime there are compatibility issues, they may not work with the other code/may require
changing program for it to work. They may need editing.
They are not tested means not guaranteed thorough testing.
There may be unknown or unexpected bugs / virus in the library routines.
Library routine may not meet exact needs or may give unexpected results.
If library routine is changed, there may be unexpected results / errors.
Why library routines are used in writing programs?
• The code is already written so the programmer is not starting over again which saves time.
• The code will have been used by many people so it should be already thoroughly tested and
relatively error-free / won’t need re-testing.
• The programmer can use e.g. mathematical / graphics functions etc. that he may not know how
to code.
• Use of named library functions can simplify the program and make it easier to read.
• The library routine code should conform to industry standards and therefore contribute towards a
more robust program.
Dynamic Linked Library (DLL)
Dynamic Linked Library is a collection of library routines that requires only a small piece of code to
be included in the main program. This allows it to link to the routine, which is stored separately in
memory, when execution of the program needs it.
The use of library (DLL) files fits exactly with strategy for managing the memory. A commercial
program such as Microsoft Word has one main executable (EXE) file which is loaded initially. The
code for other features, such as the spelling checker, could be contained in a separate DLL file
which is only loaded into main memory when required.
Advantages of DLL
DLL files are only loaded into memory when required so the executable file is smaller as the
executable does not contain all the library routines. It also saves space in memory.
The changes, improvements and error correction to the DLL file code are done independently of
the main program and as they are linked with the main program so there is no need to recompile
the main program.
Many processes can be linked to the same routine. This has the advantage that the executable
files for all programs need less storage space. Memory requirement is also minimised.
Another advantage is that if a new version of the routine becomes available it can be loaded into
memory so that any program using it is automatically upgraded.
Disadvantages of DLL
The main disadvantage of using a DLL is that the program is relying on the routine being available
and performing the expected function. If for some reason the DLL becomes corrupted or a new
version has bugs not yet discovered the program will fail or produce an erroneous result. The user
running the program will find it difficult to establish what needs to be done to get the program to
run without error.
The DLL file(s) needed to be included at run time so the executable code is not self-contained.
Appropriate (linking) software must be available at run-time to link, include or import the DLL files.
The DLL file must be present at run time otherwise (unable to find X.dll) errors.
Unexpected changes to the DLL file /corrupted DLL file and could mean the program stops
working as expected.
Malicious changes to the DLL file, could install a virus on the user’s computer and related files
could be corrupted.
1b 9618 S21 P12
7 Jennifer is writing a computer program for her A Level homework.
(a) Jennifer uses a program library to help her write her computer program.
Describe how a program library can be used while writing a computer program.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................. [2]
(b) Jennifer uses an Integrated Development Environment (IDE) to write her computer program.
(i) The IDE allows Jennifer to use both an interpreter and a compiler while creating her computer
program.
Describe the ways in which Jennifer can use both a compiler and an interpreter while developing
the program.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.............. [4]
(ii) Identify two debugging tools that a typical IDE can provide.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
1ac 9618 S21 P12_13 –
2 Bingwen’s computer comes with an Operating System and utility software.
(a) Draw one line from each utility software to its correct description. [4]
Utility software Description
Scans software for errors and repairs
the problems
(b) Identify four key management tasks that the Operating System will perform.
1 ................................................................................................................................................
2 ................................................................................................................................................
3 ................................................................................................................................................
4 ............................................................................................................................................[4]
2b 9618 W21 P12 –
7 A computer has system software.
(a) The Operating System handles interrupts.
Tick (✓) one box in each row to identify whether each event is an example of a hardware interrupt
or a software interrupt. [3]
Event Hardware interrupt Software interrupt
Buffer full
Printer is out of paper
User has pressed a key on the keyboard
Division by zero
Power failure
Stack overflow
(b) Describe the file management tasks that an Operating System performs.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.............................................................................. [4]
(c) Identify two utility programs that can be used to improve the performance of a computer and
state how they improve the performance.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................... [4]
2ac W21 P11 P13 –
4 Francis is starting his first job as a software developer for a multinational company.
(b) Francis is shown the software he will be working on. He is unfamiliar with the Integrated
Development Environment (IDE) he is required to use.
(ii) A typical IDE provides debugging tools to support the testing of a program.
Identify three other tools or features found in a typical IDE to support the writing of the program.
1 ........................................................................................................................................
2 ........................................................................................................................................
3 ........................................................................................................................................[3]
(d) Francis’s team use language translators.
Complete the descriptions of language translators by writing the missing words.
............................................... are usually used when a high-level language program is complete.
They translate all the code at the same time and then run the program.
They produce ............................................... files that can be run without the source code.
............................................... translate one line of a high-level language program at a time,
and then run that line of code. They are most useful while developing the programs because
errors can be corrected and then the program continues from that line.
Assemblers are used to translate assembly code into ............................................... . [4]
(b) The programmer wants to allow users to edit, improve and redistribute the program.
Identify two different types of software licence that the programmer could use.
1 ................................................................................................................................................
2 ............................................................................................................................................[2]
(c) Explain the benefits to the programmer of using program libraries.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.............................................................................. [3]
3b 9618 S22 P12
6 A programmer uses language translators when writing and testing a program.
(a) Describe the operation of a compiler.
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...................................................................................................................................... [2]
(b) Describe the operation of an interpreter.
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
..................................................................................................................................... [2]
(c) Explain how a programmer can make use of a typical Integrated Development Environment (IDE) when
writing and testing a program.
Writing .......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Testing ......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................... [4]
3c 9618 S22 P13
4 A computer has system software including an operating system.
(a) Describe the key management tasks of an operating system.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) Utility software is a type of system software.
(i) Describe the purpose of back-up software and defragmentation software.
Back-up software ..............................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Defragmentation software .................................................................................................
...........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [4]
(ii) Give one other example of utility software.
..................................................................................................................................... [1]
4a 9618 w22 P11
7 (a) State two benefits to a programmer of using Dynamic Link Library (DLL) files.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
................................................................................................................................................... [2]
(b) Memory management is one of the tasks performed by an Operating System (OS).
Describe the ways in which memory management organises and allocates Random Access Memory (RAM).
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(ii) Describe one benefit and one drawback of using library routines.
Benefit .........................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................
Drawback ...................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................[4]
(c) Kim develops her program and makes it ready for use. To do this, she uses first an interpreter
and then a compiler.
Explain why Kim needs to use both an interpreter and a compiler.
Interpreter .................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.............................................................................................................................
Compiler .....................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................[4]
Q 17) Summer 2019 P11
3 Kimmy has written a program in a high-level language.
(a) Kimmy has used library routines in the program.
(i) Describe two advantages of using library routines in the program.
1 ................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.....................................................................................................................................
2 .................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
..........................................................................................................................[4]
(ii) Describe what is meant by a Dynamic Link Library (DLL).
……………………………………………………………………………....................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................... [2]
(b) Three translators are compilers, interpreters, and assemblers.
(i) State one benefit of Kimmy using an interpreter during the development of the program.
............................................................................................................................................................
...................................................................................................................................... [1]
(ii) State three benefits of Kimmy using a compiler when the program is complete.
1 .................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
.................................................................................................................................................
2 ...............................................................................................................................................
............................................................................................................................................... [3]
Q 19) Summer 2019 P13
1 A computer has an operating system (OS) and utility software.
(a) The following table lists key management tasks performed by an operating system and their
descriptions.
Complete the table by writing the missing management task names and descriptions. [4]
Management task Description
Memory management
Provides user accounts and passwords
Handles the signals sent when the attention of the processor is
required elsewhere
Provision of a software
platform
(b) A hard disk formatter and a hard disk defragmenter are two examples of utility software.
(i) Describe the actions performed by a hard disk formatter and a hard disk defragmenter.
Hard disk formatter
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................
Hard disk defragmenter..............................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................................. [4]
(ii) Identify three other examples of utility software that can be installed on the computer.
1 ..................................................................................................................................................
....................................................................................................................................................
2 ..................................................................................................................................................
....................................................................................................................................................
3 ..................................................................................................................................................
………….................................................................................................................................[3]
Q 20) Winter 2019 P11
2 (b) Aaron’s computer has an operating system (OS). The OS manages the running processes
and provides a user interface. Describe these OS management tasks.
Process management ...............................................................................................................
...................................................................................................................................................
............................................................................................................................................................
..........................................................................................................................................
...................................................................................................................................................
Provision of a user interface .....................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
................................................................................................................................................ [6]
(c) Aaron’s computer has a virus checker and backup software.
Describe these utility programs.
Virus checker ..............................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
......................................................................................................................................
Backup software .......................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................. [4]
Q 21) Winter 2019 P12
1 (a) The diagram shows different types of software on the left, and descriptions on the right.
Draw a line from each type of software to its correct description. [4]
Register Description
Provides a ready-built routine that can be
imported into a program
Operating
system
Provides an interface between the user
and the hardware
Utility program
Library program
Compiler
When computers were first used programs had to be written in machine code. This code
comprised simple instructions, each of which was represented by a binary pattern in the
processor. To write programs, a programmer had to code every instruction in binary.
This not only took a long time but was prone to errors. The process of taking these programs and
setting up a computer in such a way that it would follow the instructions was so complex that only
mathematicians were capable of doing it. If this had not changed, then
we would probably not be able to use computers in the way we do today.
The problems were caused by the fact that people had to present the instructions in a form the
processor could understand, i.e. as machine operations. In order that computers could be used
anywhere other than research institutions, human beings needed a method
of communicating with the computer which was closer to human communication than to machine
operations.
As the processor cannot understand anything but binary, this implies the need for a language
which matches the computer’s instruction set. If the program written by the programmer is not in
machine code then it must be translated into machine code.
Turning assembly language into machine code
Machine code
Every processor has a set of basic machine operations which it can carry out. The complete set of
machine operations is called the instruction set for that processor. Table gives a flavour of what
machine operations are like. Each operation is represented by
a machine code (shown in binary). This is called the operation code or opcode.
Table Machine operations.
Opcode Operation
001 Add a number
010 Subtract a number
011 Input a value
100 Output a value
101 Store a value in a memory location
110 Get a value from a memory location
Some of the operations in Table need a second or third piece of data in order to carry out the
instruction. This “other” piece of data that makes up the program instruction is called the operand.
It may be a number or a memory address.
A machine instruction consists of an opcode and an operand.
Table 3.2.1 is a restricted set of operations but it serves to illustrate the workings of a processor.
Imagine that the processor stores every instruction as a byte. It would use:
● three bits for the opcode
● five bits for the operand.
This only allows 32 possible addresses but it serves as an illustration.
If the processor is given the program instruction 00100001, it splits the instruction into two parts:
001 and 00001. The opcode 001 means that something has to be added. The operand 00001 is
the address in memory of the value that has to be added. The value stored in location 00001 in
memory is added to the contents of the accumulator.
The program instruction 00100001 is therefore understandable by humans (as we have a list of
the opcodes) and the processor. However, imagine a program with thousands of instructions that
look like this. It really would be almost impossible for a human to follow. Human beings need a bit
of help. They need a language other than binary if they are going to be able to understand a large
program.
Assembly language
The first attempt at making programs more understandable was to use a mnemonic in place of the
binary opcodes, as shown in Table.
Assembly language mnemonics.
Opcode Operation Mnemonic
001 Add a number ADD
010 Subtract a number SUB
011 Input a value IN
100 Output a value OUT
101 Store a value in a memory location STO
110 Get a value from a memory location GET
Consider a program in binary and the equivalent program using mnemonics:
Machine code Assembly language Description
program program
011 0011 IN 1 Load the value 3 to the processor
001 0101 ADD 5 Add 5 to this value
100 0000 OUT Output the current value
101 1111 STO 15 Store the value at memory address 15
Note that some instructions, e.g. OUT, do not have an operand. The assembly language version
assumes we can code numbers as decimal values. Stop and think which program is easier for the
programmer to code and understand. Where exactly in the processor are these calculations taking
place? The answer is in a special register called the accumulator.
Using labels for addresses
There are still problems because the references to locations in memory are written as binary or
decimal numbers. The operand shows a particular memory address so we could give this location
a name, or label. The program in the activity above simply adds two values together. Instead of
referring to these values by their addresses (00100 and 00101), why not just call them NUM1 and
NUM2?
However, it is impossible for a computer to execute this assembly language code because it is not
in machine code. It is now necessary for the computer to use a translator program to turn the
original program into machine code. This translator program is called an assembler and programs
written in this way are said to be written in assembly language.
The assembly process is relatively simple because assembly language has a one-to-one
relationship with machine code. That is, every assembly language instruction translates into
exactly one machine code instruction.
Basically, the assembler must translate the mnemonics into binary, which is done by having a
simple lookup table with the mnemonics in one column and the binary machine code equivalents
alongside. The labels are a bit more complicated. The assembler does the translation in the same
way, but the table contents are not known before translation starts. The list of labels and their
actual memory address values have to be created by the assembler. As the program is read, the
assembler recognises the first label, NUM1, and allocates an actual memory location for NUM1
relative to the address used to store the first instruction. In this way, the assembler builds its own
lookup table of labels used by the assembly language program.
A 'two-pass' assembler is not an essential requirement but it does clearly differentiate between the
two stages that are required in translation. An assembly language program will contain features
that are used to help the programmer and others that are used to inform the assembler program.
In the first pass of a two-pass assembler all of these features are either removed or acted upon.
Typical actions are:
• removal of comments
• creation of a symbol table containing the binary codes for symbolic names and labels
• creation of a literal table if the programmer has used constants in the program
• expansion of macros
• Identification of system calls and subroutines used.
If errors are not found, the second pass of the assembler generates the object code. This involves
replacing symbolic addresses with absolute addresses.
How assembler works:
Assemblers translate from assembly language to machine code. Some assemblers scan the
assembly language program twice; these are referred to as two-pass assemblers.
12. The assembler scans the assembly language instructions in sequence.
13. When it meets a symbolic address checks to see if already in symbol table
14. If not, it adds it to the symbol table in the symbolic address column
15. If it is already in symbol table check if absolute address known
16. If the absolute address is known, it is entered in the appropriate cell
17. If the absolute address is not known mark / leave as unknown
Interpretation and compilation
We have discussed how assembly language was used to make program writing easier. Assembly
language allows the use of mnemonics and labels for memory addresses. Writing programs in
assembly language, although easier than using machine code, is still tedious and takes a long
time. Assembly languages are still “machine oriented”, i.e. their instruction set is very much in
terms
of the what the computer architecture can do.
After assembly languages, high-level languages were developed. They are closer to the language
that people use for communication. That is, the languages were designed to more closely
resemble the task or problem the computer program was attempting to solve. However, programs
written in these high-level languages also need to be translated into machine code. This is done
by a compiler or an interpreter.
2 Compiler software
''A compiler is a language translator that translates whole source program written in High Level
Language into object code in machine language before execution of program.''
Compilers translate all instructions before executions. The object code is saved as object file,
which is executable. Object files don't need compiler or language for execution.
As high-level languages are more complex and further away from machine code, so the
translators had to become more complicated. Each new programming language that was created
led to the need for a translator for that particular language called a compiler. Hence to write high-
level programs in language XYZ, the programmer must have compiler software for language XYZ.
A compiler takes a program written in a high-level language (called the source program, which is
made up of source code) and translates it into an equivalent program in machine code (called the
object program or object file, which is made up of object code). Once this is done, the machine
code version can be loaded into the machine and executed without any further involvement of the
compiler. The compilation process is shown in Figure.
The advantages of compilation are that:
● The final object (.exe) file can easily be distributed to many users.
● Once the .exe file is produced, users do not need the compiler software.
● Users have no sight of the original source code and so there is no risk that it could be changed.
The disadvantages of compilation are that:
● The final object file is only produced when all errors in the source code have been located and
fixed.
● The development process can be long-winded with several runs of the compiler before finally all
the errors are located and the object file produced.
● The compilation process uses a lot of computer resources.
During the compilation process, memory contains:
● the compiler software
● the programmer’s source code
● the resulting object code
● sufficient memory for working storage while the translation is taking place.
3 Interpreters:-
''An interpreter is a language translator that translates source program written in High Level
Language into object code in machine language during step by step execution of program.''
Computer can only understand instruction written in machine language. Interpreters translate one
by one instruction of High Level Language source code into object code of Machine Language.
Interpreter translates one instruction which is executed before translation of next instruction. The
object code is not saved so the source code is interpreted every time before the execution.
Each high level language has its own language translator.
Some programming languages are translated by an interpreter. In this process, the programmer
can attempt to run the program as soon as (some of) the source code is created. The interpreter
identifies each instruction in sequence and executes it until a statement
is found which contains an error. At this point the program terminates and the programmer is
shown the instruction in the program which generated the error.
Each instruction is executed before the next instruction is identified. This system was developed
because early personal computers lacked the power and memory needed for compilation. It is also
used in some programming for the web. Interpretation has the advantage of producing an error
message as soon as an error is encountered. This means that the instruction causing the problem
can be easily identified.
The advantages of interpretation are that:
● The programmer can attempt to run the program at any time, including before all the code has
been written.
● Debugging is generally easier and faster using an interpreter.
The disadvantages of interpretation are that:
● Execution of a program is slow compared to that of a compiled program:
- The original program has to be translated every time it is executed.
- Instructions inside a loop are translated each time the loop is entered.
● The interpreter software has to be present in memory every time an attempt is made to run the
program.
● No final .exe (object file) is produced:
- So all users of the program must have the interpreter software available.
- The code is not protected – other programmers could make unwanted changes to the code as
the source code is always present.
The best of both worlds!
Earlier version of Visual Basic – up to version 6 – provided a programming environment which
contained both an interpreter and a compiler. This enabled the programmer to use the interpreter
during program development, making the finding of errors much easier.
When the program was working, it could be translated by the compiler into machine code to speed
up program execution. The machine code version (the .exe file) could then be distributed to users
who would not have access to the original code.
Sadly the latest Visual Basic .NET versions carry out a “compilation” when the user attempts to
run the program. If errors are found and reported then they must be corrected.
Compiler Interpreter Assembler
Translates a high-level Executes a high-level language Translates a low-level
language program into program a statement at a time. language program into
machine code. machine code.
An executable file of machine No executable file of machine An executable file of
code is produced. code is produced. machine code is produced.
One high-level language One high-level language program One low-level language
statement can be translated statement may require several statement is usually
into several machine code machine code instructions to be translated into one machine
instructions. executed. code instruction.
Compiled programs are used Interpreted programs cannot be Assembled programs can be
without the compiler. used without the interpreter. used without the assembler.
2 ........................................................................................................................................
3 ................................................................................................................................... [3]
(d) Francis’s team use language translators.
Complete the descriptions of language translators by writing the missing words.
............................................... are usually used when a high-level language program is complete.
They translate all the code at the same time and then run the program.
They produce ............................................... files that can be run without the source code.
............................................... translate one line of a high-level language program at a time,
and then run that line of code. They are most useful while developing the programs because
errors can be corrected and then the program continues from that line.
Assemblers are used to translate assembly code into ............................................... . [4]
3a 9618 S22 P11 - 5 A programmer uses an Integrated Development Environment (IDE) to
develop a program.
(a) Draw one line from each IDE feature to its correct description. [4]
IDE feature Description
Executes one line of the program and then
Context-sensitive prompt
stops
Assembler
Each instruction in the source code
consists of an op code and an operand.
Interpreter
Compiler
When the source code is translated, copies of
the executable program can be distributed
without the need for the source code.
(b) The Java programming language is said to be machine or platform independent.
(i) Describe what is meant by machine independent.
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) Describe how a Java source code program is translated.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
Q 11) Winter 2017 P12
2 (a) The diagram shows three items of software that translate program code.
Draw one line from each context to the correct item of translation software. [4]
Context Item of translation
software
The source code is written in a high-level
language. An executable file is produced.
Assembler
The source code uses instructions from the
processor’s instruction set.
Interpreter
The source code and translation software
must both be in main memory at execution
time.
Compiler
A web page contains some JavaScript code.
(b) A programmer is developing software and has both a compiler and interpreter for the high-level
language used. Describe two benefits of using each form of translation software.
(i) Benefits of a compiler
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
(ii) Benefits of an interpreter
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
Q 16) Winter 2018 P11
6 Kim is using her laptop computer to write a program in a high-level language.
(c) Kim develops her program and makes it ready for use. To do this, she uses first an interpreter
and then a compiler.
Explain why Kim needs to use both an interpreter and a compiler.
Interpreter ..................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...................................................................................................................................
Compiler .....................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...............................................................................................................................[4]
Q 17) Summer 2019 P11
3 Kimmy has written a program in a high-level language.
(b) Three translators are compilers, interpreters, and assemblers.
(i) State one benefit of Kimmy using an interpreter during the development of the program.
............................................................................................................................................................
...................................................................................................................................... [1]
(ii) State three benefits of Kimmy using a compiler when the program is complete.
1 ................................................................................................................................................
..................................................................................................................................................
3 ..............................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
.................................................................................................................................................
Key terms
Data privacy – the privacy of personal information, or other information stored on a computer, that should
not be accessed by unauthorised parties.
Data protection laws – laws which govern how data should be kept private and secure.
Data security – methods taken to prevent unauthorised access to data and to recover data if lost or
corrupted.
User account – an agreement that allows an individual to use a computer or network server, often
requiring a user name and password.
Authentication – a way of proving somebody or something is who or what they claim to be. Access rights
(data security) – use of access levels to ensure only authorised users can gain access to certain data.
Malware – malicious software that seeks to damage or gain unauthorised access to a computer system.
Firewall – software or hardware that sits between a computer and external network that monitors and
filters all incoming and outgoing activities.
Anti-spyware software – software that detects and removes spyware programs installed illegally on a
user’s computer system.
Encryption – the use of encryption keys to make data meaningless without the correct decryption key.
Biometrics – use of unique human characteristics to identify a user (such as fingerprints or face
recognition).
Hacking – illegal access to a computer system without the owner’s permission.
Malicious hacking – hacking done with the sole intent of causing harm to a computer system or user (for
example, deletion of files or use of private data to the hacker’s advantage).
Ethical hacking – hacking used to test the security and vulnerability of a computer system. The hacking is
carried out with the permission of the computer system owner, for example, to help a company identify
risks associated with malicious hacking of their computer systems.
Phishing – legitimate-looking emails designed to trick a recipient into giving their personal data to the
sender of the email.
Pharming – redirecting a user to a fake website in order to illegally obtain personal data about the user.
DNS cache poisoning – altering IP addresses on a DNS server by a ‘pharmer’ or hacker with the intention of
redirecting a user to their fake website.
Data integrity – the accuracy, completeness and consistency of data.
Validation – method used to ensure entered data is reasonable and meets certain input criteria.
Verification – method used to ensure data is correct by using double entry or visual checks.
Check digit – additional digit appended to a number to check if entered data is error free.
Modulo-11 – method used to calculate a check digit based on modulus division by 11.
Checksum – verification method used to check if data transferred has been altered or corrupted,
calculated from the block of data to be sent.
Parity check – method used to check if data has been transferred correctly that uses even or odd parity.
Parity bit – an extra bit found at the end of a byte that is set to 1 if the parity of the byte needs to change
to agree with sender/receiver parity protocol.
Odd parity – binary number with an odd number of 1-bits.
Even parity – binary number with an even number of 1-bits.
Parity block – horizontal and vertical parity check on a block of data being transferred.
6.1 Data Security
Data privacy is about keeping data private rather than allowing it to be available for unauthorise
access.
The Data Protection Act
The Data Protection Act controls how your personal information is used by organisations,
businesses or the government.
Everyone responsible for using personal data has to follow strict rules called ‘data protection
principles’.
They must make sure the information is:
1. used fairly, lawfully and transparently
2. used for specified, stated purposes
3. used in a way that is adequate, relevant and limited to only what is necessary
4. accurate and, where necessary, kept up to date
5. kept for no longer than is necessary
6. Data must be processed in accordance with the data subject’s rights.
7. Data must be kept secure.
8. Data must not be transferred to another country unless that country also has adequate
protection
Loss of Data
Data loss is any process or event that results in data being corrupted, deleted and/or
made unreadable by a user and/or software or application. It occurs when one or
more data elements can no longer be utilized by the data owner or requesting
application. Data loss is also known as data leakage.
Reason Pre-caution/ Method of Recovery
Accidental deletion • Back-up
• Saving on regular basis
• Use of password so as unauthorised person can’t delete data.
Hardware failure • Back-up
• UPS (to prevent loss of data from power failure)
• Saving on regular basis
• Parallel back-up hardware
Software failure • Back-up
• Saving on regular basis
Incorrect computer • Back-up
operation • Shut down computer properly
• Remove external storage properly
Natural Disaster • Back-up
Malware
Malware (malicious software) is specifically designed to disrupt or damage a computer system, such as a
virus.
Malware, short for malicious software, is software used to disrupt computer operation, gather sensitive
information, or gain access to private computer systems. It can appear in the form of code, scripts, active
content, and other software. 'Malware' is a general term used to refer to a variety of forms of hostile or
intrusive software.
Computer virus is program or code that replicates itself and is designed to amend, delete or copy data
and files on a user’s computer without their consent.
Viruses are developed with intention to harm other computer data and programs.
Worms and Trojan horse are also types of virus.
A worm is a program that actively transmits itself over a network to infect other computers.
A Trojan horse is any program that invites the user to run it, concealing harmful or malicious code.
The Trojan Horse is a story from the Trojan War about the subterfuge that the Greeks used to enter the
independent city of Troy and win the war. In the canonical version, after a fruitless 10-year siege, the
Greeks constructed a huge wooden horse and hid a select force of men inside, including Odysseus. The
Greeks pretended to sail away, and the Trojans pulled the horse into their city as a victory trophy. That
night the Greek force crept out of the horse and opened the gates for the rest of the Greek army, which
had sailed back under cover of night. The Greeks entered and destroyed the city of Troy, ending the war.
Security Risk:
• Can delete or corrupt data and programs
• Can disrupt computer,
• Can cause computer stop working “hung”
Methods to remove risk
• Install antivirus
• Download data/programs only from authentic source
• Scan before opening email attachments or data from external source
• Install firewall
Spyware
Spyware/key-logging is software that monitors key presses on a user’s keyboard, and relays the
information back to the person who sent the software.
Spyware is a form of malware that hides on your device, monitors your activity, and steals sensitive
information like bank details and passwords.
Security Risk:
• Transmits all data typed by user to the originator of spyware e.g. email/bank id and passwords, debi
t/credit card number etc.
• Can read cookies.
• Can change default web browser
• Can install other spyware
Methods to remove risk
• Install anti-spyware software
• Install firewall
• Use on-screen keyboard to type user id and
passwords
War Driving
War driving is the act of searching for Wi-Fi wireless networks by a person usually in a moving vehicle,
using a laptop or Smartphone. It is also known as Access-Point Mapping.
Security Risk
• Uses user’s internet data/time
• May hack password and personal data
Methods to remove risk
• Use complex password
• Limit the number of users
• Firewall
• Use wired equivalent privacy (WEP) encryption
Phishing
Phishing is the act of attempting to acquire sensitive information like usernames, passwords and credit card
details by disguising as a trustworthy source. Phishing is carried out through emails or by luring the users to
enter personal information through fake websites. Criminals often use websites that have a look and feel of
some popular website, which makes the users feel safe to enter their details there.
Protection
1. The most powerful weapon against phishing is common sense and the following rules that every
user should oblige to.
2. If you are not a customer of the site delete the email immediately. Don´t click on the link or reply.
3. If you are a customer and you are not sure if the email is legit do one of the following:
a) Contact the institute by phone or contact at the official website (do not use the email link of course)
and ask if the mail is official.
b) Instead of using the link provided open the website by typing in the official link there. The site should
have news about the email on their starting page. (Most of the time). If not, use 3a to verify the
email.
Pharming:
Pharming in Simple Steps:
• Hacker creates a fake website which appears similar to the original website.
• Hacker poisons the DNS servers thus domain names are resolved into fake IP address.
• User types the URL of the original website in the browser.
• The DNS server directs User to the fake website designed by hacker.
• User not knowing that it is a fake website, shares his confidential information such as login, password
etc.
• Hacker gets the user confidential information from his fake web site and uses it to access the original
website.
• Hacker exploits user's confidential information to his liking.
Protection
• Check the URL of any site that asks you to provide personal information. Make sure your session
begins at the known authentic address of the site, with no additional characters appended to it.
• Use a trusted, legitimate Internet Service Provider. Rigorous security at the ISP level is your first line of
defense against pharming.
• Check the certificate. It takes just a few seconds to tell if a site you land on is legitimate.
• Block suspicious Websites automatically
Identify fake website
A B
Hacking
Hacking is unauthorized use of computer and network resources.
The activity of breaking into a computer system to gain an unauthorized access is known as hacking. The
act of defeating the security capabilities of a computer system in order to obtain an illegal access to the
information stored on the computer system is called hacking.
Protection:
➢ Make your passwords long and complicated, and with a good mix of letters and numbers, as well as
utilizing case-sensitive letters. Don't use anything familiar, such as your birthday, your children's names or
anything like that. If a hacker wants to attempt to break into your email accounts, at least make him work for
it.
➢ Don't ever allow your browser to remember your passwords. True, it may be a bit of an
inconvenience to enter your password every time you log in.
➢ Activate Firewall
Firewall
a firewall is a network security system that monitors and controls incoming and outgoing network traffic
based on predetermined security rules. A firewall typically establishes a barrier between a trusted internal
network and un-trusted external network, such as the Internet.
Firewalls can be implemented as
both hardware and software, or a
combination of both. Network firewalls
are frequently used to prevent
unauthorized Internet users from
accessing private networks connected
to the Internet, especially intranets. All
messages entering or leaving the
intranet pass through the firewall,
which examines each message and
blocks those that do not meet the specified security criteria.
Functions of firewall
• Monitors incoming and outgoing traffic
• checking whether incoming or outgoing data meets a given set of criteria
• if the data fails the criteria, the firewall will block the ‘traffic’ and give the user(or network manager) a
warning that there may be a security issue
• logging all incoming and outgoing ‘traffic’ to allow later interrogation by the user(or network manager)
• criteria can be set to prevent access to certain undesirable sites; the firewall can keep a list of all
undesirable IP addresses
• helping to prevent viruses or hackers entering the user’s computer (or internal network)
• warning the user if some software on their system is trying to access an external data source (e.g.
automatic software upgrade); the user is given the option of allowing it to go ahead or requesting that
such access is denied.
Limitations of firewall
• it cannot prevent individuals, on internal networks, using their own modems to bypass the firewall
• employee misconduct or carelessness cannot be controlled by firewalls (for
example, control of passwords or use of accounts)
• users on stand-alone computers can chose to disable the firewall, leaving their computer open to
harmful ‘traffic’ from the internet.
• All of these issues require management control or personal control (on a single computer) to ensure
that the firewall is allowed to do its job effectively.
Proxy server
A proxy server is a dedicated computer system running on a computer that acts as an intermediary
between a client application, such as a Web browser, and a real server.
how proxy servers work:
When a proxy server receives a
request for an Internet resource
(such as a Web page), it looks in its
local cache of previously pages. If it
finds the page, it returns it to the
user without needing to forward the
request to the Internet. If the page is
not in the cache, the proxy server,
acting as a client on behalf of the
user, uses one of its own IP
addresses to request the page from
the server out on the Internet. When
the page is returned, the proxy server relates it to the original request and forwards it on to the user.
Functions of proxy servers include:
• allowing the internet ‘traffic’ to be filtered; they can block access to a website if necessary (similar type
or reaction as a firewall)
• by using the feature known as a CACHE, they can speed up access to information from a website;
when the website is first visited, the home page is stored on the proxy server; when the user next visits
the website, it now goes through the proxy server cache instead, giving much faster access
• keeping the user’s IP address secret – this clearly improves security
• acting as a firewall.
Security Certificates
https://www.us-cert.gov/ncas/tips/ST04-014
If an organization wants to have a secure web site that uses encryption, it needs to obtain a site, or host,
certificate.
There are two elements:
➢ a closed padlock,
➢ URL that begins with "https:" rather than "http:"
If a web site has a valid certificate, it means that a certificate authority has taken
steps to verify that the web address actually belongs to that organization. When you
type a URL or follow a link to a secure web site, your browser will check the
certificate for the following characteristics:
1. The web site address matches the address on the certificate
2. The certificate is signed by a certificate authority that the browser recognizes as a "trusted" authority
If the browser senses a problem, it may present you with a dialog box that claims that there is an error with
the site certificate.
If you have chosen not to trust the company who issued the certificate, or if the certificate has expired. You
will usually be presented with the option to examine the certificate, after which you can accept the
certificate forever, accept it only for that particular visit, or choose not to accept it.
4
1 2
3
Data Encryption
Encryption is the conversion of electronic data into another form, called cipher text, which cannot be easily
understood by anyone except authorized parties.
The word encryption comes from the Greek word kryptos, meaning hidden or secret.
Encryption makes the data meaningless unless the recipient has the necessary decryption tools.
There are two types of encryption:
SYMMETRIC ENCRYPTION is a method of encryption in which one key is required to encrypt and decrypt
the data.
ASYMMETRIC ENCRYPTION (also known as Public Key Encryption)is a method of encryption in which
one key (public key) is required to encrypt and other key (private key) to decrypt the data.
Symmetric Encryption
Example Question The student is interested in how simple encryption could be applied to a text
message. One of the simplest forms of encryption is a method of ‘substitution’ where each
character has a unique substitute character.
The student uses this method with the following character substitutions:
Message character A B C D E F G H I J K L M
Substitute character P L F N O C Q U D Z V G I
Message character N O P Q R S T U V W X Y Z
Substitute character X M W J B K E A H S Y R T
Assume all messages are made up from the upper-case characters only.
Show the string after the message AT SEVEN is encrypted.
............................................................................................................................................................
............................................................................................................................................................
...................................................................................................................................................... [2]
Show the string after a cypher text “FMIWKCD IPKEOBK” is decoded.
............................................................................................................................................................
...................................................................................................................................................... [2]
Symmetric encryption uses a single key.
Explain how a message is encrypted and decrypted using symmetric encryption.
............................................................................................................................................................
............................................................................................................................................................
...................................................................................................................................................... [2]
Example Question:
In a simple symmetric encryption system, each letter of the alphabet is substituted with another.
The plain text message:
The Quick brown Fox jumps over a lazy dog.
becomes the cypher text message:
Zag towns jumpy Dmh coilv mwgu f bfke rmq
Example 2: When Alice wants to ensure that the message is sent by her (to verify the sender and message is
not altered, not to make message secure (not-understandable by others)),
she encrypts her message using her own private key.
Then the message is transmitted to Bob.
Bob decrypts the message using Alice’s public key.
The decryption of message by Alice’s public key confirms that this is Alice’s message, and is without any
alteration.
Example 3 (Exam style question): Bill, a manager of a company, sent an email with very sensitive
information to a work colleague, Alison. However, Bill also accidentally sent it to everybody in the company.
Describe the method used that ensured only Alison was able to read the original contents of the email.
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................................................................................................................
...........................................................................[4]
Answer Key
Manager encrypts email using Alison’s public key
Alison decrypts email his own private key
Data integrity refers to maintaining and assuring the accuracy and consistency of data over its entire life-
cycle, and is a critical aspect to the design, implementation and usage of any system which stores,
processes, or retrieves data.
Integrity of data:
o Sensibility of data
o Correctness of data.
• at the time of entry
• at the time of transmission
Validation is an automatic computer check to ensure that the data entered is sensible and reasonable. It
does not check the accuracy of data.
For example, a secondary school student is likely to be aged between 11 and 16. The computer can be
programmed only to accept numbers between 11 and 16. This is a range check.
However, this does not guarantee that the number typed in is correct. For example, a student's age might
be 14, but if 11 are entered it will be valid but incorrect.
A validation check is a rule that is built into a database to check that the data entered is:
• Sensible
• Reasonable
• Within acceptable boundaries
• Complete
Validation does NOT mean that the data is actually correct, that requires verification.
INPUT Marks
WHILE Marks<0 OR Marks>100 DO
PRINT “Error! Re-enter marks”
INPUT Marks
ENDWHILE
There are a number of different validation rules that can be used in a database:
Type Checks - Field data types provide a basic method of validation. Field data types are assigned to
fields during the creation of the database table and data types such as Numeric, Boolean, Date/Time and
Image restrict what can be entered. If a user tries to enter text in a date field or alphabetic characters in a
numeric field, their entry will be rejected.
Range checks - these are used to limit the range of data a user can enter. The 'day' part of a date must be
in the range 1 to 31. An exam grade should be in the range 'A'...'G' or 'U'.
Presence checks - these simply check that an entry has been made in a particular field i.e. a null value
(empty field) is not permitted. Usually, not every field in a record needs to be filled in, however there are
likely to be some that must have a value and the presence check means that the system will not allow the
record to be saved until an entry is made. An application for a passport must have the applicant's surname.
Length Checks - All alphanumeric data has a length. A single character has a length of 1 and a string of
text such as “Hello World” has a length of 11 (spaces are counted in text strings). A length check ensures
that such data is either an exact length or does not exceed a specified number of characters. Mobile phone
numbers are stored as text and should be 11 characters in length.
Lookup - A lookup check takes the value entered and compares it against a list of values in a separate
table. It can then return confirmation of the value entered or a second list based on the value. One use of
lookups restricts users to pre-defined input using drop-down lists. A user is forced to use a list box to select
from a predetermined list of valid values.
Check digits - this type of check is used with numbers. An extra 'check digit' is calculated from the
numbers to be entered and added to the end. The numbers can then be checked at any stage by
recalculating the check digit from the other numbers and seeing if it matches the one entered. One example
where a check digit is used is in the 10 digit ISBN number which uniquely identifies books.
Summary of validation
Validation
How it works Example usage
type
Checks that a value falls within the Number of hours worked must be less than 50
Range check
specified range and more than 0
Similar to Range Check but the rule >=0 means reject negative numbers. Date of
Limit Check
involves only one limit. birth must not be later than a date.
Length Checks the data isn't too short or too
A password which needs to be six letters long
check long. Values must be a specific length.
Presence Checks that data has been entered into a In most databases a key field cannot be left
check field blank
Checks that the data entered is of a given Number of brothers or sisters would be an
Type Check
data type, integer (whole number).
Checks that when a string of characters is A name would not contain characters such as %,
Character
entered it does not contain any invalid and a telephone number would only contain
Check
characters or symbols, digits or (,), and + .
Checks the data is in the right format. A candidate number, PK-500-1234 or National
Format Values must conform to a specific Insurance number is in the form LL 99 99 99 L
Check pattern, for example, two letters followed where L is any letter and 9 is any number. for
by six digits followed by a single letter Date dd/mm/yyyy or mm/dd/yyyy
The last one in a code are used to check Bar code readers in supermarkets use check
Check digit
the other digits are correct digits
Existence Checks data in a file, a file name actually
check exists
Uniqueness
Checks that a data entered is unique
check
1. Parity check
A parity check is a single bit which is added to the end of the message, and indicates that the number of
ones in the message is even or odd. If a single error occurs, the receiver could detect it because parity bits
will no longer match.
A parity check involves checking that the number of 1 bits in a byte totals to an even number (called “even
parity”) or an odd number (called “odd parity”). If two devices that are communicating decide to use odd
parity, there must always be an odd number of 1s. If a byte is received with an even number of 1s, an error
must have occurred.
For example, the byte 01011000 is sent. It has three 1 bits so it passes the odd parity check.
When it is transmitted, the byte received is 11011000. This has four 1 bits, which is an even number, so
there must have been an error in transmission. The receiving device would ask for it to be sent again.
Although this example uses odd parity, even parity can equally well be used. The two devices have to
agree which type of parity to use.
Parity is used not only during data transfer between devices but also when data are transferred between
different components of the CPU. If two mistakes are made in the same byte, they cancel each other out
and the faulty data are accepted.
This problem can be overcome and a clever way of identifying mistakes can be implemented by using
parity blocks.
A byte can represent a character code in eight bits, giving potentially 256 different characters. However, an
ASCII character reserves one of the bits for a parity bit. This leaves seven bits for the character code,
reducing the number of different characters to 128.
Parity blocks
A further check can be made on the data bytes which are transmitted. An additional byte, called the parity
byte, is calculated and transmitted for each group of bytes. The data bytes and parity byte together are
called a parity block.
A parity block is like a rectangle made up of rows and columns. The last bit in each row, i.e. in each data
byte, is the parity bit, which checks if there is an error in the byte. One possible problem with a parity bit
check is that two errors in the same byte are not picked up by the parity bit check. They are however
detected by the check which the parity byte performs.
Think of the parity byte not as data but as a whole row of parity bits, each of which is there to check the
column of bits above it in the grid. Consider the following transmission in which four data bytes are followed
by the parity byte using odd parity. The correctly transmitted parity block (four data bytes followed by the
parity byte) is shown below:
Assume that there was an error in the transmission and the bytes shown below were received by the
device. The number of 1s are counted. In a column and in a byte, number of 1s are not in odd. So there
must be an error with it. The bit intersecting erroneous column and byte is the bit with error. It should be
inverted to correct the error.
1 1 0 0 1 1 0 1
0 0 1 0 0 0 0 0
1 0 0 1 1 1 0 0
1 1 0 0 0 0 1 0
0 1 1 0 1 1 0 0
But errors in multiple bits are sometime unable to be traced out. As the number of 1s may remain in odd in
odd parity and even in even parity, then it cannot be identified.
It is claimed that checking the parity bits and using a parity block check will identify 99% of all transmission
errors.
2. Checksum
Data are normally sent as blocks of bytes rather than as individual bytes. Whatever the data represent, they
are in binary form and hence could be treated as numbers that can be added together. Another checking
procedure is to add all the bytes that are being sent in the block of data. Any bits lost at the most-significant
end as a carry are ignored, so the answer is an eight-bit number. This “check byte” or checksum is
calculated before the data are sent and then calculated again when they are received. If there are no errors
in the transmission, the two answers match. If, however, the two bytes are different there must be at least
one checksum that has been corrupted and the whole block of data has to be re-sent.
The following algorithm is used to calculate check sum:
1. Calculate file size
2. If file size<256 then
3. Checksum=file size
4. Else
5. Checksum=file size MOD 256
6. Endif
Sort the steps for Check Sum into order. Write the correct number in the column Step No.
The computer then compares its calculated check sum with the check sum received.
If the two don’t match, then the there is an error in data transmission
After a set period of time, a timeout occurs which triggers the data to be automatically
resent by the sending computer.
The sending computer waits for a period of time to see if receiving computer
acknowledges receipt of the data.
This will continue until the receiving computer acknowledges the data has been
received.
START
SEND DATA
Yes
Has Timer
timed out?
No
Acknowledgement
Received?
Yes
Transmission Successful
STOP
Check digits - this type of check is used with numbers. An extra 'check digit' is calculated from the
numbers to be entered and added to the end. The numbers can then be checked at any stage by
recalculating the check digit from the other numbers and seeing if it matches the one entered. One
example where a check digit is used is in the 10 digit ISBN number which uniquely identifies books.
The last number of the ISBN is actually the check digit for the other numbers, for example - the ISBN
0192761501.
Following two Methods are used to calculate check digit
Modulo-11 Method:
Modulo-10 Method:
Modulo-10 method is used in check digit calculation in ISBN 13, where the 13th digit of the ISBN code
is calculated using the following algorithm.
Steps Example
1. Find sum of digits at odd position
2. Find sum of digits at even position and multiply result
by 3
Statement 1: Team leaders should subscribe to and promote an ethical approach to the management
of software development and maintenance.
Statement 2: Software engineers shall participate in lifelong learning regarding the practice of the
profession.
Statement 3: Software and related modifications meet the highest possible standards.
a) These three statements need to be added to the diagram. Circle the correct numbers on the
diagram to indicate the positions for Statement 1, Statement 2 and Statement 3. [2]
b For each of these three workplace scenarios, unethical behaviour is demonstrated. Explain the
principle(s) which are not being met.
I Workplace scenario 1
A large project is devolved to project teams, each led by a project leader. One project leader fails to
inform his manager that he has major concerns that:
• their team's software contribution is taking much longer to write and test than anticipated
• they are consequently at risk of spending over their allocated budget. [3]
...................................................................................................................................................................
.................................................................................................................................
Ii Workplace scenario 2
The software house is about to train a number of programmers in a new programming language. Two
employees are refusing to attend the training. [2]
...................................................................................................................................................................
.................................................................................................................................
Iii The company is developing some monitoring software which requires sensors placed in a nature
reserve.
One employee considers the sensors will be a danger to some of the wildlife, but is told by his
manager that the matter is none of his concern. [2]
...................................................................................................................................................................
.................................................................................................................................
2 A team of software engineers is developing a new e-commerce program for a client. State three of
the principles of the ACM/IEEE Software Engineering Code of Ethics. Illustrate each one, with an
example, describing how it will influence their working practices.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
……………………………………………………………........................................................................
3 ............................................................................................................ ...........................................
…………………………………………………………..................................................................... [6]
Copyright is a legal concept, enacted by most governments, that grants the creator of an original
work exclusive rights to its use and distribution, usually for a limited time, with the intention of enabling
the creator of intellectual wealth (e.g. the photographer of a photograph or the author of a book) to
receive compensation for their work and be able to financially support themselves.
Copyright is a form of intellectual property (as patents, trademarks and trade secrets are), applicable
to any expressible form of an idea or information that is substantive and discrete.
Copyright Issues: Very briefly, copyright gives the author of a work the right...
• ...to reproduce the work.
• ...to permit copies to be made by others.
• ...to prepare derivative works.
• ...to display the copyrighted work publicly.
Plagiarism is the practice of taking someone else's work or ideas and passing them off as one's own.
“Plagiarism is the deliberate or reckless representation of another’s words, thoughts, or ideas as
one’s own without attribution in connection with submission of academic work, whether graded or
otherwise.”
Plagiarism is considered academic dishonesty and a breach of Computer ethics. It is subject to
sanctions like expulsion.
Plagiarism is not a crime per se but in academia and industry it is a serious ethical offense, and
cases of plagiarism can constitute copyright infringement.
Cracking
Software cracking is the modification of software to remove or disable features which are
considered undesirable by the person cracking the software, usually related to break license.
For open licensing there are two major operations under way. Both are global non-profit organisations.
They are very similar in what they provide but there is a difference in their underlying philosophies.
The Open Source Initiative makes open source software available. The philosophy here is that the
use of open source software will allow collaborative development of software to take place. The
software is normally made available free of charge. The source code is provided.
The user of the software is free to use it, modify it, copy it or distribute it in accordance with the terms
defined by the license.
The Free Software Foundation is so-named because the philosophy is that users should be free to
use software in any way they wish. The software is not provided entirely free of charge; there is a
small fee to cover distribution costs. The free software is still open source. However, there is a special
feature of the license which is called ‘copyleft’. This is the condition that if the software is modified the
source code for the modified version must be made available to other users under the same
conditions of usage.
Copyleft Licences
These licences contain one key restriction. Any software that you develop where you have modified
the licensed source code must be licensed using the same license as the original. This is designed to
prevent people taking the source code, improving it, and then releasing it under a propriety licence in
order to sell. It may also restrict the type of usage, for instance if software is released for personal use
only and you adapt the software, you can only release a derivative under the same personal use
licence.
If you improve the code you must allow others to use it (you can still sell a product based on the
license but you can’t stop from using the source code you created).
Artificial Intelligence
Artificial intelligence (AI) is intelligence demonstrated by machines, unlike the natural intelligence
displayed by humans and animals, which involves consciousness and emotionality.
Artificial intelligence (AI) makes it possible for machines to learn from experience, adjust to new inputs
and perform human-like tasks. Most AI examples that you hear about today – from chess-playing
computers to self-driving cars – rely heavily on deep learning and natural language processing. Using
these technologies, computers can be trained to accomplish specific tasks by processing large
amounts of data and recognizing patterns in the data.
The impact of AI
The possibility of creating thinking machines raises a host of ethical issues, related both to ensuring
that such machines do not harm humans and other morally relevant beings, and to the moral status of
the machines themselves.
People often associate AI with science fiction, fantasy and robots. Numerous films and books fuel this
association. The science fiction author, Isaac Asimov, went so far as to produce his own three laws of
robotics:
1 A robot may not injure a human through action or inaction.
2 A robot must obey orders given by humans without question.
3 A robot must protect itself unless it conflicts with the two laws above.
However, AI goes way beyond robotics. It covers an ever-increasing number of areas, such as
• autonomous (driverless) vehicles
• artificial limb technology
• drones, used to carry out dangerous or unpleasant tasks such as bomb disposal, welding, or
entering nuclear disaster areas
• climate change predictions
• medical procedures, such as eye operations where extreme precision is required.
Specimen Paper 9618/01
4 A cake factory uses machines to make cakes .
(e) The factory servers run software that makes use of Artificial Intelligence (AI).
Explain how the use of AI can help improve the safety and efficiency of the factory.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
............................................................................................................................................................ [3]
Incident Description
Tom has received some phishing emails. He reported this to the bank they were
A
supposed to have come from.
B Tom has asked his manager if they will pay for him to attend a programming course.
Tom is testing beta versions of new games software at work. He copies the software
C
on to CD-Rs and sells them to his friends.
D Tom has completed the application forms to join the Chartered Institute for IT.
Tom finds it difficult to work with one of his colleagues. His way of dealing with this
E
has been to refuse to speak with the colleague.
Tom’s manager had considered the testing of a new game was completed. Tom
F reported to his manager that he thought there were still bugs which needed to be
rectified.
(a) Draw a line on the diagram to link each of the six incidents to either ethical behaviour or
unethical behaviour.
(b) Consider each incident you have identified as ethical behaviour. [2]
Draw a line from each incident to indicate the IEEE category it maps to. [4]
8b 9608/12 Nov 18 Q5 – SoW
5 This question presents three scenarios. For each scenario, tick (✓) one box to show
whether you think the person’s behaviour is ethical or unethical. Justify your choice.
(a) Wendy is a software engineer who is developing a program for her company. Her friend,
Noah, is developing a program for a different company. Wendy looks at the code that Noah is
writing to get ideas for her own program.
Ethical
Unethical
Justification ...............................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.............................................................................................................................................. [2]
(b) Amit is fixing some bugs in the computer system of a large multinational company. He is
asked to sign a confidentiality agreement. He sees some confidential information which
contains the names of other multinational companies that have broken the law. He copies this
information and releases it on the Internet.
Ethical
Unethical
Justification .................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................. [2]
(c) Farah is providing a company with an estimate for the cost of writing a program. The
company she works for is in financial difficulty so she increases the estimate by 10%.
Ethical
Unethical
Justification ................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................. [2]
8a 9608/11 Nov 18 Q3 - SoW
3 Hugo has produced a program (app) for mobile phones. He needs to decide whether to use
an Open Source licence or to distribute the app as shareware.
(a) Describe what is meant by Open Source licence and shareware.
Open Source ............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Shareware ................................................................................................................................
..................................................................................................................................................
...............................................................................................................................................[4]
(b) Tick ( ) one box to indicate the licence Hugo should use. Justify your choice.
Open Source
Shareware
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
8a 9608/11 Nov 18 Q5 - SoW
5 For each of the following scenarios, tick ( ) one box for each scenario to indicate whether
you think the person’s behaviour is ethical or unethical. Justify your choice.
(a) Kevin is a software engineer who has recently started a job with a new company. He is
using program code from his previous employer in his new employer’s programs.
Ethical
Unethical
Justification ...............................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
...........................................................................................................................................[2]
(b) Nadya is a software developer. She has accepted a new job. She has never worked with
the programming languages used by this new company. Nadya is planning to increase her
knowledge of these programming languages before she starts her new job.
Ethical
Unethical
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) Maria finds that one of her team members has produced some inventive code. She
presents this to her manager, stating that it was produced by the team. She does not mention
the individual’s name.
Ethical
Unethical
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
1b 9618 S21 P12
8 A company has several security measures in place to prevent unauthorised access to the
data on its computers.
(a) Describe the difference between the security and privacy of data.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Each employee has a username and password to allow them to log onto a computer. An
employee’s access rights to the data on the computers is set to either read-only, or read and
write. Identify one other software-based measure that could be used to restrict the access to
the data on the computers.
.....................................................................................................................................................
........................................................................................................................................... [1]
(c) The company is also concerned about threats posed by networks and the internet.
Identify two threats to the data that are posed by networks and the internet.
Threat 1 ....................................................................................................................................
...................................................................................................................................................
Threat 2 ....................................................................................................................................
..............................................................................................................................................[2]
1ac 9618 S21 P12_13 – 6 Each of the following algorithms performs data validation.
State the type of validation check that each of the algorithms performs.
(a)
INPUT x
IF x < 0 OR x > 10 THEN
OUTPUT "Invalid"
ENDIF
............................................................................................................................................. [1]
(b)
INPUT x
IF x = "" THEN
OUTPUT "Invalid"
ENDIF
.............................................................................................................................................. [1]
(c)
INPUT x
IF NOT(x = "Red" OR x = "Yellow" OR x = "Blue") THEN
OUTPUT "Invalid"
ENDIF
.............................................................................................................................................. [1]
2b 9618 W21 P12 - 1 When designing computer systems, it is important to consider the
security, integrity and privacy of the data.
Draw one line from each measure to indicate whether it keeps data secure or protects the
integrity of data. [2]
Measure
Firewall
Presence check
Access rights
2ac W21 P11 P13 –
2 Xanthe wants to maintain the integrity and security of data stored on her computer.
(a) Explain the difference between data security and data integrity.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Xanthe uses both data validation and data verification when entering data on her computer.
(i) Describe how data validation helps to protect the integrity of the data. Give an example in your
answer.
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Example ............................................................................................................................ [2]
(ii) Describe how data verification helps to protect the integrity of the data. Give an example in your
answer.
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Example ............................................................................................................................ [2]
(c) Two malware threats are spyware and viruses.
Give two similarities and one difference between spyware and a virus.
Similarity 1 ................................................................................................................................
...................................................................................................................................................
Similarity 2 ................................................................................................................................
...................................................................................................................................................
Difference .................................................................................................................................
................................................................................................................................................... [3]
2ac W21 P11 P13 –
5 (b) Describe the ways in which access rights can be used to protect the data in Javier’s
database from unauthorised access.
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
.....................................................................................................................................................
............................................................................................................................................. [3]
3a 9618 S22 P11 –
3 A teacher is writing examination papers on a laptop computer. The computer is connected to the
internet. The teacher is concerned about the security and privacy of the papers.
(a) State the difference between the security of data and the privacy of data.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Identify and describe two threats to the data. Identify one security measure to protect against
each threat. Each security measure must be different.
Threat 1 ....................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
Security measure ......................................................................................................................
Threat 2 ....................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
Security measure ...................................................................................................................... [6]
3b 9618 S22 P12
4 A school stores personal data about its staff and students on its computer system.
(a) Explain why the school needs to keep both its data and its computer system secure from
unauthorised access.
Data ..........................................................................................................................................
...................................................................................................................................................
Computer system .....................................................................................................................
...............................................................................................................................................[2]
(b) Complete the table by identifying two security threats to the data on a computer.
Describe each threat. Give a different prevention method for each threat. [6]
Prevention
Threat Description
method
Pharming
anti-virus software
scans files on the hard drive for
malicious software
Encryption
accepts or rejects incoming and
outgoing packets based on criteria
1abSummer 15 P11-12
6 (ii) Describe one way of ensuring the security of the data against malicious damage.
...................................................................................................................................................................
..............................................................................................................................................[1]
1cSummer 15 P13
3 (a) Give the definition of the terms firewall and authentication. Explain how they can help with the
security of data.
Firewall .............................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..............................................................................................................................
Authentication ..................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
......................................................................................................................................[3]
(b) Describe two differences between data integrity and data security.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................................ [2]
(c) Data integrity is required at the input stage and also during transfer of the data.
(i) State two ways of maintaining data integrity at the input stage. Use examples to help explain your
answer.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
(ii) State two ways of maintaining data integrity during data transmission. Use examples to help
explain your answer.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................[3]
2ac Winter 15 P11, P13
9 (a) Give a brief description of each of the following terms:
Validation ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Verification ................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(b) Data are to be transferred between two devices. Parity checks are carried out on the data.
Explain what is meant by a parity check. Give an example to illustrate your answer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
10 (a) Explain the term computer virus.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(b) A virus checker has been installed on a PC.
Give two examples of when a virus checker should perform a check.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................[2]
2b Winter 15 P12
8 Verification and validation can be applied during data entry.
Describe what is meant by these terms. For each method, explain why it is needed.
Verification ........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Validation ..........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
......................................................................................................................................................[4]
3abSummer 16 P11, 12
5 Three types of software licensing and four descriptions are shown in the table below. [4]
Put a tick (✓) in each row to match each description to the appropriate type of software licensing.
Type of software
Description Open source Shareware Commercial
Software is purchased before it can be used
Source code comes with the software
Software is provided free on a trial basis
The software can be modified by the user
6 A team of software engineers is developing a new e-commerce program for a client.
State three of the principles of the ACM/IEEE Software Engineering Code of Ethics. Illustrate each
one, with an example, describing how it will influence their working practices.
1 .......................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
3 .......................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
......................................................................................................................................................[6]
3c Summer 16 P 13
3 A company needs new software to manage its accounts. It is evaluating two different options. One
option is open source software and the other is commercial software.
(a) Explain what is meant by open source software.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................................................[2]
(b) Explain what is meant by commercial software.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................[2]
(c) The company has decided to purchase commercial software.
Identify four benefits to the company in choosing the commercial software option.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
4 ................................................................................................................................................
...............................................................................................................................................[4]
5 (a) A Database Management System (DBMS) provides the following features.
(b) The school needs to safeguard against any data loss.
Describe three factors to consider when planning a backup procedure for the data.
Justify your decisions.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
7 A bank holds personal data about its customers and their financial data.
(a) Describe the difference between security and integrity of data.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
(b) Describe three security measures that the bank could implement to protect its electronic data.
Security measure 1 ...................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Security measure 2 ...................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Security measure 3 ...................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
(a) (i) Describe how the data logger calculates the parity bit for each of the bytes in the data block.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................[2]
(ii) State the two missing parity bits labelled A and B.
A = ..............................
B = .............................. [1]
(iii) Describe how the computer uses the parity byte to perform a further check on the received data
bytes.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................[2]
(b) (i) A second data block is received as shown in the following table. There are errors in this data
block. Identify and then circle two bits in the table which must be changed to remove the errors [2]
(ii) Explain how you arrived at your answers for part (b)(i).
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................[3]
7 The design of a web-based application can require the use of client-side scripting.
(iv) Describe the purpose of the validation check that the code performs.
...........................................................................................................................................
.......................................................................................................................................[1]
(v) Name and describe two other types of validation check that could be appropriate for this data
capture form.
Validation check: ...............................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
Validation check: ...............................................................................................................
Description ........................................................................................................................
...........................................................................................................................................[4]
5b Summer 17 P12
6 Downloading a file from a website is an example of a client-server application.
(iv) Describe the purpose of the validation check that the code performs.
...........................................................................................................................................
.......................................................................................................................................[1]
(v) Name and describe two other types of validation check which could be appropriate for this data
capture form.
Validation check: ...............................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
Validation check: ...............................................................................................................
Description ........................................................................................................................
...........................................................................................................................................[4]
6ac Winter 2017 P11, P13
3 A Local Area Network is used by staff in a hospital to access data stored in a Database
Management System (DBMS).
(a) Name two security measures to protect computer systems.
1 ................................................................................................................................................
2 ................................................................................................................................................ [2]
(b) A frequent task for staff is to key in new patient data from a paper document. The document
includes the patient’s personal ID number.
(i) The Patient ID is a seven digit number. The database designer decides to use a check digit to verify
each foreign key value that a user keys in for a Patient ID.
When a user assigns a primary key value to a Patient ID, the DBMS adds a modulus-11 check digit as
an eighth digit. The DBMS uses the weightings 6, 5, 4, 3, 2 and 1 for calculating the check digit. It
uses 6 as the multiplier for the most significant (leftmost) digit.
Show the calculation of the check digit for the Patient ID with the first six digits 786531.
(c) A task for staff at the start of the school year is to key in new pupil data from a paper document.
The data is entered to a screen form and includes the data verification of some fields.
Describe what is meant by verification.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.............................................................................................................................[2]
5 The IEEE Software Engineering Code of Ethics uses eight key principles shown in the right-hand
column of the following diagram.
Tom is employed as a tester with a software company. He is keen to become a trainee programmer.
The middle column in the diagram labels six incidents which have happened to Tom this week. The
table that follows the diagram describes each incident.
Incident Description
Tom has received some phishing emails. He reported this to the bank they were supposed
A
to have come from.
B Tom has asked his manager if they will pay for him to attend a programming course.
Tom is testing beta versions of new games software at work. He copies the software on to
C
CD-Rs and sells them to his friends.
D Tom has completed the application forms to join the Chartered Institute for IT.
Tom finds it difficult to work with one of his colleagues. His way of dealing with this has
E
been to refuse to speak with the colleague.
Tom’s manager had considered the testing of a new game was completed. Tom reported to
F
his manager that he thought there were still bugs which needed to be rectified.
(a) Draw a line on the diagram to link each of the six incidents to either ethical behaviour or unethical
behaviour.
(b) Consider each incident you have identified as ethical behaviour. [2]
Draw a line from each incident to indicate the IEEE category it maps to. [4]
7a Summer2018 P11
6 Parity bits can be used to verify data.
(a) The following binary number is transmitted using even parity.
Add the missing parity bit. [1]
(b) In the following parity block, the first column contains the parity bits, and the last row contains the
parity byte. A device transmits the data using even parity.
(i) Circle the error in the data transmitted. [1]
Parity
Data
bit
1 1 0 1 0 1 1 1
1 0 0 0 1 1 1 0
0 1 0 0 1 0 1 1
1 1 1 0 1 1 1 1
Parity
1 1 1 1 1 0 0 1
byte
(ii) Explain how you identified the error.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...............................................................................................................................[2]
(c) The data received can contain errors that are not detected using parity bits.
Explain how this can happen.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................................................[2]
(d) Parity is not the only method to verify the data has been sent correctly.
Name and describe one other method of data verification during data transfer.
Name ........................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
7b Summer2018 P12
3 Parity bits can be used to verify data.
(a) The following binary number is transmitted using odd parity. Add the missing parity bit. [1]
(b) In the following data transmitted, the first column contains the parity bits, and the last row
contains the parity byte. A device transmits the data using even parity.
Circle the error in the data transmitted. [1]
Parity
Data
bit
1 0 1 0 1 1 1 1
0 1 1 0 0 1 1 0
1 1 0 0 0 0 0 0
0 1 0 0 0 0 0 0
Parity
0 0 0 0 1 0 0 1
byte
(c) The following table shows five error detection measures.
Put one tick (3) in each row to indicate whether the measure is validation or verification.[5]
Measure Validation Verification
Checksum
Format check
Range check
Double entry
Check digit
7c Summer 2018 P13
2 A company writes applications (apps) for smart phones. The company has a relational database,
PURPLEGAME, which stores the information for one of its online game apps.
(b) The database manager is concerned about data integrity.
State what is meant by data integrity. Give an example of how the manager can ensure data
integrity in the PURPLEGAME database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
4 Parity bits can be used to verify data.
(a) The following binary number is transmitted using odd parity.
Add the missing parity bit. [1]
(b) In the following parity block, the first column contains the parity bits, and the last row contains the
parity byte. A device transmits the data using even parity.
Circle the error in the data being transmitted. [1]
Parity Data
bit
0 0 1 1 0 1 0 1
1 1 1 1 1 0 0 1
1 0 1 0 1 0 0 0
0 0 0 1 1 0 1 1
Parity
0 1 1 1 1 1 0 1
byte
(c) Four error detection measures are shown.
Draw one line from each error detection measure to indicate whether it is verification or validation.[4]
Error detection measure
Type check
Verification
Proof reading
Checksum
8a Winter 2018 P11
3 Hugo has produced a program (app) for mobile phones. He needs to decide whether to use an
Open Source licence or to distribute the app as shareware.
(a) Describe what is meant by Open Source licence and shareware.
Open Source ............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Shareware ................................................................................................................................
..................................................................................................................................................
...................................................................................................................................................[4]
(b) Tick ( ) one box to indicate the licence Hugo should use. Justify your choice.
Open Source
Shareware
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
5 For each of the following scenarios, tick ( ) one box for each scenario to indicate whether you think
the person’s behaviour is ethical or unethical. Justify your choice.
(a) Kevin is a software engineer who has recently started a job with a new company. He is using
program code from his previous employer in his new employer’s programs.
Ethical
Unethical
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(b) Nadya is a software developer. She has accepted a new job. She has never worked with the
programming languages used by this new company. Nadya is planning to increase her knowledge of
these programming languages before she starts her new job.
Ethical
Unethical
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) Maria finds that one of her team members has produced some inventive code. She presents this to
her manager, stating that it was produced by the team. She does not mention the individual’s name.
Ethical
Unethical
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
8BWinter 2018 P11
5 This question presents three scenarios. For each scenario, tick (✓) one box to show whether you
think the person’s behaviour is ethical or unethical. Justify your choice.
(a) Wendy is a software engineer who is developing a program for her company. Her friend, Noah, is
developing a program for a different company. Wendy looks at the code that Noah is writing to get
ideas for her own program.
Ethical
Unethical
Justification ........................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
........................................................................................................................................ [2]
(b) Amit is fixing some bugs in the computer system of a large multinational company. He is asked to
sign a confidentiality agreement. He sees some confidential information which contains the names of
other multinational companies that have broken the law. He copies this information and releases it on
the Internet.
Ethical
Unethical
Justification ......................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
....................................................................................................................................... [2]
(c) Farah is providing a company with an estimate for the cost of writing a program. The company she
works for is in financial difficulty so she increases the estimate by 10%.
Ethical
Unethical
Justification .....................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................... [2]
9a Summer 2019 P11
2 A software company produces software and distributes it under different software licences.
(a) Four descriptions of software licences are given.
Write the type of software licence that best fits each description. Use a different type of licence for
each description.
1. The software can be legally used, only after a fee has been paid.
Licence type ...................................................................................................................................
2. The source code comes with the software. If the software is modified, the edited source code must
be released under the same conditions as the original software.
Licence type .....................................................................................................................................
3. The software is free for a trial period and then a fee is requested, or expected, if the user wants to
continue to use the software.
Licence type ................................................................................................................................
4. The source code comes with the software. The software is free to be downloaded, edited, and
distributed, possibly without restriction.
Licence type ................................................................................................................................[4]
4 A software developer works in a team for a large software development company.
(a) Two principles of the ACM/IEEE Software Engineering Code of Ethics are:
• developers must act consistently with the public interest
• developers must act in the best interest of their client and employer.
Name and describe three other principles in the ACM/IEEE Software Engineering Code of Ethics.
Principle 1 .........................................................................................................................................
Description ......................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................................
Principle 2 ........................................................................................................................................
Description .......................................................................................................................................
...................................................................................................................................................................
....................................................................................................................................................
Principle 3 .......................................................................................................................................
Description .......................................................................................................................................
...................................................................................................................................................................
............................................................................................................................................. [6]
(b) The software development company uses data backup and disk-mirroring to keep their data
secure.
Explain how data backup and disk-mirroring allow the company to recover from data loss.
Data backup .....................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
............................................................................................................................................
Disk-mirroring ...................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
........................................................................................................................................[4]
9bSummer 2019 P12
4 Shazia is creating a computer program that will be released to the public. The program includes a
video.
(d) Shazia wants to make sure her computer program is copyrighted.
(i) Define the term copyright.
...................................................................................................................................................................
.............................................................................................................................................. [1]
(ii) Shazia does not want to release the software as open source.
Explain why Shazia does not want to use an open source licence.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................................. [2]
(iii) Name and describe two software licenses, other than open source that Shazia could use.
License 1 .........................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................................
License 2 .........................................................................................................................................
...................................................................................................................................................................
..............................................................................................................................................[2]
5 Moheem is creating a relational database to store data about his customers.
(b) Moheem uses a Database Management System (DBMS) to ensure the security and integrity of
the data.
(i) Explain the difference between security and integrity.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................................... [2]
(ii) Name and describe two security features provided by a DBMS.
Feature 1 .........................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...........................................................................................................................................
Feature 2 ........................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................... [4]
9cSummer 2019 P13
2 Frankie is a software developer. He is developing a program to manage customer records for a
client with an online retail business. He must ensure that data stored about each customer are both
secure and private.
(a) State the difference between security and privacy.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.............................................................................................................................. [2]
(b) Computer systems can be protected by physical methods such as locks.
Describe two non-physical methods used to improve the security of computer systems.
1 .......................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................
2 .....................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
........................................................................................................................[6]
(c) A computer uses parity blocks to check the data that has been received is the same as the data
that has been transmitted.
The following is an example of a parity block.
Parity
Data
bit
1 1 1 1 0 0 0 1
0 0 0 0 1 1 1 0
1 1 0 1 1 0 0 1
Parity
1 1 0 1 1 0 0 1
byte
(i) Describe how a parity block check can identify a bit that has been corrupted during transmission.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
......................................................................................................... [4]
(ii) Give a situation where a parity block check cannot identify corrupted bits.
...................................................................................................................................................................
............................................................................................................................................. [1]
(d) One principle of the ACM/IEEE Software Engineering Code of Ethics is to always act in the best
interest of the client.
Explain how Frankie can ensure that he is acting in the best interest of his client.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.................................................................................................. [3]
(e) When the program is complete, Frankie uses a compiler to prepare the program for the client.
Explain why Frankie uses a compiler instead of an interpreter.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
................................................................................................... [3]
10b Winter 2019 P12
5 Mica has created some software and has copyrighted it. She wants to stop other people from
copying and changing it illegally.
(a) Identify two ways Mica can prevent illegal copies of the software being installed.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
................................................................................................................................................... [2]
(b) Identify one way Mica can distribute the software without the source code.
...................................................................................................................................................
............................................................................................................................................. [1]
(c) Mica is releasing the software under a commercial licence.
(i) Give two benefits to Mica of using a commercial licence.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
(ii) Name two other types of software licence.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
........................................................................................................................................... [2]
10C Winter 2019 P13
1 In a supermarket, a self-checkout machine allows customers to scan the barcodes of products and
then pay for their shopping. These are an alternative to the traditional cashier-staffed checkout.
(c) The self-checkout machines connect to a server that stores all the data for the supermarket.
This is a client-server network.
(ii) The supermarket is concerned about the security and integrity of the data on the server.
Identify two methods that can be used to minimise the security risk to the data, and one
method to protect the integrity of the data.
Security 1 ..........................................................................................................................
...........................................................................................................................................
Security 2 ..........................................................................................................................
...........................................................................................................................................
Integrity .............................................................................................................................
........................................................................................................................................... [3]
11a Summer 20 P1
1 A computer program makes use of data validation routines and verification of data input.
(a) Complete these two sentences about data validation and verification.
1. ................................................. checks that the data entered is reasonable. One example is
.................................................... .
2. ................................................. checks that the data entered is the same as the original. One
example is .................................................... . [4]
(b) The program is installed on a computer system that has security measures in place to protect its
data. [3]
Complete the following table.
Security measure Description
.............................................................................................
Encryption
.............................................................................................
.............................................................................................
Presence check
Access rights
Two different validation checks are described using each of the following flowcharts.
Name the types of validation check.
1abSummer 15 P11-12
1cSummer 15 P13
2ac Winter 15 P11, P13
2b Winter 15 P12
3abSummer 16 P11, 12
3c Summer 16 P 13
5ac Summer 2017 P11_13
5b Summer 17 P12
6ac Winter 2017 P11, P13
6b Winter 2017 P12
7a Summer2018 P11
7b Summer2018 P12
7c Summer 2018 P13
8a Winter 2018 P11
8BWinter 2018 P11
9a Summer 2019 P11
9bSummer 2019 P12
9cSummer 2019 P13
10b Winter 2019 P12
10C Winter 2019 P13
11a Summer 20 P1
11b Summer 2020 P12
11c Summer 2020 P13
12a Winter 20 Paper 11
Specimen Paper 9618/01
Database management system (DBMS) – systems software for the definition, creation and
manipulation of a database.
Data management – the organisation and maintenance of data in a database to provide the
information required.
Data dictionary – a set of data that contains metadata (data about other data) for a database.
Data modelling – the analysis and definition of the data structures required in a database and to
produce a data model.
Logical schema – a data model for a specific database that is independent of the DBMS used to build
that database.
Access rights (database) – the permissions given to database users to access, modify or delete data.
Developer interface – feature of a DBMS that provides developers with the commands required for
definition, creation and manipulation of a database.
Structured query language (SQL) – the standard query language used with relational databases for
data definition and data modification.
Query processor – feature of a DBMS that processes and executes queries written in structured query
language (SQL).
Data definition language (DDL) – a language used to create, modify and remove the data structures
that form a database.
Data manipulation language (DML) – a language used to add, modify, delete and retrieve the data
stored in a relational database.
SQL script – a list of SQL commands that perform a given task, often stored in a file for reuse.
Databases
A database is a stored collection of information arranged in a logical, structured manner.
Flat file or File-based database:
In File-based database text files are used to store data while is flat file data is stored in one table.
Problems in flat- file or file-based database
1. The data privacy issue with a single file
A different problem is a lack of data privacy. The file above was designed so that the finance section
could find banking details and the recruitment section could find contact details. The problem is that
there cannot be any control of access to part of a file, so for example, staff in the recruitment section
would be able to access the banking details of members. Data privacy would be properly handled by a
database system.
2. Potential duplication. As more and more records are added to the database it becomes difficult to
avoid duplicate records. This is because there is no mechanism built in to the system to prevent
duplication. Later you will see how 'primary keys' are used to prevent this.
3. Non-unique records. Flat-file database doesn’t have unique field (primary key).
4. Inherently inefficient. Consider a situation where the database now needs to hold an extra field to
hold their email address. If there are tens of thousands of records, there may be many people having
no email address, but each record in a flat file database has to have the same fields, whether they are
used or not. Other methods avoid this wasted storage.
5. Harder to change data format. Suppose the telephone numbers now have to have a dash between
the area code and the rest of the number, like this 0223-44033. Adding that extra dash over tens of
thousands of records would be a significant task in a flat file database.
6. Poor at complex queries. If we wanted to find all records with a specific telephone number, this is a
simple single-field criteria that a flat file can easily deal with. But now suppose we wanted all people
living in Hull who share the same surname and similar postcode? - the criteria can quickly become too
complex for a flat file to manage.
7. Poor at limiting access. Suppose this flat file database held a confidential field in each record that
only certain staff are allowed to see - perhaps salaries. This is difficult to achieve in a flat file database
- once a person has entered a valid password to gain access, that person is able to see everything.
Because of these limitations other types of database have been developed. The next few pages will
describe these and their features.
Relational database
A relational database holds its data over a number of tables instead of one. Records within the tables
are linked (related) to records held in other tables.
Advantages of a relational database
Splitting data into a number of related tables brings many advantages over a flat file database. These
include:
1. Data is only stored once. In the previous example, the city data was gathered into one table so now
there is only one record per city. The advantages of this are
• No multiple record changes needed
• More efficient storage
• Simple to delete or modify details.
• All records in other tables having a link to that entry will show the change.
2. Complex queries can be carried out. A language called SQL has been developed to allow
programmers to 'Insert', 'Update', 'Delete', 'Create', 'Drop' table records. These actions are further
refined by a 'Where' clause. For example
SELECT * FROM Customer WHERE ID = 2
This SQL statement will extract record number 2 from the Customer table. Far more complicated
queries can be written that can extract data from many tables at once.
3. Better security. By splitting data into tables, certain tables can be made confidential. When a
person logs on with their username and password, the system can then limit access only to those
tables whose records they are authorised to view. For example, a receptionist would be able to view
employee location and contact details but not their salary. A salesman may see his team's sales
performance but not competing teams.
4. Cater for future requirements. By having data held in separate tables, it is simple to add records
that are not yet needed but may be in the future. For example, the city table could be expanded to
include every city and town in the country, even though no other records are using them all as yet. A
flat file database cannot do this.
Security measures in RDBMS
Following steps are taken in Relational Database Management System to resolve security issues
related with File-Based and flat file database:
• Issue usernames and passwords...
• stops unauthorised access to the data
• any further expansion e.g. strong passwords / passwords should be changed regularly etc.
• Access rights / privileges...
• so that only relevant staff / certain usernames can read/edit certain parts of the data
• can be read only, or full access / read, write and delete
• any relevant example e.g. only class tutors can edit details of pupils in their tutor group
• Create (regular / scheduled) backups...
• in case of loss/damage to the live data a copy is available
• any relevant example e.g. backing up the attendance registers at the end of each day and
storing the data off-site/to a separate device
• Encryption of data...
• if there is unauthorised access to the data it cannot be understood // needs a decryption key
• any relevant example e.g. personal details of pupils are encrypted before being sent over the
Internet to examination boards
• Definition of different views...
• composed of one or more tables
• controls the scope of the data accessible to authorised users
• any relevant example e.g. teachers can only see their classes
• Usage monitoring / logging of activity...
• creation of an audit /activity log
• records the use of the data in the database / records operations performed by all users / all
access to the data
• any relevant example, e.g. Track who changed a student’s grade
Entity-Relationship model
An Entity–relationship model (ER model) describes the structure of a database with the help of a
diagram, which is known as Entity Relationship Diagram (ER Diagram). An ER model is a design or
blueprint of a database that can later be implemented as a database.
An ER model is typically implemented as a database. In a simple relational database implementation,
each row of a table represents one instance of an entity type, and each field in a table represents an
attribute type. In a relational database a relationship between entities is implemented by storing the
primary key of one entity as a pointer or "foreign key" in the table of another entity.
Candidate key: In some cases there may be more than one attribute for which unique values are
guaranteed. In this case, each one is a candidate key and one will be selected as the primary key.
A field that could be chosen as the primary key
Primary key: an attribute (field) or a combination of attributes for which there is a value in each tuple
(record) and that value is unique
Secondary key: A candidate key that is not selected as the primary key is then referred to as a
secondary key.
Foreign key: an attribute in one table that refers to the primary key in another table.
Referential integrity: the use of a foreign key to ensure that a value can only be entered in one table
when the same value already exists in the referenced table
One-to-One
One-to-Many
Many-to-One
Many-to-Many
One-to-one relationship
In a relational database, a one-to-one relationship exists when one row in a table may be linked with only one
row in another table and vice versa.
For Example: A country has only one capital city, and a capital city
is the capital of only one country.
One-to-many relationship
One book can have many pages. One page can only be in one book.
Many-to-many relationship
An Author can write several Books, and a Book can be written by several Authors.
A many-to-many relationship is a type of cardinality that
refers to the relationship between two entities A and B in
which A may contain a parent instance for which there are
many children in B and vice versa.
Specimen Paper 21
3 Mehrdad has a holiday company database that includes:
• data about holidays, such as the location, date, duration (in days)
• data about the customers and the holidays they have booked.
(a) Mehrdad has normalised the database, which has three tables.
(i) Draw an entity–relationship (E–R) diagram for the normalised tables.
(ii) Complete the table to identify the primary key and foreign key(s) for each of the tables you
identified in part (a)(i). If the table has no foreign key(s), write ‘None’.
.......................................................................................................................................[1]
3c Summer 16 P 13
5 (c) The database design has three tables to store the qualifications and grades each student has
attained. The following is a sample of the data from each table.
STUDENT
StudentID FirstName LastName Tutor
001AT Ahmad Tan 11A
003JL Jane Li 11B
011HJ Heather Jones 10A
QUALIFICATION
QualCode Level Subject
CS1 IGCSE Computer Science
MT9 IGCSE Maths
SC12 IGCSE Science
STUDENT-QUALIFICATION
QualCode StudentID Grade DateOfAward
SC12 011HJ A 31/8/2014
SC12 003JL C 31/8/2014
CS1 003JL B 31/8/2014
(i) Draw an Entity-Relationship (E-R) diagram to show the relationships between these three tables.
[2]
(ii) State the type of relationship that exists between STUDENT and STUDENT-QUALIFICATION.
.......................................................................................................................................[1]
4b Winter 2016 P12
9 A health club offers classes to its members. A member needs to book into each class in advance.
(a) The health club employs a programmer to update the class booking system. The programmer
has to decide how to store the records. The choice is between using a relational database or
a file-based approach.
Give three reasons why the programmer should use a relational database.
1 .........................................................................................................................................
..........................................................................................................................................
..........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
..........................................................................................................................................
3 .......................................................................................................................................
..........................................................................................................................................
..........................................................................................................................................
...................................................................................................................................[6]
(b) The programmer decides to use three tables: MEMBER, BOOKING and CLASS.
Complete the Entity-Relationship (E-R) diagram to show the relationships between these tables.[2]
5ac Summer 2017 P11_13
1 A hospital is divided into two areas, Area A and Area B. Each area has several wards. All the ward
names are different.
A number of nurses are based in Area A. These nurses always work on the same ward. Each nurse
has a unique Nurse ID of STRING data type.
(i) Explain what the degree of relationship is between the entities B-NURSE and B-WARD.
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) The design for the Area B data is as follows:
B-NURSE(NurseID, FirstName, FamilyName, Specialism)
B-WARD(WardName, NumberOfBeds, Specialism)
B-WARD-NURSE( ............................................................................................................ )
Complete the attributes for the third table. Underline its primary key. [2]
(iii) Draw the relationships on the entity-relationship (E-R) diagram.[2]
5b Summer 17 P12
1 Some shops belong to the Rainbow Retail buying group. They buy their goods from one or more
suppliers. Each shop has:
• a unique shop ID
• a single retail specialism (for example, food, electrical, garden).
Each supplier has:
• a unique supplier ID
• a similar single specialism recorded.
Rainbow Retail creates a relational database to record data about the shops and their suppliers. The
entity-relationship (E-R) diagram for the relationship between the SHOP and SUPPLIER tables is
shown.
(a) Explain what the degree of relationship is between the entities SHOP and SUPPLIER.
...................................................................................................................................................
...............................................................................................................................................[1]
Foreign key(s)(if
Table Primary key Explanation
any)
SHOP
SUPPLIER
SHOP–
SUPPLIER
(iii) The database designer has implemented SUPPLIER.ContactPerson as a secondary key.
Describe the reason for this.
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.................................................................................................................................... [2]
6ac Winter 2017 P11, P13
7 A clinic is staffed by several doctors. The clinic serves thousands of patients. Each day and at any
one time, there is only one doctor in the clinic available for appointments.
The clinic stores patient, doctor and appointment data in a relational database.
(a) (i) Underline the primary key for each table in the following suggested table designs.
PATIENT(PatientID, PatientName, Address, Gender)
DOCTOR(DoctorID, Gender, Qualification)
APPOINTMENT(AppointmentDate, AppointmentTime, DoctorID, PatientID) [2]
(ii) Complete the following entity-relationship (E-R) diagram for this design. [2]
Summer 20 P13
6 Sheila creates a relational database for her hotel using a Database Management System (DBMS).
(a) Draw one line from each database term to its most appropriate description.
[4]
Attribute
Primary key
Foreign key
Entity
(b) Identify three tasks that Sheila can perform using the DBMS developer interface.
1 ................................................................................................................................................
2 ................................................................................................................................................
3 ................................................................................................................................................ [3]
Normalisation
“A technique for designing relational database tables to minimize duplication of information and, in so
doing, to safeguard the database against certain types of logical or structural problems”
Normalisation is the process of analysing how to make databases more efficient by using separate
tables to reduce redundant data. When a database is normalised, data is broken down into smaller
tables and relationships are used to link them.
Normalisation provides rules that help:
• organise the data efficiently.
• eliminate redundant data.
• ensure that only related data are stored in a table.
The tables are now in first normal form (1NF) as they obey the following rules
• Each table has a primary key
• Each field name is unique
• Data is atomic
• No repeating / redundant fields
Try Yourself A first attempt at the table design is:
MANAGER(ManagerName, Telephone, BandName, Genre, NumberInBand, SetFee)
ManagerName Telephone BandName Genre NumberInBand SetFee($)
Yi Ling Chen 908765 Rachael Daz Covers 1 200
Yi Ling Chen 908765 Jazz Tones Modern jazz 4 450
Lockwood Bros 674442 Midnight Blues Modern jazz 5 350
Lockwood Bros 674442 Loose Beats Dance 3 400
Lockwood Bros 674442 Asyraf Duo Covers 2 250
Lockwood Bros 674442 The Flying Fleas Hip hop 8 700
Rachael Wang 118976 Li Wei Chen Covers 1 250
Gig Associates 567575 Buster Beats Reggae 6 600
Gig Associates 567575 Hits Forever Covers 3 300
Gig Associates 567575 Rap Incorporated Hip hop 5 800
State why the table MANAGER is not in First Normal Form (1NF).
...................................................................................................................................................................
Redesign the database table to bring it into 1st Normal Form.
Try Yourself A first attempt at the database design produced the following single table CUSTOMER.
Table: CUSTOMER
CustomerID CustomerName City OrderDate ProductID
043 Wilber London 10-09-15 678
043 Wilber London 21-09-15 883
043 Wilber London 28-10-15 883
928 Said Manchester 09-05-15 241
928 Said Manchester 18-07-15 906
493 Tasha Glasgow 11-09-15 005
351 Ahmed Liverpool 10-10-15 187
351 Ahmed Liverpool 11-10-15 154
Table: SALESPRODUCTS
FirstName ProductName NoOfProducts
Nick television set 3
Nick Refrigerator 2
Nick digital camera 6
Sean hair dryer 1
Sean electric shaver 8
John television set 2
John mobile phone 8
John digital camera 4
John Toaster 3
Now there is no partial dependency in SALESPRODUCTS table, so it is qualifying for 2NF. Because of
following reasons:
• Non-key attributes depend on every part of the primary key
• The table is already in first normal form
Test Yourself
BAND(BandName, NumberOfMusicians, Genre, ManagerID, ManagerName, ManagerPhoneNumber)
VENUE(VenueName, Capacity)
BOOKING(BandName, PerformanceDate, StartTime, VenueName, NumberOfMusicians)
(i) Name the table that is not in Second Normal Form (2NF) and explain why.
Table .................................................................
Explanation ................................................................................................................................................
....................................................................................................................................................................
...................................................................................................................................................................
Re-design this table to put it into 2NF.
..............................................................................................................................................................[4]
Test Yourself A sports centre has a gym and a swimming pool. The sports centre has members.
A member is given a unique membership number when they join.
Different types of membership are available:
• J – Junior
• SF – Senior full
• SG – Senior gym only
• SS – Senior swim only
Members who use the gym are assigned a personal trainer.
Sports centre employees are identified with a unique three-character code.
An employee can be a personal trainer to one or more members.
The sports centre organises classes. Each class has a unique class name.
Each class is taken by an employee who acts as the class leader. An employee may be a class
leader for zero, one or more classes.
Members can take classes. Each class has a class code. Some classes are assigned a level:
• B – beginners
• I – intermediate
• A – advanced
A relational database is to be created to store data about members, employees, classes and class
attendance. The following table design MEMBER was a first attempt at the database design.
Table: MEMBER
MemberNo MemberType Trainer ClassName ClassLevel ClassLeader
510 SF SAF Yoga B B OLO
510 SF SAF Box fit B DAV
510 SF SAF Zumba B ROG
808 SS OLO Swimathon A ROG
756 J DAV Circuits I VAR
756 J DAV Box fit I DAV
756 J DAV Yoga A A OLO
756 J DAV Body pump A CFD
(a) (i) State why the table is not in First Normal Form (1NF).
…………………………………………………………………………………………………..............................................................................
..............................................................................................................................................................................[1]
(ii) Comment on your answer by referring to the data in the table.
………………….................................................................................................................................................[1]
(ii) Using the data given in the original table, show three rows stored in table MEMBERCLASSES.
The MemberNo should be different for each row. [2]
Table: MEMBERCLASSES
MemberNo ClassName ClassLevel ClassLeader
(iii) Using the data given in the original table, state how many rows would be in table
MEMBERCLASSES.
.......................................................................................................................................[1]
(iv) State the relationship between MEMBER and MEMBERCLASSES.
.......................................................................................................................................[1]
(v) Explain how the relationship is implemented.
....................................................................................................................................................................
....................................................................................................................................................................
...........................................................................................................................................................[2]
(c) The following new design for MEMBERCLASSES was suggested in part (b):
MEMBERCLASSES(MemberNo, ClassName, ClassLevel, ClassLeader)
(i) State the primary key for this table.
.......................................................................................................................................[1]
(ii) Explain why the table is not in Second Normal Form (2NF).
...........................................................................................................................................
.......................................................................................................................................[2]
(iii) The solution is to create a new third table.
Show the revised design including the primary keys.
MEMBER(MemberNo, MemberType, Trainer)
MEMBERCLASSES(............................................................................................................)
............................(............................................................................................................) [3]
(d) Each type of membership has a fixed annual membership fee. The new table design for
member data is:
MEMBER(MemberNo, MemberType, MemberTypeFee, Trainer)
(i) The revised MEMBER table is not in Third Normal Form (3NF).
Explain this statement.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...............[2]
(ii) The solution is to create a new fourth table.
Show the revised design including the primary keys.
MEMBER(...........................................................................................................................)
.............(...........................................................................................................................) [2]
Summary
Benefits of normalisation
1. The database does not have redundant data, it is smaller in size so less money needs to be spent on
storage
2. Because there is less data to search through, it is much faster to run a query on the data
3. Because there is no data duplication there is better data integrity and less risk of mistakes.
4. Because there is no data duplication there is less chance of storing two or more different copies of
the data
5. Once change can be made which can instantly be cascaded across any related records.
Problems with normalisation
1. You need to be careful with trying to make data atomic. Just because you can split some types of
data further, it isn't always necessarily the correct thing to do. For example, telephone number might
contain the code followed by the number 0213 567890. It wouldn't be sensible to separate out these
two items.
2. You can end up with more tables than an unnormalised database
3. The more tables and the more complex the database, the slower queries can be to run
4. It is necessary to assign more relationships to interact with larger numbers of tables
5. With more tables, setting up queries can become more complex
Summary
The purpose of normalisation is to avoid redundant data and to make it easier to maintain a database by only
having to update a record in one place only.
Unnormalised form (0NF)
• Data might be repeated
• Data might be non-atomic
• The table might not have a primary key
• There might be repeating fields i.e. each field does not have a unique name
First normal form (1NF)
• There are no columns with repeated or similar data
• Each data item cannot be broken down any further.
• Each row is unique i.e. it has a primary key
• Each field has an unique name
Second normal form (2NF)
• The table must already be in 1NF
• Non-key attributes must depend on every part of the primary key
Third Normal form (3NF)
• The table must already be in 2NF
• There are no non-key attributes that depend on another non-key attribute
Try Yourself
1 A monthly magazine reviews new music releases.
Each music release has a title and a genre. The genre codes are as follows:
• J – Jazz
• P – Pop
• C – Classical
The magazine employs a number of people as reviewers. Reviewers are located all over the world.
A reviewer is identified by a unique three-digit code.
A relational database is to store data for reviews which appear in the magazine.
The data stored for each review are:
• music title
• music genre
• release date
• month and year when the review appeared
The following table REVIEWER was a first attempt at the database design.
Table: REVIEWER
ReviewerID Location Title Genre ReleaseDate ReviewDate
510 London Hits 36 P 12/01/2015 01-15
510 London Cindy pop P 26/03/2015 03-15
510 London Way out P 11/06/2015 07-15
808 New York Popular Bach C 12/01/2015 02-15
808 New York Ultimate Cole J 31/01/2015 02-15
756 Dhaka The Messiah C 11/11/2014 11-14
756 Dhaka Hot Miles J 02/02/2015 03-15
756 Dhaka Pine points J 11/04/2015 05-15
756 Dhaka Kylie P 11/04/2015 05-15
(a) (i) State why the table is not in First Normal Form (1NF).
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) Comment on your answer by referring to the data in the table.
...........................................................................................................................................
.......................................................................................................................................[1]
(b) The design is changed so that there are two tables:
REVIEWER(ReviewerID, Location)
REVIEW(Title, Genre, ReleaseDate, ReviewDate, ReviewerID)
The primary keys are not shown.
(i) Using the data given in the original table, show the data now stored in table REVIEWER. [1]
Table: REVIEWER
ReviewerID Location
(ii) Using the data given in the original table, show three rows now stored in table REVIEW.
The ReviewerID should be different for each row in the table. [2]
Table: REVIEW
Title Genre ReleaseDate ReviewDate ReviewerID
(iii) Using the data given in the original table, how many rows would be in table REVIEW?
........................................................ [1]
(iv) State the degree of relationship between REVIEW and REVIEWER.
.......................................................................................................................................[1]
(v) Explain how the relationship in part(b)(iv) is implemented.
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(c) Each title is reviewed once only. The database designer decides to also store the reviewer’s
name. A reviewer is paid a set fee for each review completed. The fee paid is determined by the music genre:
Genre Fee($)
J 150
P 100
C 200
The following revised design for REVIEW is suggested:
REVIEW(Title, ReviewerID, ReviewerName, Genre, Fee, ReleaseDate, ReviewDate)
(i) State the primary key for this table.
.......................................................................................................................................[1]
(ii) Explain why the REVIEW table is not in Third Normal Form (3NF).
..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
.............................................................................................................................................................................[2]
(iii) Currently the design is as follows:
REVIEWER(ReviewerID, Location)
REVIEW(Title, ReviewerID, ReviewerName, Genre, Fee, ReleaseDate, ReviewDate)
Re-design the solution to solve the issue in part (c)(ii). Show all primary keys.
..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
...........................................................................................................................................................................[5]
8.2 Database Management System (DBMS)
2. Complex queries can be carried out. A language called SQL has been developed to allow
programmers to 'Insert', 'Update', 'Delete', 'Create', 'Drop' table records. These actions are further
refined by a 'Where' clause. For example
SELECT * FROM Customer WHERE ID = 2
This SQL statement will extract record number 2 from the Customer table. Far more complicated
queries can be written that can extract data from many tables at once.
3. Better security. By splitting data into tables, certain tables can be made confidential. When a
person logs on with their username and password, the system can then limit access only to those
tables whose records they are authorised to view. For example, a receptionist would be able to view
employee location and contact details but not their salary. A salesman may see his team's sales
performance but not competing teams.
4. Cater for future requirements. By having data held in separate tables, it is simple to add records
that are not yet needed but may be in the future. For example, the city table could be expanded to
include every city and town in the country, even though no other records are using them all as yet. A
flat file database cannot do this.
Summary - advantages of a relational database over flat file
• Avoids data duplication
• Avoids inconsistent records
• Easier to change data
• Easier to change data format
• Data can be added and removed easily
• Easier to maintain security.
Following steps are taken in Relational Database Management System to resolve security issues
related with File-Based and flat file database:
• Issue usernames and passwords...
• stops unauthorised access to the data
• any further expansion e.g. strong passwords / passwords should be changed regularly etc.
• Encryption of data...
• if there is unauthorised access to the data it cannot be understood // needs a decryption key
• any relevant example e.g. personal details of pupils are encrypted before being sent over the
Internet to examination boards
A school stores a large amount of data that includes student attendance, qualification and contact
details. The school is setting up a relational database to store these data.
(b) The school needs to safeguard against any data loss.
Describe three factors to consider when planning a backup procedure for the data.
Justify your decisions.
1 ................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................................................
2 ................................................................................................................................................................
...................................................................................................................................................................
..................................................................................................................................................................
3 ...............................................................................................................................................................
...................................................................................................................................................................
..............................................................................................................................................................[6]
8.3 Data Definition Language (DDL) and Data Manipulation Language (DML)
Structured Query Language (SQL) is a specialized language for updating, deleting, and requesting
information from databases. SQL is an ANSI and ISO standard, and is the de facto standard database
query language. A variety of established database products support SQL, including products from
Oracle and Microsoft SQL Server. It is widely used in both industry and academia, often for enormous,
complex databases.
In a distributed database system, a program often referred to as the database's "back end" runs
constantly on a server, interpreting data files on the server as a standard relational database.
Programs on client computers allow users to manipulate that data, using tables, columns, rows, and
fields. To do this, client programs send SQL statements to the server. The server then processes these
statements and returns result sets to the client program.
Indeed, proficiency with SQL is one of the most sought after computing skills. This is the language that
DBMS software or relational database software uses for:
• Basic database design
• inserting a record
• deleting records
• amending records.
Difference between CHARACTER and VARCHAR
CHARACTER
1. Used to store character string value of fixed length. It is used when a fixed length value is to be
stored in a filed. For example to store 5 character long employee code a field EmpCode of data type
CHARACTER(5) is used. If a data item of lesser characters like 3 characters are stored 2 spaces will be
added in the field. i.e. the field will occupy 5 characters.
2. The maximum no. of characters the data type can hold is 255 characters.
3. It's 50% faster than VARCHAR.
4. Uses static memory allocation.
VARCHAR
1. Used to store variable length alphanumeric data. For example in a field EmpName of type
VARCAHR(20), if a name “Abdullah” is entered, this field will occupy the 8 character size.
2. The maximum this data type can hold is up to
• Pre-MySQL 5.0.3: 255 characters.
• Post-MySQL 5.0.3: 65,535 characters shared for the row.
3. It's slower than CHARACTER.
4. Uses dynamic memory allocation.
CREATE
To create a database and a table:
(
RollNo : INTEGER NOT NULL,
Name : VARCHAR(20),
Class: VARCHAR(4),
SECTION: VARCHAR(2),
);
StMarks
SNo RollNo Month Marks
RollNo is primary key in StData table and foreign key in StMarks table.
To create these tables and set primary and foreign keys following commands are used:
CREATE TABLE StData
(
RollNo: INTEGER PRIMARY KEY,
Name : VARCHAR(20),
Class: VARCHAR(5),
SECTION : VARCHAR(20)
);
CREATE TABLE StMarks
(
SNo : INTEGER PRIMARY KEY NOT NULL,
RollNo : INTEGER NOT NULL,
Month: varchar(6),
Marks : REAL,
FOREIGN KEY (RollNo) REFERENCE StData(RollNo) );
Where the primary key is "product_id" and all the other attributes are declared within the ( )
structure and are followed by a comma.
DROP
To delete a database or a table
ALTER
An ALTER statement in SQL changes the properties of a table in a relational database without the
need to access the table manually.
To add field Result in Marks table
ALTER TABLE Marks
ADD Result VARCHAR(4);
This would display all the Name and class of students who are in section K and class is AS.
This would display all the Name and class of students who are in section K or in section T.
name: Peter
numScars: 7
UPDATE staff
SET numScars = 8;
But we have a problem here, this statement updates all records to numScars = 8. This means that every staff
will now have 8 scars!
ID name gender DoB town Points
1 Geoff male 12/05/1982 Hull 8
2 Jane female 05/08/1956 York 8
3 Keith male 07/02/1999 Snape 8
4 Oliver male 22/08/1976 Blaxhall 8
5 Patel female 11/11/1911 East Ham 8
6 Marea female 14/07/1940 Wythenshawe 8
We need to specify which staff we want to update by using a WHERE clause, you saw it earlier in the SELECT
example.
UPDATE staff
SET Points = 10
WHERE name = "Patel"; --only updates those people who are called Peter
UPDATE Marks
SET Result=”Pass” --store “Pass” in all students’ result.
UPDATE StudentsMarks
SET Result=”Pass”
WHERE Marks>=50 --store “Pass” in students’ result if marks are 50 or above.
INSERT
We might also want to add new things to our database, for example when we are adding new Criminal records
or a new friendship link on Facebook. To add new records we use the INSERT command with values of the
fields we want to insert:
Sometimes we might not want to insert all the fields, some of them might not be compulsory:
INSERT INTO staff (ID, name, town) --specific fields to insert into
VALUES (999, 'Frederick', 'Shotley');
DELETE
You might also want to delete a staff record, then you need a DELETE command to do all of these
things, to permanently delete records from databases. Imagine that record of Geoff is to be deleted:
COUNT()
The COUNT() function returns the number of rows that matches a specified criterion.
Syntax:
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
Example:
To count number of records:
SELECT COUNT(RollNo)
FROM Marks;
Example
To Count number of Students who are pass:
SELECT COUNT(Result)
FROM Marks
WHERE Result=”Pass”;
To Count number of Students who are pass:
SELECT COUNT(Result)
FROM Marks
WHERE Result=”Pass”;
GROUP BY Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
Demo Database
Below is a selection from the "Customers" table in the Northwind sample database:
SQL GROUP BY Examples
Example
To count pass and fail students
SELECT COUNT(RollNo)
FORM Marks
GROUP By Result;
The following SQL statement lists the number of customers in each country:
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country;
Example
The following SQL statement lists the number of customers in each country, sorted high to low:
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country
ORDER BY COUNT(CustomerID) DESC;
GROUP BY With JOIN Example
Example
The following SQL statement lists the number of orders sent by each shipper:
Exercise:
List the number of customers in each country.
SELECT
(CustomerID),
Country
FROM Customers ;
Test Yourself A sports centre has a gym and a swimming pool. The sports centre has members.
A member is given a unique membership number when they join.
Different types of membership are available:
• J – Junior
• SF – Senior full
• SG – Senior gym only
• SS – Senior swim only
Members who use the gym are assigned a personal trainer. Sports centre employees are identified with a
unique three-character code. An employee can be a personal trainer to one or more members.
The sports centre organises classes. Each class has a unique class name.
Each class is taken by an employee who acts as the class leader. An employee may be a class
leader for zero, one or more classes.
Members can take classes. Each class has a class code. Some classes are assigned a level:
• B – beginners
• I – intermediate
• A – advanced
A relational database is to be created to store data about members, employees, classes and class
attendance. The following table design MEMBER was a first attempt at the database design.
Table: MEMBER
MemberNo MemberType Trainer ClassName ClassLevel ClassLeader
510 SF SAF Yoga B B OLO
510 SF SAF Box fit B DAV
510 SF SAF Zumba B ROG
808 SS OLO Swimathon A ROG
756 J DAV Circuits I VAR
756 J DAV Box fit I DAV
756 J DAV Yoga A A OLO
756 J DAV Body pump A CFD
(a) (i) State why the table is not in First Normal Form (1NF).
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) Comment on your answer by referring to the data in the table.
................................................................................................................................................ [1]
(ii) Using the data given in the original table, show three rows stored in table MEMBERCLASSES.
The MemberNo should be different for each row. [2]
Table: MEMBERCLASSES
MemberNo ClassName ClassLevel ClassLeader
(iii) Using the data given in the original table, state how many rows would be in table
MEMBERCLASSES.
.......................................................................................................................................[1]
(iv) State the relationship between MEMBER and MEMBERCLASSES.
.......................................................................................................................................[1]
(v) Explain how the relationship is implemented.
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(c) The following new design for MEMBERCLASSES was suggested in part (b):
MEMBERCLASSES(MemberNo, ClassName, ClassLevel, ClassLeader)
(i) State the primary key for this table.
.......................................................................................................................................[1]
(ii) Explain why the table is not in Second Normal Form (2NF).
...........................................................................................................................................
.......................................................................................................................................[2]
(iii) The solution is to create a new third table.
Show the revised design including the primary keys.
MEMBER(MemberNo, MemberType, Trainer)
MEMBERCLASSES(............................................................................................................)
............................(............................................................................................................) [3]
(d) Each type of membership has a fixed annual membership fee. The new table design for
member data is:
MEMBER(MemberNo, MemberType, MemberTypeFee, Trainer)
(i) The revised MEMBER table is not in Third Normal Form (3NF).
Explain this statement.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(ii) The solution is to create a new fourth table.
Show the revised design including the primary keys.
MEMBER(...........................................................................................................................)
.............(...........................................................................................................................) [2]
0 9618/1 Specimen paper Q3 - SoW
3 Mehrdad has a holiday company database that includes:
• data about holidays, such as the location, date, duration (in days)
• data about the customers and the holidays they have booked.
(a) Mehrdad has normalised the database, which has three tables.
(i) Draw an entity–relationship (E–R) diagram for the normalised tables.
(ii) Complete the table to identify the primary key and foreign key(s) for each of the tables you
identified in part (a)(i). If the table has no foreign key(s), write ‘None’.
(iii) Explain why the holiday database is in Third Normal Form (3NF).
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
........................................................... [2]
(b) The holiday company has several members of staff. The database has two additional tables to
store data about the staff.
STAFF(StaffID, FirstName, SecondName, DateOfBirth, Role, Salary)
SCHEDULE(ScheduleID, StaffID, WorkDate, Morning, Afternoon)
The following table shows some sample data from the table SCHEDULE.
ScheduleID StaffID WorkDate Morning Afternoon
210520-1 BC 21/05/2020 TRUE TRUE
210520-2 JB 21/05/2020 TRUE FALSE
220520-1 BC 22/05/2020 FALSE TRUE
220520-2 LK 22/05/2020 TRUE FALSE
(i) Write an SQL script to display the first name and second name of all staff members working on
22/05/2020.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.......................................................................................................................................................... [4]
(ii) Write an SQL script to count the number of people working on the morning of 26/05/2020.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.............................................................................................................................................................. [3]
1b 9618 S21 P12
1 Raj owns houses that other people rent from him. He has a database that stores details about the
people who rent houses, and the houses they rent. The database, HOUSE_RENTALS, has the following
structure:
CUSTOMER(CustomerID, FirstName, LastName, DateOfBirth, Email)
HOUSE(HouseID, HouseNumber, Road, Town, Bedrooms, Bathrooms)
RENTAL(RentalID, CustomerID, HouseID, MonthlyCost, DepositPaid)
(a) Give the definition of the following database terms, using an example from the database
HOUSE_RENTALS for each definition. [6]
Term Definition and example
..............................................................................................................................
Field
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
Entity
..............................................................................................................................
..............................................................................................................................
..............................................................................................................................
Foreign key
..............................................................................................................................
..............................................................................................................................
(b) Give the highest level of Normal Form (NF) the database MARKS is in and justify your choice.
Normal Form ............................................................................................................................................
Justification ...............................................................................................................................................
....................................................................................................................................................................
................................................................................................................................................................[3]
(c) (i) Sample data to be stored in the table STUDENT_TEST is shown.
StudentID TestID Mark
12 A1 50
12 P10 100
13 A1 75
14 P10 60
Write a Structured Query Language (SQL) script to create the table STUDENT_TEST.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................... [5]
(ii) Write a Structured Query Language (SQL) script to find the average mark of students in test A7.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................................................................................ [3]
(d) The mark a student is awarded in a test will be entered into the database. This mark needs to be a
whole number between 0 and the maximum number of marks for that test (inclusive).
Explain how data validation and data verification can be used when a mark is entered.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
............................................................................................................................................................ [4]
3b 9618 S22 P12
5 A database, FILMS, stores information about films and actors.
Part of the database is shown:
ACTOR(ActorID, FirstName, LastName, DateOfBirth)
FILM_FACT(FilmID, FilmTitle, ReleaseDate, Category)
FILM_ACTOR(ActorID, FilmID)
(a) Complete the entity-relationship (E-R) diagram. [2]
(b) A composite primary key consists of two or more attributes that together form the primary key.
Explain why the table FILM_ACTOR has a composite primary key.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................................................. [2]
(c) Complete the SQL script to return the IDs of all the actors in the film with the title Cinderella.
SELECT .......................................................................................
FROM FILM_ACTOR
INNER JOIN ........................................................................................
ON FILM_FACT.FilmID = ..............................................................................
WHERE FILM_FACT.FilmTitle = .............................................................................. ; [4]
(d) Write an SQL script to count the number of films that were released in January 2022.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
................................................................................................................................................................ [3]
(e) A Database Management System (DBMS) is used to create and manipulate the database.
Complete the descriptions of the features and tools found in a DBMS using the given terms.
Not all terms will be used.
Boolean data dictionary data redundancy field names
input Interface logical schema Normalisation
operating system Output primary keys Query
Structure
A DBMS provides data management. This includes the development of a .......................................................
that stores information about the data stored, such as ................................... and ......................................... .
The ....................................................... uses methods, such as an E-R diagram, to show the structure of the
database and its relationships.
The ....................................................... processor allows a user to perform searches to find specific data. The
DBMS also provides a developer ....................................................... that allows the user to create tables, forms
and reports. [6]
3c 9618 S22 P13
6 A relational database, TECHNOLOGY, stores data about the staff in a company and the computer
devices used by the staff.
The database has the following tables:
STAFF(StaffID, FirstName, LastName, DateOfBirth, JobTitle)
DEVICE(DeviceID, Type, DatePurchased, StaffID)
(a) Describe the relationship between the two tables. Refer to the primary and foreign keys in your
answer.
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.......................................................................................................................................................... [4]
(b) The database uses a Data Definition Language (DDL) and Data Manipulation Language (DML).
(i) Complete the SQL script to return the number of devices stored in the database for the staff
member with the first name ‘Ali’ and last name ‘Khan’.
SELECT .............................................................. (STAFF.StaffID)
FROM ..............................................................
INNER JOIN DEVICE
.............................................................. STAFF.StaffID = DEVICE.StaffID
WHERE STAFF.FirstName = 'Ali'
.............................................................. STAFF.LastName = 'Khan'; [4]
(ii) The table DEVICE needs a new attribute to store whether the device has been returned by the
staff member, or not.
Write a Structured Query Language (SQL) script to insert the new attribute into the table DEVICE.
....................................................................................................................................................................
....................................................................................................................................................................
........................................................................................................................................................... [2]
(c) The database is in Third Normal Form (3NF).
Complete the table by describing the three normal forms. [3]
Normal Form Description
...............................................................................................
First Normal Form (1NF) ...............................................................................................
...............................................................................................
...............................................................................................
...............................................................................................
Second Normal Form (2NF) ...............................................................................................
...............................................................................................
...............................................................................................
...............................................................................................
Third Normal Form (3NF) ...............................................................................................
...............................................................................................
...............................................................................................
5a 9618 S23 q11
2 An organisation uses a database to store data about the types of bird that people have seen.
(a) The database is managed using a Database Management System (DBMS).
(i) State what is meant by a data dictionary and give one example of an item typically found in a data
dictionary.
Definition ...........................................................................................................................
...........................................................................................................................................
Example ............................................................................................................................
........................................................................................................................................... [2]
(ii) State what is meant by data integrity and give one example of how this is implemented in a database.
Definition ...........................................................................................................................
...........................................................................................................................................
Example ............................................................................................................................
........................................................................................................................................... [2]
(b) The database, Birds, stores information about the types of bird and the people who have seen them.
Data about each bird seen is stored with its location and data about the person who saw the bird.
Database Birds has the following tables:
BIRD_TYPE(BirdID, Name, Size)
BIRD_SEEN(SeenID, BirdID, Date, Location, PersonID)
PERSON(PersonID, FirstName, LastName, EmailAddress)
(i) Complete the table by identifying two foreign keys and the database table where each is found.[2]
First Normal Form (1NF) All fields are fully dependent on the primary key.
2(a)(i) 2
1 mark for definition:
Data about the data in the database // data about the structure of the
database // metadata for a database
BirdID BIRD_SEEN
PersonID BIRD_SEEN
Example answer:
CREATE TABLE BIRD_TYPE(
BirdID CHAR(4) NOT NULL,
Name VARCHAR(9),
Size VARCHAR(6),
PRIMARY KEY (BirdID)
);
Name Description
Data dictionary
..................................................................................................
..................................................................................................
..................................................................................................
Query processor
..................................................................................................
..................................................................................................
..................................................................................................
.........................................
A model of a database that is not specific to one DBMS.
.........................................
.........................................
A software tool that allows the user to create items such as tables,
......................................... forms and reports.
[4]
(b) Explain the reasons why referential integrity is important in a database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) The database Lessons has the following tables:
HORSE(HorseID, Name, Height, Age, HorseLevel)
STUDENT(StudentID, FirstName, LastName, RiderLevel, PreferredHorseID)
LESSON(LessonID, Date, Time, StudentID, HorseID, LessonContent)
Dates in this database are stored in the format #DD/MM/YYYY#.
The fields RiderLevel and HorseLevel can only have the values: Beginner, Intermediate or
Advanced.
(i) Describe two methods of validating the field RiderLevel.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
........................................................................................................................................... [2]
(ii) Write a Structured Query Language (SQL) script to return the names of all the horses that have the horse
level intermediate or beginner.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(iii) The following SQL script should return the number of riders that have the rider level beginner and have a
lesson booked on 09/09/2023.
SELECT SUM(STUDENT.RiderLevel) AS NumberOfRiders
FROM STUDENT, LESSON
WHERE StudentID = StudentID
OR Date = #09/09/2023#
AND STUDENT.RiderLevel = Beginner;
There are four errors in the script. Identify and correct each error.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
...........................................................................................................................................
4 ........................................................................................................................................
........................................................................................................................................... [4]
Question Answer Marks
Feature Description
2(c)(iii) 4
1 mark each
Term Description
........................................
An object that data is stored about.
........................................
..................................................................................................
Tuple ..................................................................................................
..................................................................................................
..................................................................................................
Secondary key ..................................................................................................
..................................................................................................
........................................
A field in one table that is linked to a primary key in another table.
........................................
(c) The car rental database is not normalised. The current database design is:
BOOKING(CarRegistration, StartDate, EndDate,
CarModel, CarColour, CustomerFirstName)
CUSTOMER(CustomerFirstName, CustomerLastName, EmailAddress,
TelephoneNumber)
Write a normalised database design for this database.
All tables must be in Third Normal Form (3NF).
Use the field names given and underline the primary key fields.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................................................. [4]
(d) The data is validated and verified when it is entered into the database.
(i) The car registration number must be: 1 letter, followed by 3 numbers, followed by 2 letters.
For example, A123AA is valid but A12AA is invalid.
One way that a registration number can be validated is by using a presence check to make sure the
registration number has been entered.
Describe two other ways that the car registration number can be validated.
1 ................................................................................................................................................................................
...................................................................................................................................................................................
2 ................................................................................................................................................................................
.............................................................................................................................................................................. [2]
(ii) Describe two ways that the car registration number can be verified when it is entered into the database.
1 ................................................................................................................................................................................
...................................................................................................................................................................................
2 ................................................................................................................................................................................
.............................................................................................................................................................................. [2]
(iii) State why the car registration number might be incorrect even after it has been validated and verified.
………………………………………..........................................................................................................................................
............................................................................................................................................................................. [1]
4(a) 1 mark for each bullet point. Mark in pairs. Max 2 for each description. 4
Term Description
• Only 3 tables with appropriate identifiers (i.e. one table for customer, one for
booking and one for car)
• Appropriate Primary key in each table underlined
• Booking table includes Primary key from car and Primary key from customer as
Foreign keys
• All original fields are in correct tables
Example answer:
BOOKING(BookingID, CarRegistration, CustomerID,
StartDate, EndDate)
CAR(CarRegistration, CarModel, CarColour)
CUSTOMER(CustomerID, CustomerFirstName,
CustomerLastName, EmailAddress, TelephoneNumber)
4(d)(i) 1 mark each to max 2 2
• Visual check: Manually compare the registration number entered with the
source document
• Double entry: Enter the registration number twice and the computer compares
to check they are the same
4(d)(iii) The registration number on the original document might be in the correct format but 1
may be the incorrect registration number for that car.
Summer 2019 P13
3 A company uses a relational database, EMPLOYEES, to store data about its employees and departments.
(a) The company uses a Database Management System (DBMS).
(i) The DBMS has a data dictionary.
Describe what the data dictionary stores.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
............................................................................................................................................ [2]
(ii) The DBMS has a query processor.
Describe the purpose of a query processor.
...................................................................................................................................................................................
...................................................................................................................................................................................
...................................................................................................................................................................................
.................................................................................... [2]
Summer 16 P 13
5 (a) A Database Management System (DBMS) provides the following features.
Draw a line to match each feature with its description. [3]
Feature Description
A file or table containing all the details of the database design
Data dictionary
Data design features to ensure the validity of data in the database
Data security
A model of what the database will look like, although it may not be stored
in this way
Data integrity
Methods of protecting the data including the uses of passwords and
different access rights for different users of the database
A school stores a large amount of data that includes student attendance, qualification and contact
details. The school is setting up a relational database to store these data.
(b) The school needs to safeguard against any data loss.
Describe three factors to consider when planning a backup procedure for the data.
Justify your decisions.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
4b 9608/12 Nov 16 Q9 - SoW