Computer Science O Level Course Topical by Rizwan Khalid
Computer Science O Level Course Topical by Rizwan Khalid
COMPUTER SCIENCE
2 TOPICALS
PAPER - 1 : NEW SYLLABUS
1
0
RIZWAN KHALID
Kot Sarfaraz Khan Chakwal
0543-541610
[email protected]
[email protected]
Book Title: O Level Computer Science Topical Paper 1
Price: 50/-
COPYRIGHT
©STUDENTS RESOURCE®202
The rights of Students Resource being Publisher of this book has been asserted by him in accordance
with the Copy Right Ordinance 1962 of Pakistan.
No part of this publication may be reproduced or transmitted in any form or by any means, electronic
or mechanical, including photocopy, recording, or any information storage and retrieval system,
without permission in writing from the Students Resource or under licence from the Registrar
Copyright from Intellectual Property Organization Pakistan.
The syllabus contents and questions from past papers used herein are the property of Cambridge
Assessment International Education (CAIE). The use of syllabus and questions from past papers used
in this book does not west in the author or publisher any copyright ownership, nor does the use of
CAIE material imply any affiliation with CAIE.
Any individual or institution violating the copyrights will be prosecuted in the court of law under the
lex-fori of Pakistan at his/their expense.
No further notes and legal warning would be issued for any kind of legal activity.
Legal Advisor
SECTION 1 COMPUTER SYSTEMS
1. Data representation
1.1 Number systems…………………………………………………………………………………………………………………………….3
2. Data transmission
2.1 Types and methods of data transmission………………………………………………………………………………….…48
2.3 Encryption………………………………………………………………………………………………….…………………………………70
3. Hardware
3.1 Computer architecture………………………………………………………………………………………………………………….73
4. Software
4.1 Types of software and interrupts……………………………………………………………………………………………….130
6.2 Robotics….………………………………………………………………………………………………………………………………….180
1|Page
SECTION 2 ALGORITHMS, PROGRAMMING AND LOGIC
8. Programming
8.1 Programming concepts………………….………….……………………………………………………………………………….263
8.2 Arrays…………………………………..…………………………………………………………………………………………………….309
9. Databases
9.1 Databases……………………………………..…………………………………………………………………………………………….319
10.3 Logic Circuits, logic expressions, truth tables and problem statements………..……………………………337
2|Page
1.1. Number Systems
3|Page
1. Give the denary (base 10) value of the byte: 1 0111110
............................................................................................................................................
........................................................................................................................................[1]
2. Letters from the alphabet are represented in a computer by the following denary (base 10) values:
A = 97
G = 103
I = 105
L = 108
N = 110
Convert each of the five values to binary. The first one has been done for you.
A (97): 0 1 1 0 0 0 0 1
L (108):
I (105):
G (103):
N (110):
[2]
4|Page
3. An encryption system works by shifting the binary value for a letter one place to the left.
“A” then becomes:
1 1 0 0 0 0 1 0
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:
hexadecimal
L:
.............................................
G:
.............................................
[4]
5|Page
4. Each seat on a flight is uniquely identified on an LCD above the seat. For example, seat 035C
is shown as:
0 3 F C
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:
8 4 2 1
0: 0 0 0 0
C: 1 1 0 0
Show how the 4-bit registers would store the remaining two characters, 3 and 5.
[2]
0 0 0 1
1 0 0 1
0 1 0 0
1 1 1 0
[2]
6|Page
5. (a) Name the following type of barcode:
...............................................................................................................................................[1]
(b) The barcode in part (a) contains the denary value 2 640
...................................................................................................................................................
...................................................................................................................................................
[4]
7|Page
6 (a) Convert the following hexadecimal number into 12-bit binary:
4AF
[3]
6(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-bit
registers.
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
hours
minutes
seconds
[3]
6(c) Write the hexadecimal value of the minutes register from part (b)(i).
.......................................................................................................................................[1]
8|Page
7. The memory of a computer contains data and instructions in binary.
0 0 1 0 1 0 0 1 1 1 1 1 1 1 0 0
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................... [2]
8. Explain why a programmer might prefer to read the instruction in hexadecimal rather than in
binary.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................... [2]
Use 1 ........................................................................................................................................
...................................................................................................................................................
Use 2 ........................................................................................................................................
...................................................................................................................................................
[2]
9|Page
10 (a) The denary number 57 is to be stored in two different computer
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
11. Show the binary number from part (a) as it would be stored in the following registers.
Register 1
Register 2
[2]
12. A binary number stored in a register can have many different uses, for example an
address in main memory.
Use 1 ........................................................................................................................................
Use 2 ........................................................................................................................................
[2]
13. A register in a computer contains binary digits.
0 0 1 1 1 0 1 0
...............................................................................................................................................[1]
10 | P a g e
14. Jane answers an examination question about computers and data correctly.
Six different words or numbers have been removed from her answer.
Complete the sentences in Jane’s answer, using the list given. Not all items in the list need to be
used.
2
10
16
analogue
binary
denary
digital
hexadecimal
process this type of data. For a computer to be able to process data it needs to be
[6]
15. Dheeraj identifies three hexadecimal numbers.
Write the denary number for each of the three hexadecimal numbers:
2A ....................................................................................................
101 ...................................................................................................
21E ..................................................................................................
[3]
11 | P a g e
16. A stopwatch uses six digits to display hours, minutes and
02 31 58
Hours Minutes Seconds
Write the 8-bit binary numbers that are currently stored for the Hours, Minutes and Seconds.
Hours
Minutes
Seconds
[3]
12 | P a g e
17.The stopwatch is started again and then stopped.
Hours 0 0 0 0 0 1 0 1
Minutes 0 0 0 1 1 0 1 0
Seconds 0 0 1 1 0 1 1 1
Write the denary values that will now be shown on the stopwatch.
[3]
18. Jafar is using the Internet when he gets the message: “D03, page is not available”
Jafar remembers that hexadecimal is often used to represent binary values in error codes.
Convert the hexadecimal number in the error message into 12-bit binary.
[3]
13 | P a g e
19.Convert the denary number 107 to binary.
.............................................................................................................................................. [1]
Represent the denary number 300 as it would be stored in a 12-bit binary register.
.............................................................................................................................................. [2]
.............................................................................................................................................. [2]
14 | P a g e
20. Characters can be represented in a computer by a numerical code.
The following list shows 16 characters with their numerical codes in denary:
a = 97 e = 101
k = 107 t = 116
b = 98 g = 103
m = 109 u = 117
c = 99 h = 104
o = 111 w = 119
d = 100 i = 105
r = 114
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:
w w w . c i e . o r g . u k
[3]
Complete the web address from the given hexadecimal codes:
%77 %77 %77 %2E %72 %6F %63 %6B %69 %63 %74 %2E %63 %6F %6D
W W W
[3]
15 | P a g e
21.A computer uses an 8-bit register.
128 64 32 16 8 4 2 1
0 1 1 1 0 0 0 0
...............................................................................................................................................[1]
All the bits in the register are shifted one place to the right as shown below.
0 1 1 1 0 0 0 0
0 0 1 1 1 0 0 0
...............................................................................................................................................[1]
State the effect the shift to the right had on the original denary number from part (a).
...............................................................................................................................................[1]
The original number in part (a) is shifted three places to the right.
[1]
Write the equivalent denary number.
.......................................................................................................................................[1]
16 | P a g e
22. A robot arm in a factory is programmed to move products.
UP 1 1 1 1
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
1 .............................................................................
C .............................................................................
3 .............................................................................
F .............................................................................
[5]
17 | P a g e
23. Give the 12-bit binary value of the denary value 250.
..................................................................................................................................... [1]
Working space
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
10010011 ...........................................................................................................................
00011101 ...........................................................................................................................
[2]
25.Using two’s complement, show how the following denary numbers could be stored in an 8-bit
register:
114
- 93
[2]
18 | P a g e