1.1 Data Representation Workbook by Inqilab Patel
1.1 Data Representation Workbook by Inqilab Patel
3|Page
Assessment at a glance
Components Weighting
Paper 1 Theory 1 hour 45 minutes 60%
This written paper contains short-answer and structured questions. All
questions are compulsory.
No calculators are permitted in this paper. 75 marks
Externally assessed.
Paper 2 Problem-solving and Programming 1 hour 45 minutes 40%
This written paper contains short-answer and structured questions. All
questions are compulsory. 20 of the marks for this paper are from questions
set on the pre-release material. 1
No calculators are permitted in this paper. 50 marks
Externally assessed.
4|Page
His entire career path revolves around computer science; either he was a student or a
teacher. He got a chance to polish his skills of teaching and studying more about computers
at various levels which has given him great confidence in presenting himself for any senior
level position of transferring his knowledge to the youth.
He has not stopped, he is continuing with his education at the higher levels. It is his second
semester of MPhil computer studies from a well-known university of Pakistan; The Institute
of Business & Technology.
Inqilab Patel knows a lot of methods of teaching computers and has developed tutorial
notes, worksheets and assignments for my students. He also maintains a website
(www.inqilabpatel.com) which is specifically designed for the support of those who want to
excel in GCSE computer science. He also regularly contributes material to CIE teacher
support website, for which he receives appreciation from different people across the world.
He has also received various training in innovative and special methods of teaching this
subject.
5|Page
Disclaimer
This workbook is developed by combining different materials related to Cambridge IGCSE &
O Level Computer Science 0478 & 2210. It is combination of work developed by me and the
resources, which are available in different web sites, books, magazines, past papers and
guides, just to facilitate students and teachers in preparation for examinations.
Examination questions and marking schemes used in this workbook are taken from CIE
(Cambridge International Examinations)
Note
Study of at least one of the following books, is compulsory for solving this workbook.
6|Page
Testimonials
7|Page
8|Page
9|Page
10 | P a g e
11 | P a g e
12 | P a g e
yasir raza
Such a benevolent hearted teacher with extra-terrestrial professionalism and dedication. Perfect in his
profession and thing I like about him the most is the sea of knowledge He possesses. Illuminating our minds by
giving us his heart and hard work to ensure well being of his students. A classy, inch perfect and a shining star
Awais Ahmed
One of the best teachers in the world i have ever witnessed.He show faith in me when i was totally weak.He is
the one of the most hardworking and most devoted teachers from my site.
Shabnam Manzoor
Azfar Gardezi
A dedicated and hardworking teacher with great vision. Sir surely helped me a lot in
becoming capable of scoring well in O Level Computer Science.
Gamonics
the most dedicated teacher ever . supporting and inspirational teacher that everycan can look upto as a role
model. would 10/10 recommend
Sajid Salim
A very hardworking and dedicated teacher who is ever ready to help others.
14 | P a g e
Muhammad Noman
Telingueur AWE
Just for the short time I’ve been in contact with Mr Patel and the computer teacher’s family ☺️, I can affirm
that I met a great man and the best computer science teacher so far. From your high standard you always
show humility and concern. Thanks a lot sir. You are our mentor.
Usman Imran
The user didn't write a review, and has left just a rating.
Kashif Ahmed
A wonderful human being and an excellent teacher of O and A levels. Who have very vast experience of
teaching O/A level. Hardworking and a very dedicated teacher. Strongly recommended.
syed rayyan
Sir inqilab Patel is a very dedicated and determined teacher.... the only teach from whom I could talk frankly ....
❤❤ The best teacher I met ❤❤ I wish he succeeds in this life and hereafter.
An extra ordinary teacher , an excellent educationist , a truly legend and my computer science guru Mr. Inqilab
Patail. I would highly recommend to join him to excel in computing knowledge and grades.
15 | P a g e
Raaed Ali
Sir Inqilab has been a great teacher and is very qualified in his profession. To say that he is
a good teacher would ... More
Sadaf Yousuf
Sobia Zeeshan
Hammad Asif
Zarafshan Jabeen
Waheed Aslam
block gamer
Syed Alay
Om Jagdish
"""The best teacher in town... "" this dialogue you might have heard for every teacher but believe me this
dialogue suits. """" Sir Inqilab Patel """""" Gives you worksheets (absolutely free). Plans many different N
difficult test, clears your doubt any time you want.. This teacher has a separate fan base.. Have troubled him so
many times but this teacher has always corrected me. . ¤ Matlab yr teacher best hai at the end.. ¤ Thanks sir. .
P.S---: Aur sorry jitna bhi aap ko tang kiya. . Peecheye class mein aawazein nikalneye se late class mein
aaneye tak.. +++++++++ SORRY
Yousuf Shahzad
The best teacher of computer science I've had so far. Sir Inqilab teaches with immense dedication and has
such an abundance of knowledge that anybody will be awed by him in matter of days. Looking forward to more
Umar Zubairi
Sir Inqilab is the best computer science teacher I have ever got , thank you sir for teaching us so well
17 | P a g e
Munawar Khan
One of the most dedicated and Excellent teacher I have ever met... My mentor and inspiration... Sir Inqilab
Patel
poolite
18 | P a g e
Paper 1
Theory of Computer Science
19 | P a g e
Chapter 1
Have Revised
Have Read
To Revise
Prepared
S No Learning Outcome
To Read
1.1.1: Binary systems
1 Recognize the use of binary numbers in computer systems
2 Denary-to-binary and binary-to- denary conversion
3 Concept of a byte and how the byte is used to measure memory size
Use binary in computer registers for a given application (such as in
4
robotics, digital instruments and counting systems)
1.1.2: Hexadecimal
5 Represent integers as hexadecimal numbers
6 Reasons for choosing hexadecimal to represent numbers
7 Convert positive hexadecimal integers to and from denary
8 Convert positive hexadecimal integers to and from binary
9 Represent numbers stored in registers and main memory as hexadecimal
Identify current uses of hexadecimal numbers in computing, such as
defining colours in Hypertext Markup Language (HTML), Media Access
10
Control (MAC) addresses, assembly languages and machine code,
debugging
1.1.3: Data storage
43 File formats sound (music), pictures, video, text and numbers
Identify and describe methods of error detection and correction, such as
44 parity checks, check digits, checksums and Automatic Repeat requests
(ARQ)
45 Concept of (MIDI) files, jpeg files, MP3 and MP4 files
File compression (lossless and lossy compression algorithms) applied to
46
music/video, photos and text files
20 | P a g e
Chapter at a glance:
The basic building block in all computers is the binary number system.
A binary digit is commonly referred to as a BIT; 8 bits are usually referred to as a BYTE.
The byte is the smallest unit of memory in a computer.
Binary-to-Decimal & Denary-to-Binary Conversion –use binary notation (place values) i.e.
128, 64, 32, 16, 8, 4, 2, 1.
For Binary-to-Hexadecimal conversion firstly groups of 4 bits are made from right to left and
each group is converted separately using 8, 4, 2, 1 notation.
For Hexadecimal-to-Binary conversion each hex digit is separated by other and then each hex
digit is converted separately using 8 4 2 1 notation.
For Denary-to-Hexadecimal conversion LCM of the denary number is taken.
For Hexadecimal-to-Denary conversion hexadecimal notation (place value) is used e.g. 4096
256 16 1
Memory Dump is display of memory contents and address in hexadecimal on screen or printed
on paper. It is powerful fault-tracing tool for expert programmers.
Hexadecimal are used in HTML to represent colour codes (RGB Model). For example: # ff0000
for bright red and #980000 for darker red.
MAC Addresses are unique number of NIC (Wi-Fi, Bluetooth. or wired connection i.e. Ethernet).
They are 48 bit long, but converted into 12 hexadecimal digits (in 6 pairs) making them short and
easier to understand. For 00-1C-2A-FF-01. 1st 3 pairs represent manufacturer while the other
represent serial number of product.
UAA (Universally Administered MAC Address) are most common. These are the MAC
addresses set by manufacturer
LAA (Locally Administered MAC Addresses) are changed locally to bypass firewall, or to
assign MAC address of specific format.
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:%72%75%6B%6E%75%64%64%69%6E
Machine code and Assembly code are examples of low-level languages and are used by
software developers when producing, for example, computer games. They look difficult but they
have many advantages at the development stage of software writing (especially when trying to
locate errors in the code). Using hexadecimal makes it much easier, faster and less error prone
to write code compared to binary.
Character: Any text, number or symbol.
Compression: The method of reducing file size.
Lossy Compression: The file is reduced in size for transmission and storage; by permanently
removing some redundant information from the file
Lossless Compression: The file is reduced in size for transmission and storage; it is then put
back together again later producing a file identical to the original
MP3: File compression system for music which does not noticeably affect the quality of the
sound.This is done using file compression algorithms which use PERCEPTUAL MUSIC
SHAPING; this essentially removes sounds that the human ear can‘t hear properly.
JPEG: File compression format designed to make photo files smaller in size for storage and for
transmission.
MIDI: Standard adopted by the electronic music industry for controlling devices such as
21 | P a g e
synthesisers and sound cards
MP4: MPEG-4 (MP4) format allows the storage of multimedia files rather than just sound. Music,
videos, photos and animation can all be stored in the MP4 format. Videos, for example, could be
streamed over the internet using the MP4 format.
Algorithm: step-by-step set of instruction to solve a problem.
Register: Immediate access store in the processor. It can store small piece of data.
22 | P a g e
Number System:-
―The system of counting and calculating is called number system.‖
Number system is based on some characters called digits. 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.
Computer uses following four numbers:
i) Denary (Decimal) number system
ii) Binary number system
iii) Hexadecimal number system
Denary (Decimal) Number System:-
―The number system which is based on 10 characters from 0 to 9 is called denary
(decimal) system.‖
It is the most common number system. The digits of decimal system are 0, 1, 2, 3, 4, 5, 6,
7, 8, and 9. The value of each digit in a figure depends upon its weight. The weights are based on
power of 10.
―The number system which is based on 2 characters 0 and 1 is called binary system.‖
Computer circuitry represents data in a pattern of ON and OFF states of electric current.
The state ON is represented by ‗1‘ and OFF is represented by ‗0‘. Binary system is used for
internal working of electronic computers.
The value of each digit in a figure depends upon its weight. The weights are based on power of 2.
Binary numbers are fundamental to the way that all modern computers work. They are used to
represent any data stored within a computer 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.
1 1 1 1 1 1 1 1
Bit bit bit bit bit bit bit bit
Nibble Nibble
Byte
Binary-to-Denary Conversion:
Convert the following denary numbers into Convert the following binary numbers into
binary denary
a) 75 a) 0 0 1 1 0 0 1 1
b) 0 1 1 1 1 1 1 1
b) 63
c) 1 0 0 1 1 0 0 1
c) 127
d) 0 1 1 1 0 1 0 0
d) 257
e) 1 1 1 1 1 1 1 1
e) 79
f) 0 0 0 0 1 1 1 1
f) 325
g) 1 0 0 0 1 1 1 1
g) 90
h) 1 1 1 1 0 0 0 0
h) 100
Answers:
Answers:
a)51. b)127. c)153.
a)1001011. b)111111.
d) 116. e) 255. f)15
c)1111111. d) 100000001.
g) 143. h) 240.
e) 1001111. f) 101000101.
g) 1011010 h) 1100100.
25 | P a g e
1.1.2 Hexadecimal Number System:-
―The number system which is based on 16 characters
from 0 to 9 and A, B, C, D, E & F is called Hexadecimal
system.‖
For Example:
Convert the binary number 10110101 to a hexadecimal number
3=2+1 so 1s are written below 2 and 1 and 0s are written below 8 & 4.
7=4+2+1 so 1s are written below 4, 2 and 1 and 0s are written below 8.
4=4 so 1 is written below 4 and 0s are written under 1, 2 & 8.
F=15=8+4+2+1 so 1s are written under all of them.
374F16 = 00110111010011112
27 | P a g e
Exercise
Convert the following binary numbers into Convert the following hexadecimal
hexadecimal numbers into binary
a) 1 0 1 1 0 0 1 1 0 0 1 1 a) 6 B
b) 0 1 1 0 0 0 0 1 0 1 0 1 1 1 1 b) 9 D
c) 1 0 0 1 1 0 0 1 0 1 0 1 0 1 c) A B C
d) 0 1 1 1 0 1 11001 1 1 1 0 d) 1 2 8
e) 1 1 1 1 1 1 1 1 01 1 0 1 1 1 0 00 e) A5 C3
f) 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 f) 9 6 F 8
g) 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 g) 7 8 E
h) 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 h) 0 0 7
Answers: Answers:
a)B33. b)30AF. c)2655. a)1101011. b)10011101.
d) 3B9E. e) 3FDB8. f) 7CF. c)101010111100. d) 100101000.
g) 47B72. h) F0E1. e) 1010010111000011.
f) 1001011011111000
g) 11110001110. h) 111.
28 | P a g e
Convert a hexadecimal number into a denary number
Method 1: Converting from hex to denary via binary
Separate the hex digits to find each equivalent in binary, and then piece them back together.
Worked example - What is the denary value of hex value 3A4F?
1. Separate the hex digits into 3, A, 4and F and find the equivalent binary numbers.
3 A 4 F
2. CHexadecimal Number
3 10 4 15
o
n4 Bit Binary Notation 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
v Calculation (Write 1s under binary 0 0 1 1 10 1 0 0 1 0 0 1 1 1 1
enotation number total of which
r equals the hexadecimal digit (2+1=3) (4+3+1=7) (4=4) (8+4+2+1=
t 15)
Binary Numbers 0011 1010 01001111
b
inary number into denary
Binary
0 0 1 1 1 0 1 0 0 1 0 0 1 1 1 1
Value
Binary
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Notation
Ignore
notations
0 0 8192 4096 2048 0 512 0 0 64 32 0 8 4 2 1
under 0
bits
Add the
remaining 8192+4096+2048+512+64+32+8+4+2+1
numbers
Equivalent
denary 14927
number
Example:
Convert denary 28345 to hex:
Working
Division Remainder
Quotient
by 16 (decimal)
16 110 B 110/16 6 14
16 6 E 6/16 0 6
16 0 6
So 28345 = 6EB9
Division Remainder
Quotient
by 16 (decimal)
16 472 A 472/16 29 8
16 29 8 29/16 1 13
10 1 D 1/16 0 1
0 1
So 7562 = 1D8A
30 | P a g e
Exercise
Convert the following denary numbers into Convert the following hexadecimal
hexadecimal numbers into denary
a) 77 a) 5 F
b) 3 E D
b) 250
c) E E
c) 151
d) B B A
d) 357
e) 1 2 A E
e) 7079
f) 4 A 2 F
f) 15120
g) 2 D F 5
g) 826
h) F 9 A 8
h) 10000
Answers:
Answers:
a)95. b)1005. c)238.
a)4 D. b)F A. c)9 7.
d) 3002. e) 4782. f) 18991
d) 1 6 5. e) 1 B A 7. f) 3 B 1 0.
g) 11765. h) 63912.
g) 3 3 A h) 2 7 1 0.
31 | P a g e
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
There are a few reasons why the MAC address needs to be changed using LAA:
Certain software used on mainframe systems needs all the MAC addresses of devices to fall
into a strict format; because of this, it may be necessary to change the MAC address of some
devices to ensure they follow the correct format.
It may be necessary to bypass a MAC address filter on a router or a firewall; only 24 MAC
addresses with a certain format are allowed through, otherwise the devices will be blocked.
To get past certain types of network restrictions it may be necessary to emulate unrestricted
MAC addresses; hence it may require the MAC address to be changed on certain devices
connected to the network.
Memory Dump
Contents of memory are in binary numbers. Binary numbers are
long and difficult to understand.
Memory dump is a hexadecimal view (on screen or paper) of
computer data, from RAM or from a file or storage device. As
memory dump uses hexadecimal number to show memory
contents, it become a powerful fault tracing tool but requires
expertise in computer architecture.
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”
Following are different types of file formats available to be used in computers for example:
MIDI & MP3 for sound
MP4 for video
Jpeg for pictures
and DOC text and numbers
MIDI
Pronounced middy, an acronym for musical
instrument digital interface, a standard adopted by the
electronic music industry for controlling devices, such as
synthesizers and sound cards, which emit music.
A MIDI file consists of a list of commands that instruct a
device like an electronic organ, how to produce a particular
sound or musical note.
Examples of MIDI commands include:
note on/off: this indicates that a key has been pressed/released to produce/stop producing
a musical note
key pressure: this indicates how hard the key has been pressed (this could indicate
loudness of the music note or whether any vibrato has been used, and so on).
The whole piece of music will have been stored as a series of commands but no actual musical
notes. Their size, compared with an MP3 file, is considerably smaller. MIDI is essentially a
communications protocol that allows electronic musical instruments to interact with each other.
The MIDI protocol uses 8-bit serial transmission with one start bit and one stop bit, and is therefore
asynchronous.
MIDI is essentially a communications protocol that allows electronic musical instruments to interact
with each other.
Two additional bytes are required, a PITCH BYTE for note to play, and a VELOCITY BYTE for
loudness. However, to play back through an instrument such as
a guitar would need the use of SEQUENCER SOFTWARE.
MP3 (Moving Pictures Expert Group Audio Layer 3)
This has become the standard for distributing digital music files on the internet. It uses lossy
Page | 38
compression to reduce file sizes to about a tenth of the original.
The compression algorithm is intended to remove 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).This is done using file
compression algorithms which use PERCEPTUAL MUSIC SHAPING; this essentially removes
sounds that the human ear can‘t hear properly.
MPEG-4 (MP4) files are slightly different to MP3 files. This format allows the
storage of multimedia files rather than just sound. Music, videos, photos and
animation can all be stored in the MP4 format. Videos, for example, could be
streamed over the internet using the MP4 format without losing any real discernable
quality.
Colour
1 bit 2 bit 4 bit
depth
Example
Example
Uncompressed raw
image
Page | 41
designed to make photo files smaller in size for storage and for transmission. It uses lossy
compression and compresses a file between factor of 5 to 15.
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. A raw bitmap can often be referred to as a
TIFF or BMP image (file extension .TIF or .BMP). The file size of this image is determined by the
number of pixels. In the previous example, a 4-megapixel image would be 4 megapixels × 3
colours(RGB) =12 megabytes.
This image will be compressed at factor of 5 (12/5=2.5 mb) to factor of
15 (12/15= 0.8mb). Compressed image,
A raw bitmap can often be referred to as a after applying factor TIFF or BMP image (file
extension .TIF or .BMP). of 5
Vector Graphics
Vector images store set of instructions about HOW to draw each shape.
Vector graphics are created in graphics packages and consist of shapes called objects.
It is possible to edit each object separately, for example, change the shape, colour, size and
position.
The file size of a vector graphic is often very small.
Vector graphic is scalable – i.e. when you resize it, the entire image is redrawn and it doesn‘t lose
quality.
Bitmap Graphics
A bitmap or Raster image is a group of pixels. The
colour of each pixel is stored as a binary code. The
following picture could be represented as:
• Developed to transfer and read documents without having to print them—the ―paperless
office.‖
• Can represent both vector and bitmap graphics.
• Can also contain electronic document search and navigation features as well as hypertext
links.
• Can be created from almost any application.
• Document formatting, fonts, colors, etc. are maintained and appear identical across
platforms.
File compression
File compression is the process of encoding information using fewer bits so that the compressed
file size is smaller.
It is important for files transmitted over the Internet because if they are not compressed then there
would be considerably more data to transmit. This would result in more network traffic, slower
download times and delays in viewing web pages, particularly those with multimedia content.
Streaming audio and video would be impractical without file compression.
However, compressed data may be of lower quality (if using lossy compression) and must be
decompressed to be used. This extra processing may slow some applications and in the case of
video decompression, require dedicated hardware such as graphics cards for the video to be
viewed as it is actually being decompressed.
Page | 43
Lossless compression
This allows the original file to be re-created exactly from the compressed file. It works by searching
for patterns in the file so, instead of repeatedly storing a block of identical data; the data is stored
once and then indexed. Further occurrences are simply stored as the index number so the
decompression software can simply look up the data and place it back in the correct position.
Text files compress well because certain letters and words will often appear together in the same
pattern. Software files also compress well for similar reasons, they are made up of a relatively
small number of different instructions, often arranged in a set pattern.
In both cases, the larger the original file, the better the compression ratio as there are more likely
to be repeating patterns and each pattern will be repeated more frequently.
Lossy compression
Files that include a lot of unique information, such as bitmap graphics, sound or video files, cannot
be compressed much with lossless compression because there is so little repeated data.
Lossy compression works differently, it removes data that is not needed, either because a drop in
quality is acceptable or the difference cannot be detected by the human eye or ear.
Streaming audio and video is possible with lossy compression.
Page | 44
Quick Revision Questions
1 Convert the following number [6 marks]
a. denary 156 into binary
…………………………………………………………………………………………………………......…
………………………………………………………………………………………………………….…..
b. denary 756 into hexadecimal
………………………………………………………………………………………………………................
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………….…..
c. binary 101101100 into denary
……………………………………………………………………………………………………................…
…………………………………………………………………………………………………………………
………………………………………………………………………………………………………….…..
d. binary 100101001110000 into hexadecimal
……………………………………………………………………………………………………......………
…………………………………………………………………………………………………………….…..
e. hexadecimal C9F into denary
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
……………………………………………………………………………………………………….…..
f. hexadecimal C9F into 12 bit binary
……………………………………………………………………………………………………......………
…………………………………………………………………………………………………………….…..
2 A 32-second sound clip will be recorded. The sound will be sampled 16000 times a second.
Each sample will be stored using 8 bits.
Calculate the file size. You must show all of your working. (March 2018 P12 (India) Q 9)
............................................................................................................................................................
97: ……….………................................................................................................................................
...................................................................................................................................................... [2]
‗I‘:……..................................................................................................................................................
...........................................................................................................................................................
‗i‘: ……….………................................................................................................................................
..................................................................................................................................................... [2]
‗I‘:……..................................................................................................................................................
...........................................................................................................................................................
‗i‘: ……….………...............................................................................................................................
..................................................................................................................................................... [2]
(iv) using the denary values of upper and lower case in part i and ii, suggest an easy way to find
the ASCII binary code of any small case letter if its upper case binary code is known, (e.g. ‗P‘)
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...................................................................................................................................................... [2]
Page | 46
(v) Write in Register X the binary number you would use with OR gates to convert the ASCII value
of upper case letter ‗A‘ to its lower case letter ‗a‘ binary value.
[1]
„A‟
Register X
OR logic operation
„a‟
Test the Register X to apply with the letter ‗I‘ to convert it into ‗i'
„I‟
Register
X
„i‟
4A process is devised for encoding letters using 16 bits. The process starts by giving each letter of
the alphabet a value: A = 1, B = 2, C = 3, ....., Z = 26.
(a) The value for each letter is represented using 16 bits. For the letter ‗V‘ write its 16-bit binary
value
(b) All the bits in the register are shifted one place to the left to convert a upper case letter into
small case letter
i. write down contents of 16-bit binary register after the bits have been moved to left to convert ‗V‘
into ‗v‘.
ii. convert this binary value for ‗V‘ and ‗v‘ in denary
‗V‘ …………………………………………………………………………………………………………...
…………………………………………………………………………………………………………….
‗v‘ …………………………………………………………………………………………………………...
……………………………………………………………………………………………………………. [2]
Page | 47
iii. State the effect the shift to the left had on the original denary number from part (bii).
…………………………………………………………………………………………………………………
….……………………………………………………………………………………………...………………
…………………………………………………………………………………………………………. [1]
iv. Predict what will be happened to a denary value when its binary values are moved 1 place to
right.
…………………………………………………………………………………………………………………
….……………………………………………………………………………………………...………………
…………………………………………………………………………………………………………. [1]
5 Explain why and how hexadecimal notation is used rather than in binary. [6]
(i) MAC Address ………………………………..……………………………………………………
…………………………………………………………………………………………………………
………………………………………………………………………………………………………
Reason …….………………………………………………………………………………………
……………………………………………………………………………………………………..……
………………………………………………………………………………………………………
(ii) Memory Dump …..………………………………..………………………………………………
…………………………………………………………………………………………………………
………………………………………………………………………………………………………
Reason …….……………………………………………………………………………………
…………………………………………………………………………………………………..………
……………………………………………………………………………………………………
(iii) HTML ……………..………………………………..………………………………………………
Page | 48
…………………………………………………………………………………………………………
………………………………………………………………………………………………………
Reason …….………………………………………………………………………………………
……………………………………………………………………………………………………..……
………………………………………………………………………………………………………
6Characters can be represented in a computer by a numerical code. (2210/0478 Winter 2015 P11)
The following list shows 16 characters with their numerical codes in denary:
a = 97 d = 100 h = 104 m = 109 t = 116
b = 98 e = 101 i = 105 o = 111 u = 117
c = 99 g = 103 k = 107 r = 114 w = 119
. = 46 (code for the full stop)
Web addresses can be written using hexadecimal rather than denary. Hexadecimal codes are
preceded by a % sign. For example, the word ―c a g e‖ is written as:
either 99 97 103 101 (in denary)
or %63 %61 %67 %65 (in hexadecimal)
(a) Complete the conversion of the following web address into hexadecimal: [3]
w W W . c i e . o r g . u K
%77 %77 %77
b) Complete the web address from the given hexadecimal codes: [3]
%77 %77 %77 %2E %72 %6F %63 %6B %69 %63 %74 %2E %63 %6F %6D
w W W
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
....................................................................................................................................................... [2]
8 The information from seven sensors is sent to an engine management system in the car. The
status of each sensor is stored in an 8-bit register; a value of 1 indicates a fault condition.
(Q 5 Winter 2015 P13)
............................................................................................................................................................
............................................................................................................................................................
......................................................................................................................................................[2]
(ii) A car has a faulty airbag and the CO level is too high.
Write what should be contained in the 8-bit register.
(iii) Give the hexadecimal value of the binary number shown in part (iii).
............................................................................................................................................................
......................................................................................................................................................[1]
Page | 50
9Draw a line to connect each question to the correct answer.(2210/0478 summer 2015 P11 Q 9) [5]
Question Answer
Complete a trace table for each of the two input values 33 and 75. [4]
Trace table for input value 33
X A B OUTPUT
8 7 3 3
7 7
[4]
(ii) Now perform the AND (logic) operation on each corresponding pair of binary bits in the two
numbers from part (i).
[2]
(iii) Convert your answer in part (ii) into hexadecimal.
............................................................................................................................................................
............................................................................................................................................................
[2]
(b) (i) The following code shows HTML ‗tag‘ pairs on either side of the text stating the colour that
each creates.
<font color ― # F F 0 0 0 0 ― > RED </font>
<font color ― # 0 0 F F 0 0 ― > GREEN </font>
<font color ― # 0 0 0 0 F F ― > BLUE </font>
<font color ― # X ― > YELLOW </font>
<font color ― # Y ― > MAGENTA </font>
<font color ― # Z ― > CYAN </font>
Yellow is a combination of red and green, magenta a combination of red and blue and cyan a
combination of green and blue.
State what 6-digit hexadecimal values should replace X, Y and Z in the above code.
X ........................................................................................................................................................
Y .......................................................................................................................................................
Z ..................................................................................................................................................[3]
(ii) Describe how other colours, such as a darker shade of blue, are created.
............................................................................................................................................................
.......................................................................................................................................................[2]
Examiners’ Comments Question 4(a) (b) and (c)
In part (a) most candidates were able to demonstrate a high level on knowledge in data representation and logic. Some candidates
made small errors but still gained later marks with follow through on their answers.
In part (b) some candidates were able to provide a correct response. Some candidates made an error in putting the two codes for
the two different colours, rather than combining the codes to create the colour requested.
In part (b)(ii) many candidates gave a vague response and did not describe that HTML codes are combined to create different
colours. Many candidates provided a minimum level answer, such as adding the colour black to blue. They did not add the
Page | 54
Computer Science aspect, that different HTML codes are combined to do this. Candidates need to make sure they are thinking
about the computer science aspect of the question in questions such as this one.
In part (c) many candidates did not recognise what information they needed to give. They provided conversions of the hex values
to denary or binary, rather than stating what the code actually represents.
Some candidates were too vague in stating what it represented, candidates need to be specific in their responses. In part (c)(ii)
some candidates were able to state that MAC addresses are a unique identifier for a device on a network. Many candidates were
not specific enough, stating that MAC addresses identified a device on a network, but not stating that the identification is unique.
•2 • 10 • 16 • analogue
• binary • denary • digital • hexadecimal
As humans, we process …………………………………… data, but a computer cannot process this
type of data. For a computer to be able to process data it needs to be converted to
…………………………………… data.
As humans, we mostly use a …………………………………… number system; this is a base
…………………………………… number system.
Computers use a …………………………………… number system; this is a base
…………………………………… number system. [6]
14 Abdullah wants to convert a denary number into hexadecimal. Write down the series of steps
for Abdullah.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
....................................................................................................................................................... [4]
Page | 55
15 Abdullah also wants to convert a denary number into binary. Write down the series of steps for
Abdullah clearly so he can perform this conversion.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................................................... [4]
16 a Integers can be represented in Binary Coded Decimal (BCD). In BCD each denary digit is
converted into 4 bit BCD separately, for example Denary 6 can be represented in BCD
8 4 2 1
6 = 0 1 1 0
(i) State BCD equivalent of 4 and 7.
8 4 2 1
4 =
8 4 2 1
7 =
(ii) State what denary number is represented by this 2-byte BCD number.
1 0 0 1 1 0 0 0 0 0 1 1 0 1 1 1
Without converting the whole pattern, how can you identify that this cannot be a validBCD
representation?
............................................................................................................................................................
............................................................................................................................................................
.[1]
(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]
Page | 57
Memory Size Measurement
It should be pointed out here that there is some confusion in the naming of memory sizes.
The unit was established by the International Electrotechnical Commission (IEC) in 1998, has
been accepted for use by all major standards organizations, and is part of the International System
of Quantities. The kibibyte was designed to replace the kilobyte in those computer science
contexts in which the term kilobyte is used to mean 1024 bytes. The interpretation of the kilobyte
to denote 1024 bytes, conflicting with the SI definition of the prefix kilo (1000), is still common,
mostly in informal computer science contexts.
The IEC convention is now adopted by some organisations. Manufacturers of storage devices
often use the denary system to measure storage size. For example:
0 or 1 = 1 bit
4 bits = 1 Nibble
8 bits = 2 Nibbles = 1 byte
1 kilobyte = 1000 byte
1 megabyte = 1000000 bytes
1 gigabyte = 1000000000 bytes
1 terabyte = 1000000000000 bytes and so on.
The IEC convention for computer internal memories (including RAM) becomes:
1 kibibyte (1 KiB) = 1024 bytes
1 mebibyte (1 MiB) = 1048576 bytes
1 gibibyte (1 GiB) = 1073741824 bytes
1 tebibyte (1 TiB) = 1099511627776 bytes and so on
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]
Page | 58
16Different units of data can be used to represent the size of a file, as it changes in size.
Fill in the missing units of data, using the list given:
byte
gigabyte (GB)
megabyte (MB)
nibble
Smallest bit
……………………………………
……………………………………
Kilobyte (KB)
………………………………….
………………………………….
Largest Terabyte (TB)
( Summer 2018 P12)
17 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.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................................. [2]
Page | 59
Candidate Example response
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................................. [3]
Page | 63
Q2) Summer 2015 P11
9 Draw a line to connect each question to the correct answer. [5]
Question Answer
(b) An encryption system works by shifting the binary value for a letter one place to the left. ―A‖
then becomes:
This binary value is then converted to hexadecimal; the hexadecimal value for ―A‖ will be:
C2
For the two letters ―L‖ and ―G‖, shift the binary values one place to the left and convert these
values into hexadecimal: [4]
[4]
(ii) Now perform the AND (logic) operation on each corresponding pair of binary bits in the two
numbers from part (i).
[2]
(iii) Convert your answer in part (ii) into hexadecimal.
............................................................................................................................................................
..................................................................................................................................................... [2]
(b) (i) The following code shows HTML ‗tag‘ pairs on either side of the text stating the colour that
each creates.
<font color ― # F F 0 0 0 0 ― > RED </font>
<font color ― # 0 0 F F 0 0 ― > GREEN </font>
<font color ― # 0 0 0 0 F F ― > BLUE </font>
<font color ― # X ― > YELLOW </font>
<font color ― # Y ― > MAGENTA </font>
<font color ― # Z ― > CYAN </font>
Yellow is a combination of red and green, magenta a combination of red and blue and cyan a
combination of green and blue.
State what 6-digit hexadecimal values should replace X, Y and Z in the above code.
X.......................................................................................................................................................
Y.........................................................................................................................................................
Z……………................................................................................................................................. [3]
(ii) Describe how other colours, such as a darker shade of blue, are created.
............................................................................................................................................................
............................................................................................................................................................
.................................................................................................................................................... [2]
Page | 66
(c) 1A – 16 – C5 – 22 – FF – FF is an example of a MAC address.
(i) Identify what the first six and last six hexadecimal digits represent.
First six digits.....................................................................................................................................
..........................................................................................................................................................
Last six digits ...................................................................................................................................
............................................................................................................................................................
..................................................................................................................................................... [2]
(ii) State why MAC addresses are used.
............................................................................................................................................................
..................................................................................................................................................... [1]
Examiners’ Comments Question 4(a) (b) and (c)
In part (a) most candidates were able to demonstrate a high level on knowledge in data representation and logic. Some candidates
made small errors but still gained later marks with follow through on their answers.
In part (b) some candidates were able to provide a correct response. Some candidates made an error in putting the two codes for
the two different colours, rather than combining the codes to create the colour requested.
In part (b)(ii) many candidates gave a vague response and did not describe that HTML codes are combined to create different
colours. Many candidates provided a minimum level answer, such as adding the colour black to blue. They did not add the
Computer Science aspect, that different HTML codes are combined to do this. Candidates need to make sure they are thinking
about the computer science aspect of the question in questions such as this one.
In part (c) many candidates did not recognise what information they needed to give. They provided conversions of the hex values
to denary or binary, rather than stating what the code actually represents.
Some candidates were too vague in stating what it represented, candidates need to be specific in their responses. In part (c)(ii)
some candidates were able to state that MAC addresses are a unique identifier for a device on a network. Many candidates were
not specific enough, stating that MAC addresses identified a device on a network, but not stating that the identification is unique.
Page | 67
Q 5) Winter 2015 P13
(b) The information from seven sensors is sent to an engine management system in the car. The
status of each sensor is stored in an 8-bit register; a value of 1 indicates a fault condition
(i) Identify the fault condition(s) that the following register indicates:
............................................................................................................................................................
............................................................................................................................................................
.....................................................................................................................................................[2]
(ii) The system uses odd parity.
Write the correct parity bit in each register.
[2]
(iii) A car has a faulty airbag and the CO level is too high.
Write what should be contained in the 8-bit register.
(iv) Give the hexadecimal value of the binary number shown in part (iii).
............................................................................................................................................................
.....................................................................................................................................................[1]
Examiners’ Comments Question 2 (a) and (b)
Page | 68
In part (a) most candidates were able to gain some marks for a description of how sensors and the microprocessor would be used.
Some candidates missed naming the type of sensor that could be used. This would have gained further marks. Some candidates
were not specific in their answer, merely talking about comparing values, but specifically which values. Candidates need to make
sure they are specific to the question in their answer.
In part (b) many candidates were able to correctly identify the fault condition provided. Most were able to provide the correct
parity bit, and many were able to provide the correct vales in the register and convert this to hexadecimal. Candidates need to
make sure their answer is clear when providing hexadecimal and that it can be distinguished from any working.
b) Complete the web address from the given hexadecimal codes: [3]
%77 %77 %77 %2E %72 %6F %63 %6B %69 %63 %74 %2E %63 %6F %6D
w w W
Examiners’ Comments Question 10(a) and (b)
Some candidates were able to carry out the conversions with great accuracy. Some candidates had clearly not read the question in
full and were missing detail in their answer as a result, for example the code for a full stop (.). Candidates need to make sure they
read the whole of a question before writing their response, to make sure they do not miss any important details.
Page | 70
Q 7) Summer 2016 P11 & P13
7 Each seat on a flight is uniquely identified on an LCD above the seat. For example, seat 035C is
shown as:
The first three characters are digits that represent the row.
The fourth character is the seat position in that row. This is a single letter, A to F, that is stored as
a hexadecimal value.
Each of the four display characters can be stored in a 4-bit register. For example, 0 and C would
be represented as:
(a) Show how the 4-bit registers would store the remaining two characters, 3 and 5. [2]
....................................................................................................................................................[1]
(b) The barcode in part (a) contains the denary value 2 6 4 0
Convert this value to hexadecimal.
............................................................................................................................................................
.........................................................................................................................................................
Write the value as a 12-bit binary number. [4]
(c) An airport uses the type of barcode shown in part (a) to advertise local places of interest.
Describe how a visitor landing at the airport could use these barcodes to help plan their visit.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................................[3]
Examiner Report Question 12(a), (b) and (c)
In part (a) many candidates were able to identify the type of barcode.
In part (b) some candidates were able to carry out the correct calculation and conversions. This calculation did prove challenging
to many candidates.
In part (c) many candidates were able to describe the process of a person scanning the QR code with their mobile device, this
linking to a website that would provide details about local tourist information. Some candidates were too vague in their
description, stating the barcode would be scanned, or scanning the phone with an app., but not explaining this would be done with
a mobile device.
Page | 72
Q 9) Summer 2016 P12
3 (a) Convert the following hexadecimal number into 12-bit binary:
4AF [3]
(b) The 2016 Olympic Games will be held in Rio de Janeiro. A timer that counts down to the
opening of the Games is shown on a microprocessor-controlled display.
The number of hours, minutes and seconds until the Games open are held in three 8-bitregisters.
The present register values are:
0 1 1 0 1 0 0 1 105 Hours
0 0 1 0 0 0 0 0 32 Minutes
0 0 0 1 0 1 0 0 20 Seconds
(ii) Write the hexadecimal value of the minutes register from part (b)(i).
.......................................................................................................................................[1]
Examiner Report Question 3(a), (b)(i) and (ii)
In part (a) most candidates made a correct conversion to binary.
In part (b)(i) some candidates were able to provide the correct three binary registers. A number of candidates did not fully
understand the question and added on the time, rather than deducting it. This gave them the wrong value for the minute’s register.
In part (b)(ii) most candidates were able to provide a correct hexadecimal conversion, either from the correct binary register, or as
a follow through answer.
Page | 73
Q 10) Winter 2016 P12
5 A computer uses an 8-bit register.
The 8-bit register contains binary integers.
(a) Write the denary (base 10) value represented by:
128 64 32 16 8 4 2 1
0 1 1 1 0 0 0 0
...............................................................................................................................................[1]
(b) All the bits in the register are shifted one place to the right as shown below.
............................................................................................................................................................
.................................................................................................................................................... [2]
Examiner Report
In parts (a) and (b) most candidates could provide a correct conversion from binary to denary.
In part (c) many candidates could identify the effect that the shift had on the number. Some candidates were too
vague in their response stating the number had merely decreased.
In parts (c) and (d) most candidates could perform the shift and convert it to the correct denary value.
In part (e) most candidates could not accurately explain the effect of the shift. They were not able to express
that the right most bit would be lost from the register, making the number inaccurate.
Page | 74
Q 11) Winter 2016 P11& 13
10 (a) A manufacturer of aeroplane engines assigns a denary identification number (ID) to each
engine. One engine has the ID: 0431
(i) Convert this denary number to a 12-bit binary format. [2]
0 0 1 1 0 1 1 1
0 0 1 1 0 1 1 1 ASCII
Register
X
Examiner Report
(a) This was generally well answered.
(b) Some candidates gave the contents of the register correctly in all three number systems. Common errors included
incorrectly stating the binary for the integer value of 9 rather than the binary value of the ASCII value for 9.
(c) Better candidates correctly identified the binary number required. A common error was not to mask out the two
ones for the ASCII code.
Register 1
Register 2
(c) A binary number stored in a register can have many different uses, for example an address in
main memory.
Give two other uses for a binary number stored in a register.
Use 1 ...............................................................................................................................................
Use 2 .......................................................................................................................................... [2]
(d) A register in a computer contains binary digits.
0 0 1 1 1 0 1 0
Down 0 0 0 1
Left 1 0 0 1
Right 0 1 1 0
Open 1 1 0 0
Close 0 0 1 1
Convert the values and write down the operation (e.g. RIGHT) carried out by the robot arm.
9 .............................................................................
1 .............................................................................
C .............................................................................
3 .............................................................................
F ............................................................................. [5]
............................................................................................................................................................
............................................................................................................................................................
................................................................................................................................................... [2]
Comments on Question 5
(a) Many candidates answered this question well. Two common errors were not providing the full
register values for the last register. Some candidates only gave 9 as the value, but the values for
the whole register should have been provided, for example 09. It would be helpful if candidates
Page | 82
understood that even if they are asked to convert the whole register, any 0 value should also be
given.
Some candidates converted the value again for the first register. They should have provided the
response 10, but treated this as a denary value and further converted it giving an answer of A. It
would be helpful if candidates understood that the initial values from the conversion were
hexadecimal values and not a denary value of 10.
(b)Many candidates provided a good response for this question. The most common responses
were that it would make it easier to read and that fewer errors may be made.
Write the denary values that will now be shown on the stopwatch. [3]
(iii) State two benefits of using hexadecimal notation to represent binary values.
Benefit 1 ..........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
.......................................................................................................................................................[2]
Page | 87
Q 29) Winter 2018 P13
4 The MAC address of a device is represented using hexadecimal. A section of a MAC address is
shown. Each pair of hexadecimal digits is stored using 8-bit binary.
(a) Complete the table to show the 8-bit binary equivalents for the section of MAC address. The
first number has already been converted. 6A FF 08 93 01101010 [3]
(b) Bob has a file stored on his computer that is 3500kB in size. Gerty has a file that is 3MB in
size.
Tick () to show which is the larger file. [1]
File size Tick ()
3500kB
3MB
3 (a) A long distance running race uses an electronic counter that counts each competitor who
finishes the race.
The count is stored as binary in a 12-bit register.
A denary value of the count is displayed on a screen above the finish line.
(i) The screen currently displays:
0039
State the binary value that is currently stored to display the count shown.
............................................................................................................................................................
....................................................................................................................................................... [2]
Page | 88
(ii) More competitors cross the finish line and the screen now displays:
0350
State the binary value that is currently stored to display the count shown.
............................................................................................................................................................
...................................................................................................................................................... [2]
(iii) At the end of the race the binary value stored is:
011011000111
Give the denary value that would be displayed on the screen at the end of the race.
Show your working.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.........................................................................................................................................................
[2]
5C
E1
She sells sea shells on the seashore. The shells that she sells are sea shells I am sure.
Explain how lossless compression would compress this file.
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...................................................................................................................................................... [5]
90 | P a g e
Q 3) Summer 2015 P12
Q1) Summer 2015 P11