Cambridge International AS and A Level Computer Science Revision Guide
Cambridge International AS and A Level Computer Science Revision Guide
Cambridge International
AS and A level
Computer
Science
Revision Guide
i
University Printing House, Cambridge CB2 8BS, United Kingdom
One Liberty Plaza, 20th Floor, New York, NY 10006, USA
477 Williamstown Road, Port Melbourne,VIC 3207, Australia
4843/24, 2nd Floor, Ansari Road, Daryaganj, Delhi – 110002, India
79 Anson Road, #06–04/06, Singapore 079906
www.cambridge.org
Information on this title: education.cambridge.org
© Cambridge University Press 2016
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2016
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4
Printed in Dubai by Oriental Press
A catalogue record for this publication is available from the British Library
ISBN 9781107547544 Paperback
Cambridge University Press has no responsibility for the persistence or accuracy
of URLs for external or third-party internet websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate. Information regarding prices, travel timetables, and other
factual information given in this work is correct at the time of first printing but
Cambridge University Press does not guarantee the accuracy of such information
thereafter.
...........................................................................................................................................................................................
NOTICE TO TEACHERS IN THE UK
It is illegal to reproduce any part of this work in material form (including
photocopying and electronic storage) except under the following circumstances:
(i) where you are abiding by a licence granted to your school or institution by the
Copyright Licensing Agency;
(ii) where no such licence exists, or where you wish to exceed the terms of a licence,
and you have gained the written permission of Cambridge University Press;
(iii) where you are allowed to reproduce without permission under the provisions
of Chapter 3 of the Copyright, Designs and Patents Act 1988, which covers, for
example, the reproduction of short passages within certain types of educational
anthology and reproduction for the purposes of setting examination questions.
...........................................................................................................................................................................................
The past paper questions used are reproduced with the permission of Cambridge International Examinations.
All other examination-style questions and comments that appear in this book were written by the author.
Cambridge International Examinations bears no responsibility for the example answers to questions taken from
its past question papers which are contained in this publication.
ii
Contents
Revision Guidelines PART III ADVANCED THEORY
PART I THEORY FUNDAMENTALS Chapter 13 Data representation 133
iii
Revision guidelines primary key and a foreign key’. However, it is a much better
assessment of your ability if you are able to apply this to a
given simple practical scenario. The question style you are
more likely to face is:
Revision, by the nature of the word, implies re-visiting 1 Which attribute would be the primary key for table X?
content and topics that you have studied throughout the
2 How is the relationship formed using a foreign key to
year. What you already have in terms of resources to help
table Y?
you with your revision will largely determine the way in
which you set about and plan your revision programme. Computing is a practical subject – probably second only to
engineering – and so it is reasonable that your computing
Key issues include:
examination papers should reflect this, with questions that
• Have you got a copy of the textbook you have followed require answers which apply your knowledge in the context
throughout your course? of practical scenarios.
• Did you use it as your course progressed to make your
own notes?
Past examination paper
• Has your teacher provided you with notes as each topic
has been covered? questions
• Have you worked through worksheets prepared by your Looking at as many previous questions as possible can
teacher? be a very valuable part of revision. Many examples from
All of these are a good starting point and your first revision Cambridge past papers have been carefully selected
task is to gather together all the materials you have produced and included at the end of each section in the course
and accumulated throughout the course. Organise them in textbook. (Cambridge International Examinations bears no
the same way as the 9608 syllabus, that is, by section and responsibility for the example answers to questions taken
subsection. from its past question papers which are contained in this
publication.)
Your teacher will be able to supply you with further past
When should I start revising? papers and specimen papers and guide you to relevant
questions for the topic you are revising.
Start as early as possible. Examinations are generally a
stressful time and so you need to do everything possible to So, you’ve trawled through and organised the materials you
make this a ‘stress-free’ experience. have produced throughout the course – what next?
iv
The figures below are for Chapter 8, on databases: How will you organise the cards?
• a separate set for each section
Database design Card 1 (of 10) • a separate set for each topic
Attribute – Data item recorded as part of a database
design. There are some clear links between content in, for
Entity – In database design, something about which we example, Part 1 and Part 3. Assembly language is
record data, for example, a Customer. Entities are introduced in Section 1 and then studied in more depth
implemented as tables. in Part 3. Can you have a system with your revision cards
Primary key – An attribute (or combination of which allows for this?
attributes) chosen to ensure that all the records in a
table are unique.
Relationship – A link between two tables, which can be:
• One-to-one – uncommon
Mind maps
• One-to-many – the most common
• Many-to-many – cannot be implemented with Mind maps provide an effective way to break the content
relational database software down into manageable amounts and if you are a person
who ‘thinks visually’ then you will probably take to mind-
mapping. My experience is that students tend to be
Database design Card 2 (of 10) polarised into ‘I like using them’ or ‘I hate them’ but I have
Foreign key – An attribute in a table which links back to found that students do agree they are a useful revision
the same primary key attribute in a second table. tool. A simple example for (some of) the database content
Candidate key – Attribute(s) which are unique in a table for Chapter 8 is shown below:
and so are a ‘candidate’ to be used as the primary key.
Secondary key – An attribute other than the primary key
for which an index has been created.
Data Defination and Data Manipulation Normalisation Flat files vs. Databases - DMBS
Language
v
Also there is available on the World Wide Web free mind- to bury problems and topic areas about which you are
mapping software and this usually has features which are unsure. Your revision buddy may be confident about it
very appropriate for revision: and after five minutes of him or her talking it through,
something about which you have been unclear for six
• the expansion of branches (to see detail)
months, may become clear for the first time. Failing that,
• the collapsing of branches (to see the ‘big picture’) be honest that you are unsure and seek help from your
• the inclusion of graphics. teacher. Problems do not go away and solve themselves
– you must be pro-active in plugging the gaps in your
knowledge and understanding.
How do I revise?
What time of day?
On the day – examination
technique
There are all sorts of conflicting evidence about when
your brain is at its most receptive! You will need to decide Reading the paper
what time of day seems to work best for you and how
long each session should be. It is sensible to read the entire paper before you start to
attempt any of the questions. This will give you a good idea
as to the questions you are confident about and those
Shall I revise on my own? which may need more time spent on them. The number
of marks is a good indicator of how long you should
Maybe, but it will be much less daunting if you team up spend on each question. Get used to planning how you
with a fellow student – a ‘revision buddy’ – and revise will divide your time for questions through an examination
together. This could include: paper using the marks as a guide. It is a good idea to read
• sharing the work of producing the revision cards or back through your answers once you finish.
mind maps
• testing each other on some basic definitions and the Layout of the paper
factual knowledge of a topic.
Where questions are displayed in an answer booklet, the
amount of space provided is an indicator of the length of
I do lots of past examination answer the examiner is expecting.
questions Is it important to answer the questions in a paper in
order? No, you can answer the questions in any order.
Consider carefully what ‘doing examination questions’ As a general rule questions which are considered less
actually means for you. It is tempting to look at a demanding will be at the start of the paper.
question then, talking to yourself, recite the answer you
would give – then move on to another question. That
might be sufficient but, remember, the examination is a Understanding the question
written paper; why not spend the extra time in writing
out the answer on rough paper? That way when you read command words
it back it may be clear that there are some points which
you have omitted or some points where the meaning is Some questions will have a short introduction (called the
unclear. ‘stem’ of the question) and this will apply to all parts of the
questions which follow. Specific questions will each have
a keyword which is the indicator as to the style of answer
Seek advice expected.
Questions starting ‘Define ...’, ‘State ...’,‘Give ...’ or ‘Name …’
You need to be confident with all the syllabus content all require an answer of only one or a few words giving a
(remember, there is no choice of questions) so don’t try short and concise answer.
vi
For example: For example:
Give the attributes for the Loan table below, showing Describe how an assembly language program is
the primary key. translated into machine code. [2]
You should not create a LoanID for this table. A question starting ‘Explain ...’ wants not only a
description but an answer that contains some
Loan (............., ............,
reasoning.
.............., ..............) [2]
For example:
A question starting ‘Describe ...’ wants more detail. The
indicator of precisely how much detail is the number Explain why an interpreter has better diagnostics
of marks for the question: a three-mark question will features than compiler software. [2]
usually require three different points to be made.
A sample examination question is shown below:
(c) Give one other example of a real-time application. Justify why your choice is a real-time application.
Example:
The keyword is ‘Give’ but you are having to be more resourceful and
Justification: come up with your own example of a real-time system.
The key requirements are the example and its justification. The paper
makes it clear how you are to present them. You can assume there
will be one mark for the example and one mark for the justification. [2]
Cambridge International AS and A Level Computing 9691 Paper 31 Q4, June 2011
vii
PART 1
PART 1
THEORY FUNDAMENTALS
1
Unit 111
Information representation
Chapter
Revision objectives
By the end of the chapter you should be able to:
show understanding of the basis of different show understanding of how typical features found
number systems; use the binary, denary and in bitmapped and vector graphics software are
hexadecimal number systems; and convert a used in practice and are therefore appropriate for
number from one number system to another a given task
express a positive or negative integer in two’s show understanding of how sound is represented
complement form and encoded
show understanding of, and be able to represent, use the associated terminology: sampling, sampling
character data in its internal binary form rate, sampling resolution
express a denary number in binary coded show understanding of how file sizes depend
decimal (BCD) and vice versa and describe on sampling rate and sampling resolution
practical applications where BCD is used show understanding of how typical features
show understanding of how data for a bitmapped found in sound-editing software are used in
image is encoded practice
use the terminology associated with bitmaps: show understanding of the characteristics of
pixel, file header, image resolution, screen video streams: frame rate (frames/second);
resolution interlaced and progressive encoding; video
perform calculations estimating the file size for interframe compression algorithms and
bitmapped images of different resolutions spatial and temporal redundancy; multimedia
container formats
show understanding of how data for a vector
graphic is represented and encoded show understanding of how digital data can
be compressed, using ‘lossless’ (including run-
use the terminology associated with vector
length encoding, RLE) or ‘lossy’ techniques.
graphics: drawing object, property and drawing list
• that digits in cer tain positions each have a place denary (decimal): numbering system using
value base 10 with possible digits 0, 1, 2, ..., 8 and 9
• the number of possible digits used is the base. binary: numbering system using base 2
2
Binary system
Hexadecimal system
The base 16 numbering system can be summarised as shown in Table 1.02.
The Hexadecimal numbering system follows our three The number shown in Table 1.02 is:
basic rules.
(1 x 256) + (B x 16) + 5 = 256 + 176 + 5 = 437 denary
Since the ‘digits’ allowed in base 16 extend past 9 then
we need a way to represent 10, 11, 12, 13, 14 and 15. The
solution in hexadecimal is to use the characters A to F as Conversion between different
shown.
number presentations
If we did not do this, then the hexadecimal We can now convert from binary to denary and vice
TIP
representation 13, could either be versa and also from hexadecimal to denary and vice
interpreted as 13 denary or (1 x 16) + 3 = versa. What about conversion between binary and
19 denary. hexadecimal?
One approach would be to convert into denary first –
but there is a more direct way.
3
Chapter 1 Information representation
Example:
Convert 0011110101010100 into hexadecimal
Divide the binary into groups of four binary digits:
0011 1101 0101 0100
Write the denary for each group
0011 1101 0101 0100
3 13 5 4
We can then convert each denary number to its hexadecimal equivalent:
3 D 5 4 = 3D54 hex
The method can be used in reverse to convert from hexadecimal to binary.
Example: Convert 4AE hex to a binary number stored as two bytes.
Hexadecimal: 4 A E
Denary: 4 10 14
Binary: 0100 1010 1110
‘Stored as two bytes’ means this number will be stored as 16-bit binary pattern as shown in Figure 1.01.
0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 0
Figure 1.01 A binary number stored as two bytes
Note the need to pack out the leftmost group of four bits
with zero bits. 3 What is the eight-bit binary representation for
these integers?
a 3 b 89 c 257
Numbers in the computer
4 Convert these hexadecimal numbers to denary:
All data in the computer must be represented in binary form. a 1A b 10B
Consider a single byte used to represent a positive 5 Convert these hexadecimal numbers to 12-bit
integer. binary representations:
• the most significant bit position has place value of 128 a 7D b 196 c AEC
• the least significant position has place value of a ‘unit’,
that is 0 or 1.
Two’s complement representation
Progress check 1.01 We need to be able to represent both positive and
1 What positive integer is this? negative integers.
One (simple) method would be to use the most significant
0 1 1 0 0 1 1 1 bit to act as a ‘sign’ bit (1 for a negative integer and 0 for a
positive integer) . This method is called ‘sign and magnitude’
2 A positive integer is represented using a single
but is not in our 9608 syllabus.
byte. What is the denary value?
We shall use a representation – two’s complement –
a 0100 0001 b 1010 1010 c 1111 1111
which has a negative place value for the most significant
4
bit. For a two’s complement presentation using a single Each digit of the denary number is represented in
Convert the following denary numbers to an eight-bit Early computers stored date and time values in
two’s complement binary number. the BIOS of the operating system using BCD
representation. Some later games consoles including
1 56 = 32 + 16 + 8 Atari and Sony PlayStation did likewise. However in
2010, the PlayStation software interpreted the final
-128 64 32 16 8 4 2 u
two digits of the date ‘10’ (stored in BCD) as the
0 0 1 1 1 0 0 0 hexadecimal number 16. The resulting date of 2016
made the console inoperable!
2 -125 = -128 + 3 = -128 + (2 + 1)
-128 64 32 16 8 4 2 u
1 0 0 0 0 0 1 1 1.02 Images
3 -17 = -128 + 111 = -128 + (64 + 32 + 8 + 4 + 2 + 1) Bitmapped image
-128 64 32 16 8 4 2 u A bitmap graphic is a rectangular grid built up from a
1 1 1 0 1 1 1 1 number of pixels. A pixel is the smallest addressable
picture element which can be represented. The term
bitmap comes from the concept that the bit patterns
which make up the file are ‘mapped’ to an area in the
Note the method for a negative number. If main memory. Each pixel will be a particular colour. Each
TIP
its negative, we must have the ‘1 lot of -128’ pixel’s colour will be represented as a binary pattern. The
– we then need to work out what positive contents of the bitmap file will be this sequence of binary
number to add to it. colour codes.
TERMS
Representing characters
pixel: the smallest addressable picture
All data – including characters – must be represented in element which can be represented.
main memory, saved in the backing store and processed
by a program as a number value. A coding system such as
ASCII or Unicode will be used.
There are several types of encoding and file formats for
bitmap images:
LOOK FORWARD ››
• Monochrome: black and white pixels only
ASCII and Unicode are discussed in Chapter 10, • 16 colour: 16 available colours for the pixels
section 10.01.
• 256 colour: 256 possible colours
• 24-bit colour (or true colour) where millions of
Binary-Coded Decimal (BCD) different colours are possible.
5
The encoding for each type can be worked out as shown The clarity with which a bitmap image is viewed on a
Chapter 1 Information representation
6
1.03 Sound The sound will be sampled at a set time interval and these
80
70
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Milliseconds
300 301 302 303 304 305 306 307 308 309
8 20 35 44 38 38 48 61 69 75
7
It should be apparent from Figure 1.05 that: Progressive encoding
Chapter 1 Information representation
• If samples are taken more frequently, the quality of the A system which stores the data for an entire frame and
sound wave will increase. displays all the frame data at the same time is called
‘progressive encoding’. This means the frame rate will be
• If a larger number of bits is used to encode each the number of pictures displayed per second. Traditional
sample, the sound resolution will increase. film uses progressive encoding.
Sound editing software is used for the recording of:
• Spoken word using a microphone Interlaced encoding
• The ‘digitising’ of an analogue sound source. An The problem is that some devices, such as a television,
example could be the connection of a record turntable are not designed to display all the frame data at the
to the computer. The sound from a vinyl record is then same time. The data from a single frame is encoded
recorded using the sound recording software as two separate fields; one containing the data for the
even numbered rows and the second frame has the
Editing features of the software would include: data for the odd numbered rows. The term interlaced
• Cutting and pasting of sections of the recording comes from the concept that the image is rendered
by switching between the even field and the odd field.
• Filtering out certain sounds. For example the ‘clicks’ on
It follows that the rate of picture display is twice the
a scratched vinyl record
frame rate.
• Recording as a single (mono) channel or two channels
With increasing demand for the display of video content
(stereo)
through DVD players, set-top boxes and other home
• Normalising the recording level electronic devices there is still a need for interlaced
• Export of the sound recording to a variety of file encoded video format files.
formats. For example MP3. The picture frames that make up interlaced fields have a
correct order relative to each other:
• The spatial order shows which should be the odd or
1.04 Video even field.
Video is in widespread use on computers for recreational • The temporal order refers to a field or frame and
and educational use: which field represents an earlier moment in time.
• YouTube is one of the most popular websites where If either one or both of these orders is incorrect the result
users can post their own video content. of the playback will appear as jerky motion or blurred
edges to content.
• Videos are an excellent medium for an explanation of
the working of a piece of equipment or to provide a
learning tutorial.
1.05 Compression techniques
A video is a sequence of still photographic images which
are displayed in sequence. The frequency with which they Both sound and video files tend to have large file size.
are displayed gives the appearance of continuous motion, Techniques used which encode the data in a way which
and what is contained on individual frames is not apparent. results in less bytes for the file are highly desirable.
The frequency with which the frames are displayed is Compression is the technique of reducing the size of a file
called the frame rate. A continuous effect to the human without a significant loss in the later quality in the use of
eye is achieved with a frame rate of 25 frames per the file.
second or higher.
8
the pixel value followed by the number of occurrences of background. This will contain ‘runs’ when horizontal or
w w w w w w w w w b b w w b b b b g g g g w w w w w w w w w
w w w w g g g g g b b b b b r r r r r r r r w w w w w w w w
w w w w w w w w w w w w w w r r r r r r r r w w w w w w w w
w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w
The first row of pixels could be encoded: • An image which has a large background could encode
9w2b2w4b4g9w. the background pixels with a lower resolution.
Assuming each ‘run number’ is stored as a single byte, the • Colours such as blue, to which the human eye is less
first line will be stored using 14 bytes (compared to the sensitive, could be encoded at a lower resolution.
original 30). This is a very effective compression.
The popular .jpeg file format is lossy.
9
File formats • MP4 (standard container for MPEG-4 multimedia)
Chapter 1 Information representation
Video – which is a combination of moving pictures and • popularity: is the container format widely supported?
sound – requires its own industry standards. The detail This is the reason that the AVI format is still the most
about encoding methods used for this is outside the popular format.
scope of our syllabus. The key issue is that there is correct • overheads: This refers to the difference in file size
synchronisation between the picture display and the between two files with the same content in a different
accompanying sound commentary. container. For a two-hour film, an AVI file may be up to
The current popular multimedia container formats include: 10 MB larger than a file in Matroska format.
• AVI (standard Microsoft Windows container) • support for advanced codec functionality: Older
formats, such as AVI, do not support new codec
• MOV (standard QuickTime container) features, such as streaming media.
10
Exam-style questions
90 003C
How many bits are used for each main memory location? [1]
Cambridge International AS and A Level 9691 Paper 31, Q3 b & c (i) Nov 2013
11
Unit 11
Communications and Internet technologies
Chapter 2
Revision objectives
By the end of the chapter you should be able to:
explain the client–server model of networked explain the difference between a public IP
computers and give examples of applications address and a private IP address and the
describe what is meant by the World Wide Web implication for security
(WWW) and the Internet explain how a uniform resource locator (URL)
explain how hardware is used to support the is used to locate a resource on the World Wide
Internet: networks, routers, gateways, servers Web and the role of the Domain Name Service
explain how communication systems are used describe the sequence of events executed by a
to support the Internet: the Public Service client computer and a web server when a web
Telephone Network (PSTN), dedicated lines, cell page requested and displayed by a browser
phone network recognise and identify the purpose of some
explain the benefits and drawbacks of using simple JavaScript code
copper cable, fibre-optic cabling, radio waves, show understanding of the typical use of client-
microwaves, satellites side code in the design of an application
show understanding of bit streaming (both real- recognise and identify the purpose of some
time and on-demand) and the importance of bit simple PHP code
rates and broadband speed show understanding that a web application for
explain the format of an IP address and how accessing database data makes use of server-side
an IP address is associated with a device on a scripting
network
2.01 Networks • File server: All software and user data files could be
stored on the server. Alternatively the application
Most networks used for business applications are server software can be installed on the client, then requests to
based. the server are for data files only.
In a server-based network, a dedicated server provides for • Domain controller server: This server is used for the
the administration of users, security and resources. There management of user accounts – IDs and passwords. The
may be a single server which carries out all tasks. client computer software will send a log-on request to
the server, which processes it and grants the request if
The server is a computer which provides the the user ID and password are recognised.
administrative tools and resources which are shared by all
computers on the network. • Email server: This server is used for sending, receiving
and storing emails. A ‘sent email’ is sent to the server
for processing and forwarding to the Internet Service
Client–server model Provider. When the client computer requests ‘receiving
email’, the email server sends the request to the server
A client computer application will access various resources of the email provider.
and services provide by a server. • Print server: This server manages print jobs from
There are many types of server, all named after the service network client computers.
they perform. For the most common network applications • Database server: This server manages a database
required by users, this will include: management system such as mySQL or SQL Server.
12
• Web server: This server manages pages available from a The World Wide Web (WWW)
TERMS
HyperText Markup Language (HTML):
The tasks done by a server are varied, but they all have in the publishing format for all web content; it
common: provides for formatting documents and links
• The client computer makes a request to the to other documents or resources
appropriate server. Uniform Resource Identifier (URI): a unique
• The processing of the request is carried out on the address for a resource on the WWW
server. Hypertext Transfer Protocol (HTTP): a
• The server packages the results in a form which is protocol to allow for the retrieval of linked
displayed by the client computer’s software. resources from across the WWW
The Internet and the World Wide The WWW has changed the way we teach and
learn, research information, buy and sell products and
Web communicate globally with others.
The Internet
TIP
The Internet is a global communication infrastructure The terms ‘Internet’ and ‘World Wide Web’
which links together computers and networks. are loosely used and are often thought to
It forms a collection of connected internets and is a be the same – they are not.
packet-switched network. All network traffic is made up
of packets of data with a source address and destination
address. There will be a large number of available paths for
the transmission of any data packet.
Hardware to support the Internet
The communications methods used are various, including Networks
wired, radio and satellite communications. A local area network (LAN) is made up of a set of
The Internet is an open network. Access to it is provided computers which can communicate across the network.
by a company called an Internet Service Provider (ISP). For example, a computer can communicate with a
The Internet protocol used is TCP/IP where all devices file server device, a print server or a user using email.
which connect to the Internet are identified by an IP Network users will want to use the Internet to access
address. content available from the WWW.
Routers
LOOK FORWARD ›› A router is used on a packet-switched network. Data is
organised into packets for sending between the various
IP addresses are discussed in Chapter 2, section 2.02. devices. The common protocol used is TCP/IP and
the routing of packets is done by giving each packet a
destination address.
The Internet is also a transit network that moves data.
The Internet allows anyone to access, retrieve, process
and store all manner of information (e.g. voice, video,
documents, images) in a digital format.
13
some leasing agreement. This contrasts with the shared
Chapter 2 Communications and Internet technologies
Twisted-pair cable: a pair of copper cables, optic cable. Pulses of light are used to transmit a
twisted together signal along a single strand as a modulated light beam.
Coaxial cable: a cable with a central single Because the medium for communication is light – rather
strand wire than electrical signals – the data should be free of
interference and also less susceptible to unauthorised
access.
Twisted-pair cable is a pair of copper cables, twisted Fibre-optic cable has many advantages over copper wire:
together. This is designed to cancel out electromagnetic
interference. • The signals will be free of any interference.
Twisted-pair cable is available in several specifications • Signals do not suffer from a loss of strength
– the simplest is made up of two insulated copper (attenuation).
wires surrounded by the external insulation. One of the • The cabling does not suffer from corrosion.
Ethernet networking standards uses a cable with four
twisted-pairs (called ‘Cat-5’) which supports a maximum Typical applications include any form of long-distance
cable segment length of 100 metres. communication including:
All forms of copper wiring suffer from a loss of signal • telephone communication
strength proportional to the cable length. The shielding • Internet communications
screen is used either as a return path for the signal or as a
• networking.
form of screening to eliminate forms of electro-magnetic
interference.
Coaxial cable has a central single strand wire which is Telecommunications and the electro-
insulated from the outer multi-strand wire mesh braided
around the central insulation. Coaxial cable is also available
magnetic spectrum
in a number of specifications. All forms of telecommunications include some form of
The most widely used bus networking standard for electro-magnetic wave, acting as the signal carrier, and a
the physical layer is called Ethernet. This has developed form of modulation for the signal when the carrier wave
standards based on the transmission speeds called is made to change to represent different signals and hence
10BASE-T (transmits at 10 Mb/s), 100BASE-TX different data.
(100 Mb/s) or 1000BASE-T (1000 Mb/s, i.e. 1 Gb/s).
If two humans communicate by talking, the carrier is a
sound wave and the range of frequencies possible with
LOOK FORWARD ›› a sound wave will limit the possible signals. The same
is true for electro-magnetic communication. Each form
will have a range of frequencies which are possible with
Protocols are discussed in Chapter 2, section 2.02. corresponding benefits and drawbacks which make them
suited to particular applications.
15
Radio waves The range of applications of wireless communication is
Chapter 2 Communications and Internet technologies
Radio waves have the largest range of wavelengths and now widespread and includes:
include AM radio (around 400 m), television (40 m) and • communication for a local area network
FM radio (around 4 m).
• smartphones and other portable devices.
Radio waves are used for:
• domestic antennae receiving television signals sent from
the TV broadcaster radio mast Progress check 2.03
• sending/receiving of mobile phone communications. State two advantages of using fibre-optic cabling
rather than copper cable.
Microwaves
Microwaves have wavelengths measured in centimetres.
Bit streaming
Unlike infrared and visible light, microwaves can penetrate
haze, light rain and snow, clouds and smoke. For this A bitstream is a sequence of bits, representing a stream
reason, satellites which capture pictures of the earth use of data. The sequence of bits will be transmitted
microwave communication. continuously over a single channel. The bits are
transmitted serially, one after the other. The bits probably
Infrared waves originated from software as a sequence of bytes and so
the terms byte stream or octet are also used. The bytes
Infrared waves occupy the range of wavelengths between
could represent any form of digital data – a sequence of
microwaves and visible light. The range of wavelengths
text characters, pixels from a picture or video clip, or a
varies from the size of a pin-head to the size of a cell;
sound file.
they are measured in a unit called a ‘micron’, which is one
millionth of a metre.
The shorter infrared ranges are the wavelengths used for
TERMS
Satellite communication
Artificial satellites orbiting the earth provide
telecommunications between the satellite and receiving/
Real-time bit streaming
sending stations.
The Sky satellite channel in the UK now has the
Applications are numerous and varied: facility to allow a subscriber to watch live television
• satellite radio and television broadcasting on a device such as a personal computer, tablet or
smartphone.
• photography of the earth
The device needs the appropriate software or app. The
• satellite-based Internet communication channel will be a wireless connection for a
• satellite phones PC, smartphone or tablet or a 3G or 4G connection for a
smartphone or tablet.
• military communications.
The BBC in the UK provides a similar facility – called
BBC iPlayer – for the viewing of (some) live television
Wireless
programmes and a service for listening live to its radio
Communication can use any of the wavelengths: radio, broadcasts.
microwave or infrared. The term ‘wireless’ has come to be
used to describe any form of data communication which is
‘without wires’. On-demand bit streaming
Wi-Fi is the term for the industry standard IEEE.802.11. Both Sky and the BBC offer the facility to ‘catch up’ on
Wi-Fi hotspots are now popular, for example, as a way of broadcasts that the user has missed. The user can select
attracting custom to a cafe. programmes which have already been broadcast.
16
The bitstream is saved to the device’s secondary storage
17
DNS server to determine the server’s IP address. If the
Chapter 2 Communications and Internet technologies
18
The web server will continually listen for ‘request 1 The client web browser application requests the page
19
The use of client-side scripting assumes that the client • This code does not contain any structures such as ‘if ’
Chapter 2 Communications and Internet technologies
TIP
The code is embedded in a web page with all the
any client-side scripting language or a server-
HTML tags which determine the page’s format and
content. side language such as PHP in preparation for
the examination.
All programming languages must be either compiled or
interpreted. JavaScript program code statements are You should, however, be able to study a
interpreted, either when the web page is loaded or later, JavaScript program and understand its
in response to some event taking place (e.g. the user clicks construction. You will need to use the
on a button on the page). skills you have learnt from Section 2 to
understand some JavaScript and PHP
Figure 2.02 shows an example of a web page containing program code: using variables, sequence,
JavaScript. selection and iteration.
20
Chapter 2 Communications and Internet technologies
The <Script> tag marks the start
of the program code at line 11
The while loop starts here; there is
no endwhile keyword – curly brackets
The var keyword is are used to enclose the loop statements
followed by variable identifier
The prompt keyword is used
to get input from the user
21
Chapter 2 Communications and Internet technologies
Server-side scripting
Contrast the following sequence of actions with the sequence given earlier for client-side scripting.
If the web page contains a script which is to be executed on the server:
1 The web browser requests the page.
2 The web server is aware it contains code.
3 The web server processes the code (on the server).
4 The web server renders the page content (as HTML tags and text only).
22
5 The web server delivers the page to the browser (as HTML tags and text only).
(a)
(b)
Figure 2.06 (a) PHP server-side code and (b) its output in a browser
When we access a web page with JavaScript, the web page is simply loaded or requested from the file
TIP
system of the computer (Figure 2.04 shows the file path on drive C).
To display a web page which uses server-side scripting, the user’s computer must retrieve the page from a
web server. The usual development environment to do this is to set up a ‘local server’ on the computer. The
author has installed the WAMPP application, which then has the Apache web server running, with a path to
its root folder of ‘localhost’. Note the path displayed in the address bar of the browser in Figure 2.06(b).
23
in Figure 2.08. When the Submit button is clicked, the data
Chapter 2 Communications and Internet technologies
Progress check 2.08 is sent for processing (Figure 2.09) by another form.
This form control is a
button – identifier Submit
24
Make a connection to the
Check for successful
connection
25
Exam-style questions
Chapter 2 Communications and Internet technologies
1 The website www.checkyourwellbeing.com offers help and advice about personal well-being.
The website has a link – ‘Calculate my BMI’ – that users can click to work out their Body Mass Index.
When the ‘Calculate my BMI’ link is clicked on the client computer, this webpage is requested:
1 <html>
2 <head>
3 <title>Body Mass Index</title>
4
5 </head>
6
7 <body>
8 Calculate my body mass index
9
10 <Script Language = "JavaScript">
11
12 var myWeight = prompt("Enter your weight (in kg.)", "");
13
14 var myHeight = prompt("Enter your height (in m.)", "");
15
16 var myBMI = myWeight / (myHeight * myHeight);
17 myBMI = myBMI.toFixed(2)
18
19 alert("My calculated BMI is ..." + myBMI) ;
20
21 if (myBMI < 18.5)
22 {
23 alert("UNDERWEIGHT") ;
24 }
25
26 if (myBMI > 25)
27 {
28 alert("OVERWEIGHT") ;
29 }
30 if (myBMI >=18.5 && myBMI<=25)
31 {
32 alert("WITHIN RANGE")
33 }
34
35 </Script>
36
37 </body>
38 </html>
26
Loading the webpage produced this sequence of dialogue boxes:
b i Give the identifiers of two variables which have been used by the programmer.
2 [2]
ii What group of program statements are performing selection?
27
d The diagram shows the client computer network with the connection to the Internet.
Chapter 2 Communications and Internet technologies
Client computer
Internet
www.checkyourwellbeing.com
web server
e Put five of these statements in the correct sequence to describe how the content of the page shown is
displayed by the client computer’s browser software.
Two of the statements will not be used.
A The client computer processes the JavaScript code.
B The page content is transmitted to the client computer.
C The page is displayed on the client computer.
D The user clicks on the hyperlink and the web page is requested from the network file server.
E The web server processes the JavaScript code.
F The user clicks on the hyperlink and the web page is requested from the
www.checkyourwellbeing.com web server.
G The server finds the web page.
The sequence is: (fill in the letters)
28
g The web developer tested the JavaScript code without involving the web server.
Cambridge International AS and A Level Computer Science 9608 Specimen Paper 1, Q4 2015
A B C D
29
Hardware
Chapter 3
Revision objectives
By the end of the chapter you should be able to:
identify hardware devices used for input, output, explain the differences between static RAM
secondary storage (SRAM) and dynamic RAM (DRAM)
show understanding of the basic internal understand and use these logic gates: NOT, AND,
operation of a keyboard, a hard disk, a trackerball OR, NAND, NOR, XOR
mouse, solid state (flash) memory, an optical
construct the truth table for each of the logic
mouse, optical discs, a scanner, sensors, an inkjet
gates
printer, actuators, a laser printer, speakers
construct a logic circuit from either a problem
show understanding of the need for secondary
statement or a logic expression
(including removable) storage
construct a truth table from either a logic circuit
show understanding of the need for primary
or a logic expression
storage
show understanding that some circuits can be
explain the differences between RAM and ROM
constructed with fewer gates to produce the
memory
same outputs
3.01 Input, output and storage On a typical PC computer, the following would be the
various devices:
devices • Input: keyboard and mouse
One of the fundamental diagrams (see Figure 3.01) to • Output: the monitor
describe a computer system is to distinguish between the
• Secondary storage: the hard disk or a solid-state drive
input devices, the output devices, the processing which
various programs will carry out and the need for both • Main memory: memory chips inside the box
primary and secondary storage.
• Processor: the microprocessor inside the box
Secondary
memory
Input Output
device Processing
device
Primary (main)
memory
30