Cambridge IGCSE® Computer Science Revision Guide 1107696348, 9781107696341

Cambridge IGCSE Computer Science Revision Guide follows the Cambridge IGCSE (0478) and Cambridge O Level (2210) Computer

5,013 855 60MB

English Pages 224 Year 2015

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Cambridge IGCSE® Computer Science Revision Guide
 1107696348, 9781107696341

Citation preview

M CAMBRIDGE UNIVERSITY PRESS

ENDORSED BY

®

Cambridge IGCSE

Computer Science Revision Guide

V


; Input/output box - for example,

read data from the barcode

Query box - for example,

have all

V

barcodes been read?

\ Y

\

S

n\

~

mm

i

it k, i j #

Introduction

The following example illustrates this process.

START

*

/

*

get light

sensor reading

List of items 3

1 computer sends

signal 2

is light reading < minimum?

3

switch on the light

4

use of ADC

5

use of DAC

5

No

Yes

7

1

Write an algorithm In these questions, you are likely to be given a problem which needs to be solved using either a flowchart or pseudocode (whichever is easier).

which , flowchart ora pseudocode using , algorithm an ' Write , For example inputs 100 numbers and outputs the average.' This can be done by pseudocode or by flowchart.

By pseudocode total tres me 0 Many

Possible solution: ] OR 1 T NO H 1 D [ AN L = if 1 X : = Logic statement = [ S = NOT 1 AND H = 1 ]

Giving the following logic network: L

H

s

|Q

tfieer the lx refert requir

Introduction

Miscellaneous types There are many one - off question types set each year in Computer Science exams. Guidelines would always be given on how to set out your answers. The most common type seems to involve binary or hexadecimal registers in control applications such as elevators (lifts), robots, vending machines. For example, the value 200 (base 10) would convert into binary as follows: 128

64

32

16

8

4

2

1

1

1

0

0

1

0

0

0

And into hex as: 8

4

2

1

8

4

2

1

1

1

0

0

1

0

0

0

c

8

e above question types can be found throughout Many more : mples rcises and in the two sample papers at the end of the end of cha; ng these questions, it is advisable to constantly the book. V what is interpreting correctly are you ensure to on refer back to -

required.

ft *

r\

I

Chapter

Introduction to

; j

Computer Science

Learning Summary In this chapter you will learn about: An overview of chapters 2 to 12 • Components of a typical computer system



1.1 An overview of chapters 2 to 12 Computers' Nearly ever , computer

0Seioo

r

cvcl

advocate c quotes and

a very common part of our everyday lives . d at ool sch / ege or k coll wor at a lves invo ^

nt . Historically, not everybody has been an ment. Look at the following three famous : > er any of them have true merit .

Programmers are in a race with the Universe to create bigger and better idiot-proof programs; while the Universe is trying to create bigger and better idiots So far, the Universe is winning!!! ^

.

Rich Cook

Computers are

useless. They only give you answers! Pablo Picasso

There’s word in business circles that the / computer industry likes to measure itself > -makers. The ) ( car USA e Thre Big the against / had ology techn otive autom If : way this comparison goes 32 V a buy could rists moto , y Valle n Silico kept pace with that gets car d poun 30 a or h . p m . . 000 , 10 does that engine , less of price g sellin a at both , 1,000 miles to the gallon \ ’ than $50. Detroit’s response: “OK. But who would / want a car that crashes twice a day? ” Popular 1997 joke

v

Cambridge IGCSE Computer Science Revision Guide

Whatever any of us may think, computers are here to stay. We have come a long way since the Manchester 'baby' computer of 1948 - this machine could make about 700 instructions per second and used about 3.5 kilowatt of power. Sixty years later, a typical embedded computer can make 200 million instructions per second and uses only 20 milliwatts of power. The computer in 1948 nearly filled a room, whereas now a computer occupies only about 0.5 m2 - a considerable size reduction! These advancements continue at an amazing rate and will be further discussed in chapter 12 as part of the future predictions. Chapters 2 to 12 of this book will take the reader through a number of applications, discuss the impact of the Internet, look at problem-solving tools, give an insight into hardware and software currently available and how computer systems operate. The final chapter will discuss some of the possible advancements we all might see in the coming decades.

1.2 Components of a typical computer system software.

puter system is a combination of hardware and

h

monitor

processor + internal memory

mouse

keyboard

Computer system



fei

\

r

Introduction to Computer Science

The function of the above components will be the following chapters.

discussed iin greater depth in

The hardware usually comprises the following.

- Input devices (such as keyboard, mouse, microphone) - Output devices (such as monitor, printer, speakers)

-

Secondary storage (such as DVD/CD reader /writer) .

Hard

Random access memory

There are alsc

s such as the following.

- Random ac < - Read

RAM)

only

M)

- Internal hard d

e

%These are covered in several sections of chapter 11.

- Central processing unit (CPU) or microprocessor.

Key Point

The CPU interprets and executes commands from the computer hardware and software; it is now usually on a single integrated circuit.

Software is usually of two types. run to are dw har the w allo t tha ms gra pro - Systems software which are ) s tem sys ng rati ope , le mp ( exa properly for form per to rs use w allo t tha ms gra pro are - Applications software which ) . rs sso oce dpr wor and ets she ead spr ng usi , specific tasks (for example and fers buf use s ice dev put out / ut inp It is worth mentioning here that most ices dev all of use t cien effi g win allo interrupts to communicate with the CPU

and the CPU itself .

be to dy rea is it il unt d hel is A buffer is a temporary store where data the il unt fer buf ter prin a in d hel processed. For example, data will be will fer buf rd boa key a ; ts ten con printer is ready to print out the buffer store key presses until they can be processed, etc. w allo fers buf , CPU the n tha Since input/output devices work more slowly ) ted , prin le mp exa ( for the data to be stored until it can be processed . ime ant me the in ks tas enabling the CPU to do other

%Refer to chapter 11.

%They prevent slower devices holding up faster devices.

1

Cambridge IGCSE Computer Science Revision Guide

%Also refer to chapter 12.

Key Point

Buffers compensate for the different operational speeds of the various components that make up a typical computer system.

I

Interrupts also allow for more efficient operation of a computer system. A device will send an interrupt signal to the CPU indicating that it needs attention (for example, a printer is out of paper or out of ink and a CD is almost full). The CPU will suspend what it is doing to service the interrupt

and then return to its task once the problem is cleared. Interrupts can also be generated by software, for example, division by zero and out of data error - these interrupts again will need to be serviced and the system cannot return to normal until the issue is resolved. i

I

U

:v

outside normal

^

range

Yes *^

DAC

j

warns operators

> No

1

Yes

send a signal to process to alter settings

i

"

j

DAC

. systems different Let us now consider in detail two very (1) Monitoring ts

Example 1 - a burglar/security alarm system

e

, red infra , ( pressure gather • data from sensors motion) in the house • signals are sent to an ADC where they are converted into digital • the information is then sent to the computer • the computer compares this information with pre -set data

;

%DAC is used to convert signal to analogue so that computer can interface with alarm.

2

Cambridge IGCSE Computer Science

• •



Revision Guide

hig h too and pre ss ure , exa beam has been mp le ( for ran ge if it is out of ala rm an so un d to is sen t sig na l a ) the n broken set re is sys tem un til so un d to alarm continues off tur ne . d un til se ns ors mo nit or to con tinues system

Example 2 - monitoring the pollution in a

river

• sensors at position 'A' take readings river

sensors

sensors

at

at

position

position

‘A’

data logger

B’



(pH, carbon dioxide/oxygen levels and temperature) sensors at position 'B ' also take readings to



measure the same set of parameters the sensor data is converted to digital using



an ADC the data is then stored in the data logger

• the collected data is downloaded every 24 hours from the data logger or is sent automatically via a communications link ... • ... to a computer in the research laboratory • readings from the sensors at position 'A' and position 'B' are compared by

the computer • the results are > o . , n on a screen in the form of graphs, for example, or stored in a spreadsheet for further analysis • theresu * o . e sensors are also compared to data stored in the compe te : or example, acceptable values or data readings taken on previous days) • this allows predictions of pollution levels to be made or supply evidence that pollution is getting worse or better. (2) Control

Example 1 - a chemical process which is temperature ( must be 80°C) and pressure (must be 2 bar) dependent

u f o

heater sensors

temperature sensors and pressure sensors constantly collect data from the reactor vessel this data is sent to an ADC where is co it nverted

to digital

the information is then sent to

reactor

vessel -

valve

K

t -

computer

the computer temperature reading is compar ed to pre-set value if temperature < 80°C a signal is sent to an actuator to switch on the heater pressure reading is com pared to pre -set value if pressure < 2 bar a sig 1 nal is sent to an actuator to Pef the valve DAC is used to convert signals to analogue to control heater and valves this continues until the chemical process is complete

°

^

Computer applications

2

Example 2 - control of street lighting



*

light sensors on the top of the lamp measure how strong the light is • a signal is then sent to a microprocessor in the lamp body ... • ... an ADC is used if the signal is analogue since the input to the microprocessor must be digital • the microprocessor will contain light' values which are compared to the input data • if the input is less than the stored value ... • ... the microprocessor sends a signal to the lamp unit and the lamp is switched on • to prevent the lamp keep switching off and on as light changes (for example, heavy cloud cover), the microprocessor will send signals to keep the lamp on for a pre-determined time duration • after this time duration has passed, the data from the light sensors is again read wiihin an acceptable range, the microprocessor sends out a signal ... • ... and the lamp is switched off s ays on for another time duration before it is • otherwise checked again - sensors continues until the system is deactivated. • this monitoring

Note E'

rk using electronic clocks rather than using light : alically switch the lamp on or off at fixed times during sensors and c the day. Since :he on or off times are dependent on the time of year, a microprocessor is used to store these on or off times and it sends out signals to switch the lamp on or off. The microprocessor will check the actual time against the stored times ( which will be different for every day in the year) and when a match is made , a signal will be sent out to switch the

Some stree

lamp on or off.

? processes control and monitor Why do we use such systems to

• •

• • ten



. process a in problems to response It is safer due to faster operate can workforce human though Computer systems work 24/ 7 (even ). handover shift , a example for , during in shifts, key data can still be missed , example ( for frequently more readings Computers can take and analyse to do). person a for difficult very be every 10 seconds which would of chance less is there so accurate Computers are generally more

%

Computers do not get tired or miss key data which could lead to an incident.

misreading data. data analyse and display automatically Computers have the ability to taking when case the be without the need to transfer data (as would data manually.

B

Guide Revision Science Computer IGCSE Cambridge

Actuators involving sensors and applications control many Actuators are used in electromechanical usually are devices They . microprocessors computers or (solenoid) but digital be can Actuators . such as a motor, relay or solenoid ) the since ( DAC actuator converter analogue to digital others require a

, valve a or for motor a operate to voltage needs an electric current/ example.

in applications this of number a in mentioned is The use of actuators applications of number a involving at look to chapter. The reader is advised ways these many interact the of some out find to sensors and actuators . environment control a in microprocessor or computer a with

2.4 Robotics Robots are used in many industrial applications. They basically carry out humans but have many advantages which will be ually either linked to a computer system or have processor. Before carrying out any tasks, they are programmed by one of two methods. s programmed with a series of instructions which allows it to he tot. carry out a set of pre-determined tasks. (2) One of the skilled workers carries out the tasks manually and the movements/actions are relayed back to a computer; these actions are converted into instructions which are then stored in the memory. The robot is then operated under computer control copying the movement/ actions of the human operator.

( 1)

1

Robots rely on the use of sensors which continually gather data about its surroundings. Example is a car in the correct position to be sprayed with paint, is the paint spray gun empty, is there an obstruction in the way, is a part missing off a circuit board, etc. They are capable of doing some pseudo- intelligent tasks (for example, different sized cars needing to be painted) but in reality any non-standard routine is better carried out by a human operator. There are a number of advantages and disadvantages of using robots as discussed below.

Advantages

• •

Robots are capable of working in conditions which may be hazardous to humans. They can work non-stop , only needing a break when maintenance is due.

I I

Computer applications

,

TheV a e less exPensive in the long run since they do not need a salary. Robots are generally more productive (they can usually do a given task in a shorter time than a human). They are not necessarily more accurate than humans - however, the work that they do is much more consistent. They remove the need for humans to do boring, repetitive tasks leaving them free to do operations such as quality control. Less cost on factory environments - if human workers are absent from the factory floor then heating and lighting, for example , only need to be a minimum.

Disadvantages Robots can find it difficult to deal with non-standard situations, , a door missing from a car waiting to be sprayed; a for exa Windsor about to be fitted to a car being cracked. They te reduce the need for human operators causing unemplc; - ent. take over the tasks done by humans, there is Also since a risk cr c U king within the work force. done anywhere using robots, factories are often Since wen es where labour and operation costs are much lower. moved to
kl ar then tm en ud st if highestmark : = studentmarkl ; total := total + studentmarkl ; write ('Enter student mark '); readln (studentmark2); if studentmark2 > highestmark then highestmark := studentmark2; total : = total + studentmark2; write ( 'Enter student mark ') ; readln (studentmark3 ) ; if studentmark3 > highestmark then highestmark :=

studentmark3; total := total + studentmark3 ; total /3 ; average



With this program to find the average, and highest marks for three students using an array. var array studentmark [1 . .3] of integer; r ege int ; : ex ind , rk tma hes hig , al var tot var average : real ; highestmark : = 0 ; total : = 0 ; for index : = 1 to 3 do begin ' ; ) k mar t den stu ' ( er te wri Ent readln ( studentmark[ index]) ; rk tma hes hig ] > ex [ ind if studentmark ] ; ex ind [ then highestmark : = studentmark ] ex ind [ total := total + studentmark

end ;

average



total/3;

.

end am to y eas be uld wo it , 30 , e mpl exa If there were more students, for uld wo re the but 30 to 3 g ngin cha by program using the array

, . m , gra pro flrs tdTbe man,more lines o code fo the databases

tion rma info filing of Cabases are basically an electronic way . data of g ckin che eff icient storage, retrieval and cross

to

allow

I

5

/

Guide Revision Science Computer Cambridge IGCSE to structure the data in a used methods There are several different . book this of scope the this is beyond

A4 '4

/

database, but

found in many properties the highlighting databases: , it is worth

However

i

Tables

/

4

known is as a row Each . record columns and the and rows in stored is Data data items are known as fields . identification record

record

101216 101218

date of birth 12/12/1964 23/08/1984

name F. Bloggs N. Smith

telephone 314 816 2000 381 2341268

fj /

9

/

sex

t

M F

5 !

fields

Each field in a record has its own data type. The data types in the fields can be text, alphanumeric, numeric, Boolean or date/time. In this example, the following data types have been chosen. Field name

Data typ&

identification

numeric

ric - can be sorted on numerical order numeric - can be given a fixed length

*

aiiirto

name

text

date of birth

date

Automated checking provided by most database management systems, for example , the month must have values from 1to 12

telephone

alphanumeric

Not used for calculations, can include other characters beside digits , for example, + ()

sex

0

iiaii

sen for choice

or alphanumeric

:

be sorted in alphabetical order

Boolean

Boolean - only two choices M or F text - can have validation rules set for a single character restricted to the values M or F

or text

eA

"

J

^

^^

\

Primary key A primary key is a field that uniquely identifies a record in a table, for example the field 'identification' in the above table. The field ' name' e suitable as a primary

would

key because the same name can occur more than once. A primary key must always be unique.

0

Queries

:rma

,ion ,o be

filtering so only the required is

e ^ ^ examp records and fields are seen. Query - by -

used to perform a search from given criteria.

'

$

NK m

N

Programming languages and programming

Examples of query-by-example of a database table for WORLD CITIES: tion sec this Consider Country

Continent

China

Asia

13.9

2

Mumbai

India

Asia

13.8

3

Karachi

Pakistan

Asia

13.0

4

Delhi

India

Asia

12.6

3680 29150

5

Istanbul

Turkey

Eurasia

6

Sao Paulo

Brazil

America

7

Moscow

Russia

Eurasia

Japan

Asia

New York

USA

America

London

UK

Europe

12.5 11.2 10.6 8.9 8.4 7.8

6210 7380 9770 14400 10450 4860

Colombia

America

7.3

4570

620 790 1580 1590

America

6.3

5350

1180

Name of city

nghai 1 l Sha —— ————



10

11 ! Bogota 12

Density

Rio de Janeiro

Area

7170 22940

1

8 Tokyo 9

Population

1930

600 3530 430

1830 1520 1080

Note the following:



• •

c s ord rec 12 are There record has 6 fields. Population is in rr If the following que;

Field:

Table:

this section of the database table and each

ansity is per km , Area is in km by- example was run 2

2

Name of city

Continent

Population

WORLD CITIES

WORLD CITIES

WORLD CITIES

Sort:

Show: >

= ‘America ’

Criteria:

8.0

or :

. put out be uld wo then Sao Paulo and New York

The following query - by - example: Field: Name of city Table: WORLD CITIES

Country

WORLD CITIES

Density

Area

WORLD CITIES

WORLD CITIES

Sort: Ascending

Show:

Criteria:

IZl

10000

Toky and , rk Yo Mumbai, New

5

Cambridge IGCSE Computer

Guide Science Revision

grid example by should query the in names match field up the that Note . table database the in names field the with exactly for column a each using field constructed require are Query -by -examples : information following this contains the

^

/

Field: name of field in database table Table : Sort:

Show: Criteria:

or :

name of database table ascending, descending or bank for not sorted

field this show not do D field this Bshow all the criteria for each field in this row are joined with AND

use this row for OR

File maintenance Files stored on databases need to be regularly maintained to ensure they are up to date and accurate. Updating usually involves amending; inserting or deleting of data. To show how this works, we will consider a hospital keeping records of its patients on a database. An example of amending would be: updating telephone number, address, name (the patient may marry and change their surname) and so on. An example of inserting would be: a new patient came to the hospital for the first time and a record would need to be inserted into the file. An example of deleting would be: a patient dies or moves to another country

5.6 End of chapter questions The next two questions require logo to be used to produce the two shapes shown. In each question, the squares are 10 cm by 10 cm and the diagonals are 14 cm. Use the following list of commands only to draw your shapes. Logo command

Meaning of command

FORWARD n

Move n cm in a forward direction Move n cm in a backward direction Turn right (clockwise) through t degrees

BACKWARD n RIGHT t LEFT t

PENUP

PENDOWN REPEAT X

ENDREPEAT

Turn left ( anticlockwise) through degrees t Lift the drawing pen up

Lower the drawing pen Repeat next set of instructions x times Finish the REPEATk T

^

\

s

1

1

1

s

Programming languages and ~ *i

i

i i

1

45°

i

--

-- - -i

--

Start

.

r

——

i

Finish

5.6 2

v ltr. u

J

-

l


300

-

Complete a query by-example grid to find all freezers which operate below -25°C and have a capacity which is more than 0.24 m3.

(d)

Field: Table: r

Sort: Show:

,

)

Criteria:

-

or:

y

i

.

of er numb a of es featur s variou show to 5.6.10 A database tab e was set up : below n show is table ase datab this of airport. Part

HOTELS near an ref

hotel

no stars

no

1 2 3 4

5 6 7 8

9

Grand Northern

Western Quality

Albion Orion

Denver Wellbeing

Classic

3 4

2

5 3

2 2

3 4

weekday

weekend

no of

km to

tariff ( $ )

tariff ( $ )

rooms

airport

50.00

40.00

21

5

70.00

60.00

64

4

45.00

40.00

20

8

75.00

150

2

50.00

40

15

25.00

32

20

30.00

20

15

35.00

50

10

60.00

75

6

100.00 60.00 35.00

40.00 45.00

80.00

? table ase datab the of n sectio this (3) How many records are shown in (b)

? key ry prima Which field is the

5

Guide Revision Science Computer IGCSE Cambridge was grid used: example by query following If the

(c)

Field: Table:

ref no

HOTELS

no stars

HOTELS

weekend tariff ( $)

HOTELS

Sort: Show:

Criteria:

or:

=4 >45

t

What would be output ? (d)

Write down the query- by-example grid to find all hotels which are less than 10 km from the airport or have more than 50 rooms and a weekday tariff which is less than $ 100.

Field:

Table:

w

Sort:

HIS

Show:

s

Criteria:

( Mi

or: ( e)

Write down the query- by -example grid to find all hotels showing ref no only, with the records in ascending order after being sorted on weekday tariff ($).

*

A

Field

Table Sort

Hi

\

Show

Criteria or:

I

«in S

,„ 6

, ,

,

5

-



A company wishes o keep details aboo its employees who work i da abaM able TbS r 0rd ' employee is

mw





Name: Sex :

Alphanumeric Alphanumeric Alphanumeric Alphanumeric

Department: European country: Number of years working

in company:

20 characters 1 character 1 character

12 characters

Numeric

The following codes are used in the Sex:

Department:

2 digits

records: F = female M = male A = administration P = personnel M = management F = finance

Two records fror

W

database table are shown below:

L S 0 N

P H I L L

F M I T A L Y K G

M F R 0 M A N

A

(a)

In which de

(b)

Show how vould store the record for a Miss M Majid, who works for the personnel department in Germany. She has worked in the company for 9 years.

(c)

rient does KG Phillips work ?

Give two advantages of using codes when saving data in files.

(d)

in working years Why is it NOT a good ? store to information of piece company ? What would be a better

(e)

to suitable are table database this Explain why none of the fields in

idea to store No of

be used as a primary key. (f)

length and type data , Suggest a new primary key field giving name key. primary a as use to and explain why it would be suitable

Q

I

\

Chapter

A

f

Flowcharts

Learning Summary

*

$

In this chapter you will learn about: subroutines and routines library , menus design , down , Structure diagrams top 0 Common flowchart symbols 0 Problem solving using flowcharts 0 Dry running of flowcharts ( trace tables ) In this chapter we will look at various uses of flowcharts and consider how to produce them and also how to interpret them.



*

HI

V

epresenting a problem, a task ora problems, they are also known as

Flowcharts are a diagr: sequence of instruction an algorithm.

Structure diagrams are a graphical way of representing a problem showing different levels of detail. For example, look at the following example which shows items in a department store.

sometimes

called tree diagrams.

tyit up

6.1 Structure diagrams, top down design, menus, library routines and subroutines %These are

r0 mt

^

1

»aoBi 'M ,

\

X

Store items

Clothing

Hardware

; electrical

m tv

other

computer

furniture

other h/ w

\ bedroom

other

other

glassware

women

I

men

designer

j

j

general

general

packaged

\ designer

[ frozen

\ tinned

Flowcharts stage breaks down into increasingly greater each how Note levels of detail. concept to top down design where a given similar a is problem is This increasingly into smaller down and smaller tasks. broken

Key Point

This method is frequently used to develop large, often complex , software packages where each ‘chunk of ’ the software is written in the form of a module.

6

%The smaller

tasks are known as modules.

These modules are all put together to form the main program. This allows several programmers to work on the same software package and makes testing easier since each module needs to be tested separately. Finally, the modules are linked and the whole program/package is again tested to ensure that there are no clashes between these linked modules. This method allows for a very structured approach and also permits a library of routines to be sed. This saves having to design the routines/ ?refore saves time and money) and they will modules each time (? ' the routines/modules may be used in many also be fully pre-testc i per nit compatibility (for example, passing of data software packages, between programs) .

%Library of routines are procedures, modules or subroutines stored in a ‘library ’ which can be used in other software where required.

software packages tend to be much larger The only real drawba (taking up much mor /) and less efficient since the routines/ plication when compared to writing a single modules may have a I . , c|y - however, this would be a much slower software package ' fro fast with computers modern of advent e and more costly exer techniques programming these allowed processors and large m . ories has to become more common. form some have usually Menus Menus make full use of structure/tree diagrams. . options select to screen of pointing device (for example, mouse) or a touch the in be could items In the example used earlier, the department store . screens form of a series of menus linked to several different

hardware

Screen 1 ( menu 1)

clothing

select or touch one of the three options

food

women men

y\

Screen 2 ( menu 2)

select or touch one of the two options

m

Gui de Rev isio n Cambridge IGCSE Computer Science

Screen 3 (menu 3)

general

C

4

designer

shirts coats

select or touch one of the two options

jeans

Screen 4 (menu 4)

other

select or touch one of the four options

The menus could go one stage further offering price, colour, size or style options. Note that once clothing is selected from menu 1 the user is directed to another screen where a new menu appears. The user is directed to new screens and menus until the required level of choice is reached. However, it is also possible works where there e prevent input of irrelevant your date of birth.

5

Irop down menus. This type of menu of options (as above) and they also :> the system. For example, choosing

% p

Here the user has chosen day 3r month 4 and year 1992.

day

month

year

1 2 3 4 5

adrnn

^

recuirpri

1 2 3 4 5

V

$

1990 1991 1992 1993 1994

1995

j ^ | the menu options appear in l User tben * ^ °n ^Ch by '9hts the value they want. The to >

-

t 0

* the menu menu nnf options approach

0Sen

dickin9 on a mouse. This is different

s

shown in the previous example.

With drop down menus , the possible on men box u optio a ns in show are n the same screen The user ‘drags’ the mouse across to each drop down menu in turn until the required option is reached.

Cascading drop down m department store as th another drop down

options

were shown.

tbe c ncept a little further. Using the to a 9 ain each lead s highlighted option ' and so on until the desired level is reached.

°

1

v nr rT

r

*

«

1111

11

Flowcharts

hardware women

clothing

food

men

>

general

designer

shirts jeans

price

coats

size

other

colour style

ser

Cascading series of drop down menus show which item was selected (using menu. All the menu options are shown on one a pointing device) fro < screen and the user lr : ie mouse across to each drop down menu in turn.

IS

%Note that the menu options in the next menu are only revealed after the user has selected an option from the previous

menu.

u

also

6.2 Common flowchart symbols

mm

. symbols flowchart common We will first consider the more

c

990 991 a:

993 994

START

start box shows the beginning of any flowchart

)

i

i

(

END

the where shows box end

)

flowchart terminates

i

, calculations shows process box

. etc , summations

sum 3?

No is engine > 2?

Yes

*

tax = 0?

Yes

number - number +1

*

No

is number ^O = 1?

^*

.

sweets - sweets +1

*

No

is number = 2?

Yes

J

mags - mags + 1

>

drinks < drinks +1

*

No

is number = 3? ^ No

OUTPUT ‘error!’

i

form

Yes



END

This is an interesting problem since it shows a clever way of finding a value.

6

bridge Cam

Computer IGCSE

Revision Science

em 5 been carrying out 5 have Some students temperature readings were 20 ; experiments

Solution START

taken

_ alU intvtotal -

highest

, r r ~ Gui

form of the in , algorithm an Write of the all inputs , which

°

a

-

t

t it

flowchart

readings, and outputs the temperature for EACH temperature ) average (mean ) temperature ( mean average the

expt or an expression.

, Jw „ Counting

, example for ; languages ramming many prog

Counting is a very common task in 7 count + old r < ount newc , terms count count + 7 which means, in computer and is simply a count in 1's.

Totals

4- total + total , example for ; ther tog This construct adds a series of values . number + total old 4 total new , term number which means, in computer ^

InPut and output

following data output and The commands input data into a computer as written ( sometimes temp input SOrrie 0rrn of processing; for example, ). sum print as written read temp ) and output sum (sometimes

*

^

It is possible to count in any increment required; for example, count uts

MIL symbols

AND gate NOT gate

fth*

%There are many

)

(



NANDgate

OR gate

different logic gates but we will concentrate on these.

Science Computer Cambridge IGC5E

Guide Revision

8.2 Truth tables . The NOT gate has only functions gate logic show to used are Truth tables one input, but all the others have two inputs. When constructing a truth table, the binary values 1 and 0 are used. Every possible combination, depending on number of inputs, is produced. Basically, the number of possible combinations of 1s and Os is 2n where n = number of inputs. For example, 2 inputs have 22 combinations (i.e. 4), 3 inputs have 23 combinations (i.e. 8) and so on. The next section shows how these truth tables are used.

Description of the six logic gates NOT gate

A

*

NOT

+

The output (X) is true (i.e. 1 INPUT A is NOT TRUE (i.e. 0

X

X

A

or ON) if:

INPUT A

or OFF)

Truth table for: X = NOT A

OUTPUT X

0

1

1

0

AND gate

A

X B

The outPut (X) is true ( j.e 1 or ON) if ; INPUT A AND INPUT B are BOTH TRUE (i.e. 1 or ON)

-

Truth table for: X

= A AND B

'

ll

INPUT B

X OUTPUT

0

0

0

1

0

1

0

0

1

1

1

INPUT A 0

\

\

Logic gates

A

A

OR

te

*

X B

B

INPUT A

INPUT B

OUTPUT X

0

0

0

0

1

1

0

1

1

1

true (i.e. 1 or ON) if: ) is ( X output The

( e. 1 or ON) . TRUE is i B INPUT OR A INPUT

1

R O B A X : for table Truth

NAND gate /

*

A

A

NAND B

*

B

INPUT A

INPUT B

OUTPUT X

0

0

1

INPUT A AND INPUT B are NOT BOTH TRUE (i.e. 1 or ON)

0

1

1

Truth table for: X = NOT (A AND B)

1

0

1

1

1

0

INPUT A

INPUT B

OUTPUT X

0

o

l

0

1

0

1

0

0

1

1

0

The output (X) is true (i.e. 1 or ON) if :

X

NOR gate A

> X

NOR B

,NPUT

output (X) is true (i.e. 1 or ON) if:

X

:

A OR INPUT B are NOT BOTH TRUE (i.e. 1 or ON)

Truth tab e for: X = NOT (A OR B)

*

gate A

XOR

B

*

x

8

m

Cambridge

Guide islon Revi Science IGCSE Computer The

) : if ON or 1 ( . e . i output (X) is true

) ) OR B INPUT ( NOT { INPUT A AND ) B INPUT ) ((NOT INPUT A AND ) ON or 1 ( . e . i TRUE is ) both not but (i.e. one of the inputs is 1 ) ) OR B ( NOT ( AND A X Truth table for: =

2

INPUT A

INPUT B

0

0

0

0

1

1

1

0

1

1

1

0

OUTPUT X

((NOT A) AND B)

algebraic by replaced be statements can All of the above logic statements of scope this the text outside is this book ) Whilst . expressions (i.e. Boolean . further algebra Boolean investigate to readers may wish Boolean expression

logic gate

NOT A

A

A AND B

A.B

A OR B

A+B

A NAND B

A.B

ANORB

(A + B)

AXOR B

(A . B) + (A . B)

*

8.3 Logic circuits/networks Logic gates can be combined together to produce more complex logic circuits (networks). Key Point

The output from a logic circuit ( network ) is checked by producing a truth table.

ji

ll

'

Two different types of problem are considered here:

\

- drawing the truth table from a given logic circuit (network) - designing a logic circuit (network) from a given problem and testing 1 by also drawing a truth table.

k

Example 1 Produce a truth table from First part

There are three ilnPuts; of 1s and Os.

the following logic

circuit (network).

thus we must have 23 (

i.e. 8) possible combinations

To find the values ( outputs) at points P and Q, it is necessary to consider the truth tables for the NOR gate (output P) and the AND gate (output Q), i.e. P = A NOR B Q = B AND C

\

To show how uns works, we will split the logic circuit into two parts ( shown by the dotted line ) .

Merits

boot *

We thus get:

INPUT A

INPUT C

INPUT B

OUTPUT P

OUTPUT Q

0

Second part

There are eight values from

to inputs the P and Q which form

gate .

Hence we get X = P OR Q which INPUT P

rthe i.«-

: table truth following the gives

OUTPUT X

Revision Science Cambridge IGCSE Computer

* Which now gives

logic circuit given the for at 1 table truth final us the

: example the of start

INPUT B

INPUT C

OUTPUT X

0

0

1

0

1

1

1

0

0

0

1

1

1

1

0

0

0

1

0

1

0

1

1

0

0

1

1

1

1

INPUT A 0 0 0

Example 2 Consider the following problem. A system used three switches A, B and C; a combination of switches determines whether an alarm, X, sounds:

it

Remembering that ON = 1 and OFF = 0; also remember that we write 0 as NOT 1.

If switch A or switch B are in the ON position and if switch C is in the OFF position then a signal to sound an alarm, X is produced. It is possible to convert this problem into a logic statement.

So we get:

If (A = 1 OR B = 1)

/

AND

!

(C = NOT 1)

then X =

\

The first part is two inputs (A and B) joined by an OR

The output from the

gate

first part and the third part are joined

The third part is one input (C) which is put through a NOT

by an AND gate

gate

So we get the

following logic circuit (network):

A

OR B

AND

C

X

'

\

Logic gates following truth the : table gives This

INPUT A

INPUT B

INPUT C

OUTPUT X

0

0

0

0

0

0

1

0

0

1

0

1

0

1

1

0

1

0

0

1

0

1

0

1

1

0

1

1

1

1

0

Example 3 A manufacturing process is controlled by a built in logic circuit which is made up of AND, OR and NOT gates only. The process receives a STOP signal (i.e. X = 1) depending on certain conditions, shown in the following table.

es he OFF

INPUTS

BINARY VALUES

V

T

ien X =

S

s

CONDITION IN PROCESS

1

Volume > 1000 litres

0

Volume 750°C

0

Temperature 15 metres/ second (m/ s)

0

) ( s m second / metres 15 / Speed

.e. 1 9 8 / 1 1 = 18

i

,,

i he

remainder 0

hence, the check digit

was correct.

"

.

is NO remainder hen the

*

>

*

V|

* i

i

1)

ere ar?1

%k

use Of

'

Data systems digits can essentially identify three types check that of err Note er r: been have digits inverted: two if - example, 23496 instead of 23946 for has digit been input ect incorr an if for example, 23996 instead of 23946 , „ d ri omitte been has or an extra * - if a digit for example, 2396 or 239966 instead of 23946

°

^

10.3 Verification techniques



ftion

fonanc fc '

*

4) + (5il

er, ifan j

*

: e cation with proof reading where no second medium Do not con is involved - only the paper document or on screen document are checked but not against each other; with proof reading only one medium is read to see if it makes sense or there are no spelling mistakes.

Double entry Here data is entered twice (by two different people) and the computer checks that they match up; an error message is output if there are any

discrepancies.

Visual check vs

As the name suggests, this is a manual system; the original data is the t agains ng checki and it g readin red compa to data typed in by manually

ydto

0riginal

he / .

document.

Parity check ted corrup been has data This is a technique used to check whethe to m mediu one rom following data transmission or copying th onto d adde is another A group of bits is allocated a use even par/ty require end before transmission takes place. that use o Pa an even number of 1 in each group of bits, system s sy s group our me assu squire an odd number of 1s in eac gr ^ sev ) s contain of bits ( er numb which we will now refer to as a binary digits; for example:

^

J

+ ) 3 x

,eck

^ ^

0

1

0

1

0

1

^^ 1

is there since 0 be to needs bit parity then the

lfthe system uses even parity alreadV an even number of 1s.

-

10 i

2 \ " |l/ *V U

Verification is a way of preventing errors when data is copied from one medium to another. There are a number of methods used to do this which are either manual or computer-based.

;

I



%This is useful when data is being copied from hard copy to computer file on a CD.

10

Science Computer Cambridge IGCSE

Guide Revision

parity the then bit , parity odd needs to uses b system the if , ; However Our binary 1 . s of number number odd an befor have must we 1 since : becomes then transmission

parity bit either

0 1 0 0 1 0 1 1

or

1 1 0 0 1 0 1 1

for even parity for odd parity

n^+ totaled again k is s it 1 and if of number b the , end no* ® ven At the receiving • r ; occurred has if it isn't odd for error an then , system parity even an for odd parity system, then again an error has occurred. i

i

(i) What is the parity bit for the following binary number

which uses even

parity: 1 1 1 0 1 1 0 (ii) What is the parity bit for

the following binary number which uses odd

parity: 0 0 1 0 1 1 0

If two bits have been changed after transmission, it is possible for this parity check to fail to find the error. For example, using the above binary number again, 0 1 0 0 0 1 1 1 is clearly incorrect, but the parity still shows up as even and the parity check wouldn' t detect an error in this case. ery often parity blocks are used to help identify where an error has occurred, n t |s method, a block of data is sent and the number of 1s are added ca ly and horizontally in an attempt to locate an error at the receiving end. For example, suppose seven binary numbers have just been transmitted and an even parity check is being used by the system. A parity byte is also sent along with the seven binary numbers. This parity byte consists entirely of additional parity bits found f rom a vertical parity check on the seven binary numbers and is usually sent to indicate the end of the data block. Now suppose the transmitted data has arrived as follows (each binary number sent is shown as row 1 to row 7 together with the parity byte). parity bit row 1

row 2 row 3 row 4 row 5 row 6 row 7 parity byte:

1

1

column 2 column 3 0

1

0

0 1

1

0

o

1

0

1 1

0 1

0 0

0 0

1 0

1

column 4

column 5

1

column 7

column 8

0

1

1

0

1

0

0

0

0

0

1

1

0

0

0

0

1

0

1

1

1

1

1

0

0

0

0

0

l

1

1

column 6

l

o

0

0

0

1

.

v

'SC ViJ

St

«» l |

1

N a

*

\

*

Data systems

1

mark up lang hype ( uage rtext ) HTML ,;

>.

i

Hr; Pie

Hypertext markup language (HTML ) is used to write content on web paqe s ; langu age mark up and not a programming it is a language. HTML makes there , must be a beginning tag and tags > < of use an ending tag to make the code display correctly. For example, starts an organised list

ends an organised list

HTML code makes use of hexadecimal when representing colours on the screen. For example; # FF 00 00 represents the primary colour red # 00 FF 00 represents the primary colour green # 00 00 FF represents the primary colour blue.

Combinations of the above can be used to represent other colours , for example, # FF FF 00 represents yellow (red and green). It is possible to vary the hex values to create any colour the user wants. For example : # 41 69 E1 represents royal blue # 00 7 F 00 represents lime green # CC CC CC represents light grey

.... and so on.

MAC (media access control) addresses

16 bits ;e the i sec/ .

A media access control (MAC) address is a unique number associated with network

interface cards which identify a particular machine or device. This allows all devices to uniquely identify themselves on a computer network, for example, the Internet. This address usually consists of 48 bits which are usually represented as 12 hexadecimal digits in the form:

MM - MM - MM - SS - SS - SS

MM:MM:MM:SS:SS:SS

or

.

where the first six hex digits represent the identification manufacture of the device and the second six hex drg ts rep

,

serial number of the device.

the

, ° "" ' W - A0 - C9 25 F4 3D represents a device manufactured by Intel with a - - -

F 0

Output devices Printers The most common type of printers are the dot matrix, inkjet and laser.

Dot matrix printer

J

These are old technology and are impact printers using an inked ribbon. They are still used in a number of areas because of their advantages and unique features. The following is a list of advantages and disadvantages of dot matrix printers.

34 ' aarfislii

Dot matrix printer

Advantages They work with continuous (fan folded) stationery which means they can do very large print jobs without any human interaction They work with multi-part stationery which means ‘carbon copies’ can be made immediately. Relatively inexpensive to run and maintain. Can work in damp and dirty atmospheres - an environment which would cause problems for the other two printers. Able to print raised characters, i.e. braille to allow blind or partiallysighted people to read the outputs.

.

*% %

\

\

Disadvantages They are relatively expensive to purchase in the first place. They tend to be very noisy in operation Printing is slow and usually of a very poor quality compared to laser and inkjet. Although they do work in colour (usually a 4-colour ribbon), the results are very limited

'A

V

.

.

s s

s

,rs

'

s

*

00fo

whidiaK

ystems.

inkjet printer up made of : are printe rs Inkjet

. a print head which consists of nozzles used to spray droplets

of ink . an ink cartridge which contains special ink; this can be either one cartridge containing all the ink colours including black of a number of separate cartridges for each ink colour and black - a stepper motor and belt which moves the print head assembly back and forth across the page Ch eedS !i 9 e sheeB of •

Z“

,

, "

w



.*

So what happens when the user selects OK to print ? The following flow diagram shows the stages in the printing process.

Data to be printed out is sent to the printer drivers/ ia the USB

J laser.

connection

L

The printer driver puts the data to be printed into a format which the printer

understands

i

The printer driver also checks whether or not the printer is online or available to print

I while the printing process is being carried out, the computer can get other tasks (printing is a relatively slow process)

iter

(If the printer is

L

-

idle for some time, it goes through a short print head

cleaning process)

hey

I

The paper feed is activated and a sheet of pap< fr printer body. A small sensor is used to detec paper feed; if it is out of paper (or the paper is sends a signal back to the computer and an e



'

correctly placed into the sence of paper in the orientated) the sensor ssage is generated

moves across the paper and

^

produce the full

1

*

range of colours



^

I sSjtoSow 2ePnSeStobe printed This process continues be data stored the buffer printed in

is

compute r the to signal Pr nter buffer is empty, it sends an interrupt requesi| rnore ‘ cfata to be sent. This process continues until the whole of the do has been printed

°

? " *

w

See chapter 12 to find out how these interrupts work.

*

J

Guide Revision Cambridge IGCSE Computer Science The ink droplets are

>

Thermal bubble

-

of types different two by currently produced

technoloc

create localised resistors tiny , technology with this a bubble creating . As ink the the vaporises which heat the from print ejected is hea ink , some expands bubble , collapses a bubble i vacuum the When . paper the onto print the head into read pulled is ink fresh and formed

for more printing.

Piezoelectric

the at rear located is of crystal a , technology this with crystal The receives . nozzle each for reservoir the ink . vibrate The it makes which charge a small electric vibration causes ink to be ejected onto the paper and also draws in more ink for further printing. Advantages

• •



Inkjet printers are very cheap to purchase in the first place. They produce high quality output; used to produce photographs. Relatively quiet in operation.

Disadvantages

JBV.

• Ink cartridges do not last very long - which makes the printer unsuitable for any long print runs. • Printing can ’smudge’ if touched too early or the wrong paper type is used. • Relatively expensive to run.

%

The increased cost is mainly due to ink cartridges.

Laser printers

LaserJet) printers make use of the properties of static electricity to enable printing on paper to take place. A printing drum is given a positive charge and, as the drum rotates, the printer scans a laser beam across the surface of

the drum removing the positive charge in certain places. This process allows the laser to recognise letters or images to be printed as electrostatic images.

° T wTtK ' Tn r TtiVe * ° ’ dmm

C atS

ink)

15

the H discharged). The drum given a

areas

char9e drum and sticks to the drum h s

*

*

P SitiVe|y char 9 ed toner (powdered nly StkkS t0 the natively charged

'

LTroTol aTheet

^ , papTinnead T'"’ "’ ' ne9afce

'

'



6

em

^^

, , 1 oner powderlea es he '



“ , ”

toilers. The heated roHersnteh th the paper. A discharge lamp then making I ready for the e« page

,

°

«

baskall» a

,ed

»f hea

“ ^ ^ ^

Hardware

1

N

of advantages number a and have inters

, % |

..

'Pses,i V : P

..

%

.

'epaje^- . rate. T

'9

j

-

.

phs.

disadvantages.

Advantages

. levels noise low very have They high suited to well and volume printing. output Fast Toner cartridges last a long time. extremely . good is quality Print Disadvantages Maintenance and running costs can be expensive (for example colour toner cartridges and replacement of diffuser packs are expensive). Printing ' ' if touched too early or the wrong paper type is used. smudge can They produce ozone and volatile organic matter which can be harmful to some people when the printer is used in an office environment.

3D inkjet printers ( stereolithography printers ) primarily used in CAD applications and actually produce object the and printer inkjet ied modif a uses technology 3D solid objects. The used material The . produced is object solid is built up layer by layer until the , plastics , , concrete resin , in the printer to make the thin layers can be plaster inkjet than rather printers laser metai, etc. Some new developments are using cases both in same the is printers; but the principle behind the technology facial in use for bones Researchers are using 3 D printers to produce a rtificial reconstruction surgery.

~hese printers are

is use:

:

& S3

-

D a on produced Solid bone structure research medical of part printer as

* et jet

n

a *tl 1 o scan. The computer mod thin dices;this data is # » o

0

*

d

'-trica Wens' Recessive

g 30

tnfcJe P

^ cium phosphate «« d of paPef

, the TnV- s bone strU

*Carnatic

^

\* '

^

' .-

by printing search to be

^produce

(lds up on contact. The pr« much tlU \ayers on top other; here andin other ed app icat C x \d teries, etc.), but this is a ve nterestin9 e results in the ne t cade or so. ^

£ ° .

polymer which

.

eth

%Laser printers are more cost effective when compared to inkjet printers.

%It is based on the tomography principle which involves breaking down any object into a series of

thin layers.

11

fall to , continues continued ) printers stereolithography As the cost of 3D ( metal parts for ' out cars print ' or to owners allow eventually will

research . computers for boards even printed circuit

Printer applications

1'

application any in . important very is use to printer which The choice of 3D printers 3 D printers are used in any application where a working prototype/ model needs to be made. They are being used increasingly in a number of applications where other methods are very expensive or even impossible.

Examples include:





creation of museum artefacts (i.e. copies of ancient statues, pottery, jewellery and so on which would be difficult to do by any other method); the artefact is scanned using a 3D scanner which produces a tomographic 'i image (i.e. made up of several thousand slices - see later); the images are processed by 3 D software and then sent to a 3 D printer where an 1 accurate replica in resin, powdered stone, powdered metal or plastic is 13 produced production of parts for a vintage car; since these parts are no longer available, this is often the only way to obtain parts for a reasonable price; either the original part is scanned as above or a blueprint is produced $ using CAD software; an actual working part in metal is then produced; in many cases, the customer simply sends the file to a company who operate industrial 3 D printers and the design is 'printed out ' for them.

Dot matrix printers Dot matrix printers are old technology but still have a use in the 21st century. They can operate in atmospheres which are hostile to inkjet or laser printers, for example, damp or dusty/dirty atmospheres in factories. The use of multi- part, continuous stationery is also a very useful feature for

certain applications. For example:

*

• when producing wage/salary slips, dot matrix printers are still regarded as very useful; they can print through paper which is ; 'carbonised' so that the printing is on the inside of the document and can 't be read from the outside. This works because the printer is an impact printer and doesn't need to be in actual contact with the paper to do the printing (unlike laser and inkjet).

\

! '

1

L

v

Hardware The first layer is security paper ( ho Seen can't b throu ) h 9 The second layer is carbon ftr, ^ when i receives an The third layer is the blank Paper which is printed on during the process The fourth layer is again security pane printer impacts on one of the security iayers to the printjng pap s a mlnuous » hat the wage/salary slips are a a hundreds time and then each one is to off t KOduced perforations to produce a secure wage/salary slip

,

pli

%.

I* !' ' °" “ , tyw

(

ntj

%r toposife

Way, ?r methx

Mogrerc

image ere an

)

lastice



^

'

^

, prX

,„ ' .

The image on the right shows a typical security layer on a wage/ salary slip; the dot matrix printer prints through this onto a sheet of paper inside; because of the pattern on the security sheet it is impossible to read what is printed inside . Inkjet printers Inkjet printers are generally used where one - off high quality printing needs to be done - for example, production of a document with colour images and text. They are also excellent at producing photographs because of the nature of the printing used and can therefore be used on glossy paper.

nger able

Laser printers

fuced jucec; ' 1

,

,

,

Laser printers are used where h gh speed pnnt ng

ho ding

tor )ri&

vreV

'

ded

* e

so'

\

would need frequent changing of ink cartr g hundred sheets of paper. Because of the faster at producing duplicate copies o P

are much page {or pages). atp +hey

Monitors Cathode ray tube (CRT ) monitors ese ypes of monitors are being phased out, not only due to their bulk ^ They . high very and . is consumption kUt a so because their power ^ any for also used if er as they get older giving rise to headaches |en : advantages main two f time , they do have

^

*

'

°

-



. In spite of all this

monitor TFT equivalent the e ua ty is probably still better than high the to ( due a ie rr| pens light oment, only CRTs can be used with many , so second a times 85 6 every refresh electron beam and screen des 9n offlces still use CRT monitors for this reason. *

^^ 8

^

% This difference is diminishing as the TFT technology improves.

11

Cambridge IGCSE Computer Science Revision Guide

Thin-film transistor ( TFT ) monitors

*

TFT monitor

%

Some newer versions now use 4-colour transistors with a yellow one added to further improve the colour definition.

Iff

TFT screen can now be fitted into a desktop and used in the same way you would read a book or document.

These monitors use thin-film transistor technology. The screen is made up of thousands of tiny pixels; each pixel has three transistors coloured red, green an < blue and the intensity of each determines the colour seen by the human eye . TFT monitors have a number of advantages when compared to CRT monitors.

J

Advantages

- They are very light weight. - They consume very little power and also have less screen gla re. - They increase the flexibility of the computer system. - The only problem is the viewing angle which needs

to be considered when using a TFT screen to display some information; a CRT screen may be the best option in certain applicatio ns.

Many liquid crystal display (LCD ) monitors now also incorporate light emitting diode (LED) technology. Such monitors consist of a front layer of LCD (liquid ch al diode/display) that makes up the imag e from a number of pixels

«

*

.

^

using LEDs wElicEl give it bette r brightness and rnnt t ten u advanta9es over the older CCFC ( ca th ode co ld flu ore srp uorescent lamp) technology used to back -lit LCD monitors in the past: maXimUrn brightness almos t immediately (no need to ' warm

IS 7*

upV^^

IS.

- they give a 'whiter' tin ti t sharpening th e im ag e and making it look more 'vivid'; CCFCs gave a yellowish tint - they produce a brighter light than CCFCs allowing the picture to be much brighter in appearance - the monitors are no w much thinner due to the use of LEDs - since LEDs last almost indefinitely, this technology is much more reliable and consistent since

lCD5 back-

"‘

,,

wi h his

V

Hardware

,,

development is considering organic li A LE D FutUre en ttin9 diodes org ani c materials used to create th Th e ) . (OLEDs se mi co nd uc tor s are allo win g dis pla ys which can be b very flexible mt any desired shape! Because of this aspect, OLEDs are ex f 6atUre in future * and tel ev mo isio , bile n pho ne screen monitor nCements - Th could, . , exa allo mp som w le eb od y to * fold for up S 2ed com PU ter car ry any it wh ere they want in th monitor and P cket! clearly the possible applications of such technoloov a most as limitless as the imagination.

*

^ °

^^

theiA

*° ' °

2D and 3D cutters

de up of

i green art

nan eye nontoi

A three-dimensional (3 D) laser cut is similar to a twodimensional (2D) cut except it is able to recognise the object in an x-yz direction rather than in just an x-y direction. The materials which can be cut using 3D laser cutters include glass, crystal, metals, polymers and wood. Th is enables much more complex shapes to be cut.

3D cutters can go beyond the surface of the material being shaped and actually cut at the centre of the material.

Loud speakers Essentially how sound is produced from a computer can be represented by a fairly simple diagrammatic representation. red

ien

jiittM (liquid

pixek

sand

*

IK

past-

it ®

computer

*

DAC

*

^

amplifier

loudspeaker

The computer will send out a digital signa w analogue voltage using a digital to analogue c nverter (QAC). This voltage is then amplified and voltage changes make then fed to a loud spea e a cone ins ide the loud speaker vibrate producing This includes output devices such as loud speakers or head pho

^

Light projectors

There are two common types of ght . onto a large screen or whiteboard.

'‘

' Digital light projectors (DLPs), and * Liquid crystal dis

^

used to project multimedia

mon types are:

play (LCD) projectors.

Digital light

projectors (DLPs)

Millions of tiny micro mirrors on a sen are key to

the functioning of DLP te

^y^ .

.

( gM projector (DLP )

^

11

chip DLP the in mirrors determines micro of arrangement The number and can either mirrors tilt micro These . image the resolution of the digital ( source light . i e . the ) OFF from away ) or ON ( . e . towards the light source i Each of . the surface micro projection the on pixel creating a light or dark ; second for a times example , thousand several off or on switch mirrors can , OFF it produces than a frequently more ON switches if the micro mirror pixels in 1024 produce can grey mirrors micro the light grey pixel . Typically greyscale image a chip . DLP the entering signal video the giving shades

%It is suggested that the reader finds about the older LCD projectors and compares their performance to these DLP projectors.

filter colour on its path a through passes projector A white light source in the colours primary : red, three the into split is light white This . chip the DLP to green and blue, from which a DLP projector can create well over 16 million different colours. The ON and OFF states of each of the DLP micro mirrors are then linked with the colours of the colour filter producing the coloured image. This concept is similar to black and white photography where grey scales on the photograph represent real life colours. DLP technology is effectively reversing this concept and interpreting the generated shades of grey as actual colours.

/ / & A

$

/

s 1

*

3619

LCD projectors These are an older type of projector than the DLP variety. They are based on a high intensity beam of white light passing through an LCD display. The light beam is sent to mirrors coated in a light sensitive material; when light is reflected back from the mirrors, its wavelength is changed ( corresponding to red, green and blue light). The reflected light passes through three LCD screens (the image on the LCD screens is in the form of millions of pixels representing the image as a grey scale). When each of the three coloured beams of light pass through the LCD screens, they produce the grey scale image in red, green and blue format. Combining these coloured images produces the full colour image which is then projected onto the large screen or whiteboard.

SiQO

m

S

\ V v%

\ Input devices The most common examples of input devices include: - keyboards/keypads pointing devices ( for example, mouse, touchpad, trackerball, joystick) - touch screens.

There are more specialist devices

—>

lZltslTmird:

-

covered elsewhere in this book. For example:

n SUpermarke



ad information about 5t Ck C ntro 1 —> Scanners/OCR usedto convert hard o docu ients into an electronic form; OCR software allows the scanned text to be manipulated.

23

^

'

"

° °

'

Si

SN

\ \

IIV

1

N «lt %

^

3

*9e

,

red,

ilfcn ors

'

Hardware /pen marks in a pre-dete pencil read can OMR P sition on a script; used in questionnaires, multiple Papers and s on. * Ink Character Recognition ! IS used to MICR (Magnetic read text printed * in magnetic ink. • webcams / are used cameras capture to 4 Digital 965 and d wnload them directly to the computer; digital earner memori« and can also save the images. However webcamS n0t S3 Ve the

choicermmed °

°

-

-

^°!?°

directlv

°

are transmitted tn th6 C mputer and tend to be used in online chatting or in video confer 9 Microphones are used to capture sound/vokes V ice 0vers in presentations, online chatting, allowingy disahleH D ed users to input data into a computer. images and they

"

^

'



°

ured '

rey

Touch screens

the

Touch screens are similar to normal monitors but in this case allow selections (and other features) to be made by touching the screen rather than using a pointing device, such as a mouse.

ed

When the screen is touched, sensitive layers on the screen convert the 'touch' into an electrical signal . Sensors can identify a touch has been made and a microprocessor is used to determine the position on the screen where the touch was made. They are commonly used in Information Centres.

Information centres

of the

:e

Airports, bus stations, railway stations, supermarkets and any application where information needs to be relayed to cus on a regular basis, all ^ gain benefit , desks / kiosks | nformation from having automatic (unmann . * | These allow customers to automatically o ta ormat on as and when ^ they require it without having to interface w human operators,

.^ ° ^ ^^ , j ^

Output is normally on a large screen, byt a can vary, they are usually at least one o

^

^wing:

of input

- touch screens with menu options - mouse/trackerball to select options from screen ~



.

3'

limited options keyboard/concept key

Tight pens when CRT screens are used.

^

options of number the Normal keyboards are not offered since keying customers want limited and the organisation does not . system the ’ into n other information or attempting to ‘ hack

|*

%Also see notes in chapter 2 regarding mobile phone touch screens.

11

Cambridge IGCSE Computer Science Revision Guide loc ated around an airport de sk s / kio sk s inf or m at ion Using these automatic , the following advantages ha ve wo uld su pe rm ar or ke t sta tion bus, train to the customers and the company.

Advantages

%These are a very useful option at airports, bus or railway stations where it is possible to have ‘live’ arrivals and departures boards.

The system can be linked into websites . The information is usually more up to date and accurate. There are no language problems as language options can be given on screen and the customer selects the most appropriate one; manoperated desks would have limited language capability. Customers do not have to wait in queues. Companies can advertise special offers, special services, immediate problems and so on. Lower overall costs to companies as fewer staff needed. The kiosks/ desks are open 24/ 7 since they are unmanned.

j Scanners Scanners are used to input hard copy information into an electronic format which can be understood by a computer. When the docu ment is placed on the glass plate in the scanner, a light is used to illuminate the document. A scan head then moves across the document and '

reads' the information converting it into a form understood by the computer. If the computer is equipped with optical character recognition ( OCR ) software, then text on the paper can be converted into a text file format . This can then be edited by importing the text file into software such as a word processor. Photographs and other images are often converted into a file format such as jpeg ( see later ) .

3D scanners can convert physical objects into digital 3 D data. These scanners capture the x -y - z coordin ates at several points over the object being scanned to create a digital image. The scanned data can be converted into CAD software and then ultimately used in a CAD/CAM manufacturing process.

There are presently three

scanners as shown here.

88

common laser scanning techniques used in 3 D

Hardware

s a9es tc

*

Laser trian£ulation

n Time of flight

arv

*

laser scanners

a laser beam is projected onto an object and the reflected light is captured by a sensor at a known distance from the laser light source; this reflected light gives 3 D measurements of the object.

pulses of laser light are reflected off an object; the reflected light is detected by a sensor and the time difference between the emission of the light and the detection of the reflected light allows 3D measurements to be calculated.

ate

Phase shift laser scanners

'

Ormat

ed on ent. ition

?r

ext e

or.

such

*

this technique depends on the phase shift in the laser light after it has been reflected from an object; the phase difference between emitted light and reflected light allows 3D measurements to be made.

Sometimes white light scanning is used instead of laser lights. In this case, a known pattern of white light is projected onto an object and sensors detect the reflected light allowing an image to be built up. Exa P eS , , include: photogrammetry (used to digitize large objects sue as ui and CT (computed tomography )/MRI (magnetic resonance agm9 ) break down an object into 'slices' (used in hospitals to scan human and whole body scans) so each slice can be analysed if req Use of scanners at airports Passport scanners are now used at airports to scan data from passports. It Uses Q teChn 0l scanned the of images digital 9y to Prov de high quality docum6nt n a f rrriat that can be unders ood by a computer. The data is UsuaU red ln a database which allows easy searching and manipulation

°

'

°

,

' °

ofthe

ing *

)

/

,

ata ‘

astern will automatically:

dentify a scanned document

‘ cate the required 0

text and ima9eS “ tarry out any required error detection ~ tore the of storage for (common standard text rmat f ^ c unique has character racterS f und on any computer keyboard; each ) ) . hex ( 46 bin attern, 0110 0100 : as represented for example, letter 'F' is

^_

°

^

°

barcode readers Barc des are lines ot rallel made up of a series of black ° SrV n9 anccode for the numbers x

|

thickness. Each series of lines represe

11

Guide Revision Cambridge IGCSE Computer Science these representing for codes are methods u different of number . 0 to 9 A . methods these of The following shows one

nm

number: 2

number: 5

A barcode is made up of several of these codes.

ii 11 ii m

i numbers:

7

5

o

3

The following sequence shows how a typical barcode is read: - a barcode reader shines an LED or

red laser light onto the barcode to be

scanned - the light is reflected back off the barcode; the white lines reflecting more light - the reflected light is detected by photoelectric cells (sensors) - as the light is scanned over the barcode, it generates a pattern which can be interpreted by the computer:

for example, number 5 gives us:

W B B W WW B

(W = white, B = black)

or:

0 1 1 0 0 0 1

(binary equivalent)

- these binary codes can then be used by the computer for stock

control, searching for items in stock, locating prices of items, identification of an

item and so on.

%This quantity of stock is compared to the minimum order / stock level and if it is equal to this value, or less, then an automatic re-order for new stock is generated by the computer.

Barcode technology is used in most supermarkets around the world at the checkouts where each barcode is scanned by a barcode reader/scanner . The barcode is looked up in a database (the barcode number is usually the key field for searching purposes) and once the required item is found, details such as price and description are sent back to the checkout (or point of sale (POS ) terminal ) . The item is also 'flagged' as being sold and the new quantity in stock written back to the appropriate record in the database. 3D barcodes/ QR

codes

Another type of barcode is

known as the QR (Quick Response) code. This is

made up of a matrix of black squares on a white background. The standard barcodes described above can hold up to 30 numbers; however, a QR barcode can hold over 7000 numbers which allows them t o store massive amounts of data.

With the increase in Internet- enabled mobile phones , these QR codes can be easily scanned using an application previously downloaded to the

* X

1

'

1

\\r

I

Hardware the user to a website or sirrmlv H - ays es tak this ; phone P text or contact phone. For example OR A the on information represen a 6 ( 325 ) 4 711 019 , 8 238 e cod which could it dig 6C de for a holiday , d the u nne sca r use tu e onc will be t t sen and , h llday website or offer tion crip des f brie / iw of hni the ails det ay will appear on the screen. lona contact

,

ST*" ^

^

°

s

°

*

°

Advantages There is no need to physically write down details, By simply scanning the QR code , the desired information is captured automatically by the mobile phone or other device.

QR codes can be used to store addresses and URLs that can appear in magazines, on signs, buses , business cards or just about any product that users might need information about .

3

? ad:

J

he barcode

es reflectir;

Disadvantages Users must be equipped with a camera phone and the correct reader application that can scan the image of the QR code. Currently only smartphones are technically capable of doing this.

;ors)

attemwfe:

Me, j equivM

J

tockcontfl

ficationd ridatthe

^

inner W the 1 |j 5 detei

^ safer

intWin

Microphones Microphones are used to pick up sound directly and input this data into a computer. Inside the microphone, a diaphragm vibrates according to t e nature of the sound detected (volume, pitch, frequency an so o produces an electric signal. This signal goes to a sound card which converts the sign to a digital term

,,

lad X

rs"

^

the hy ed ect det llT na

--

phone.

~”^

if r pute com with ate nic mu can be used to help people com hoards theycannot operate devices such as e software is used to understand human spo

^

"

s

rd boa key a on rds wo on a screen in much the same way as w en rds wo ken spo the f 0 rn atte Voice recognition software compares the aV^ the ing duc pro s thu ry mo and matches them to wave patterns store in m ;nrrpasjnqly sophisticated g text shown on the screen. This software is becomi or ents acc ng stro by and produces far fewer errors, such as those caused , s tern pat ve wa ' l sua mu ucl pro dialects which 'confuse' the software by

^^

Keyboard Keyboards are probably the most common other equipment such as mobile phones. T e

device connected via a USB port or by wire e

such as those used on many mobile phones. dPPears on a touch screen and the user type

the screen.

e

*&

0

I

and ers put com on d use devjce arcj can be either a physical jt can be a virtual device ^ case, a keyboard latter

^

ent|y touching the

letter on

,

%Microphones are usually either built-in or connected externally via a USB port.

11

Guide Revision Cambridge IGCSE Computer Science into an electric converted is signal keyboard the on Each character typed See earlier section on inkjet printers and also chapter 1.

. Keyboard memory in stores buffers and are interprets computer which the the speed to at compared which slow very the is entry keyboard used since

processor works.

Mouse

usually used is and with a GUI device pointing a of example an The mouse is (graphical user interface) where items are selected and one of the mouse buttons 'clicked' to indicate what action the computer needs to take next. Applications of the mouse are mentioned throughout this textbook and are similar to touch screens in the way that information is conveyed to a computer.

1

As with keyboards, the mouse can either be connected directly via the USB port or wirelessly (WiFi).

The following section considers specialist input/output devices.

Interactive whiteboards Interactive whiteboards are devices where users can actually write on the board and their text or drawings are automatically saved in an electronic form for later use. This is very useful at a meeting, for example, where a number of people may be involved in a discussion on some new product, for example. It can be used in conjunction with computer output using software such as a spreadsheet, database, CAD, computer game and so on. Imagine a graph showing company profits over a 12-month period. The graph is projected on the whiteboard and the people at the meeting can annotate the graph and their comments can then be incorporated into a final report. Or the comments can simply be loaded a few days later from the device used to save the annotations electronically.

a?

1 *

oiy

\

\ \

\ \

c

N

1

i

I

Hardware

X bZS

y : *\

[ V '

The

showing performance of a restaurant indicates graph following es a

whiteboards: )u interactive of e & » use typical ^

I 04 i

103 102 -

S ! to St%N C.

graph needs some titles and axis

101Expansion

100 - 1

*

. Contraction

all these annotations will be saved for later use so none of the information from the meeting is lost

991

981

Ni

971

vices.

red below 100 line and green would be helpful

V write ont^

an electron; j ole, where: ew product |

ware

-

1

may be useful to split this up into annual quarters to see effect above it of seasonal changes

11.4

. categories three into up Memory and storage devices can basically be split

r

jine 30 ;

projected

*

sthegm t. Or the

. used"

media and devices storage Memory,

Primary storage

ROM

RAM

Offline storage

Secondary storage

DVD

Hard diskdrive (HDD)

CD

USB flash memory

Solid state drive ( SSD )

Blu- ray disc

Removable hard drive

Primary storage Random access memory ( RAM ) nd m access memory (RAM

°

~

contents the . ( . e i eV are volatile memories ) computer rn n the power to the

on lost are memory of the

^ being currently system operating |ey* store ^ data, files, device drives and be rary function can temP contents the ; from * read and ° th^ to ese memories can be written

tp

S8

"

: characteristics following the ) has

Chan edbythe . user 9 .

11

Guide Revision Science Cambridge IGCSE Computer continually access the to needs hard processor the , up When the RAM fills this inevitably ; data slows new the with RAM in disk to overlay old data never RAM actually , runs However . computer the of down the operation operations write / read become but operating keeps just ; it out of memory

!

the reduces number RAM the of of size the Increasing slower and slower. an operation disk hard the that from data read to times the processor has . RAM from data reading than longer takes much

Task: find out how double buffering works and what are its advantages.

CD , buffers / DVD Printer read/ . chips RAM of composed usually Buffers are until temporarily the data store all buffers keyboard write buffers and device is able to process the data (also refer to section 11.3). These buffers ( operations they computer up holding devices peripheral slower stop compensate for the different operational speeds between the processor and devices such as a printer ). This allows the processor to perform other tasks whilst, for example, printing out a document. Obviously, the larger the buffer, the less often it has to be serviced by the processor speeding up operations even further. Si

Read only memory ( ROM ) Read only memory (ROM ) has the following characteristics: - they are non - volatile memories (i.e. permanent since the contents are not lost when the power is turned off to the computer)

*

- the contents can be read only; it cannot be modified - the ROM often holds the instructions for starting up the computer (for example, the BIOS - basic input/output system ) .

The access rate for ROM is less than the access rate for RAM; but RAM size is usually larger in the majority of computers. Another type of memory often described as primary memory is DVD-RAM.

< II

DVD-RAM '{ DVD - RAM uses a different following features:

format to CD and DVD systems. They have the

- they store

data in concentric tracks (see drawing on the right) unlike CDs/DVDs which have one single spiral track - the concentric track format enables data on the DVD-RAM to be written to and read from the disk at the same time - the above features make DVD-RAM ideal for DVD recorders; early MP3 players often used mini RAMs to allow read/write operations to be done many times. A user cou watch a television programme saved on the DVD-RAM at the same hme as he recorded another programme; they also allow what is known as USe W Ch allows a user pause a tv programme being transmitted anri th and then catch up later without missing any of the tv programme.

\

(,

/

Q

^

V

'

\

Hardware

V

ibJS yaily

s % :

X

DVD

til the

Secondary

storage

e driv k dis rd Ha ) (Fixed ) is the main method used to store ( HDD e driv data disk iin a computer; rd Ha g d ace bein repl dly rapi by is solid state systems. this although in ted coa a s disk netic mag hard layer. Read/write heads tain con They allow data to be written to and read from the ace surf the to disk dose are commonly used to store operating systems ems syst HDD . surface and . e war soft applications

they lessor

) ( s SSD es driv e stat id Sol

other larger ?eding up

Solid state technology is now used in many computers. Solid state drive (SSD ) units are replacing fixed hard disk drives which are one of the main reasons why laptop computers are becoming thinner and lighter.

its are

Instead of changing the magnetic properties on a magnetic surface layer, as is done on hard disk drives, solid state systems control the movement of electrons within a chip. The data is represented as 1 s and Os stored in millions of transistors within a chip. There are no moving parts and consequently SSDs are more robust and also consume much less power (which also means they run much cooler - a key feature in laptop design).

er

SSDs make use of NAND flash memories - these involve millions of transistors wired in series on a single circuit board and produce nonvolatile, rewritable memories which are very light weight.

M size B

Offline storage

y often

CD and DVD disks

*

the

in s disk y flopp and s disk These storage media are essentially different to hard ace surf disk a on data write t Tha they use the properties of light to read from/ as d use is dye (known as ic organ optical media ) . A thin layer of metal alloy or on ing draw ( see k trac The recording media . CDs and DVDs have only one spiral ves groo ( al spir pits in the right). The data is stored . e edg the to disk the of re cent the that run from n know , pits the of side r othe the s read A red laser The . read be to data the allow to , as the bumps ) R DVD and R CD . ( e i . DVD or CD letter 'R' after the n Ibee has sk d the e onc onl read » be means data tan RW DVD and RW CD e O W rs lette finalised The . disk the from read and to ten writ mean data can be

,

/

id £

*d

3

11

,

fi -ray



%The reader is invited to find out how NAND flash memories tie up with NAND gates discussed in chapter 8.

%Due to dual-layering technology, the data capacity of a DVD is much greater than

a CD.

discs

, data e wnt / d rea to lk normal light DVDs, which use a red laser h g elen wav /scs use a blue laser . This has a much shorter light (40S ller sma The ) . s etre om nan anometres) than a red laser (650

*

X "

89

Cambridge IGCSE Computer Science

Revision Guide

t,

read to it enabling data precisely recorded more focus therefore can beam P than the pits smaller on much is which in pits only 0.15 microns long, to store up to discs five ray Blu times allows technology normal DVDs. This i( more data than a DVD disk.

i

) DVD , but as a ( mm the 1.2 thickness same the about A Blu -ray disc is storage of data is very different: - in a DVD, data is

f

sandwiched between two 0.6 mm polycarbonate layers;

this can lead to birefringence ( where light is refracted into two separate n beams thus preventing the DVD from being read) $ - Blu -ray discs, however, store data on the top of a single 1.1 mm polycarbonate disk; this prevents birefringence - Blu-ray discs also come equipped with a secure encryption system - a unique identification that prevents video piracy and copyright infringement It is worth comparing the specifications of the three most common optical

$

media formats.



Optical

Laser type

Track pitch ( distance

Construction

media CD

between each track)

780 nm red laser

one 1.2 mm

1.60 pm

p

polycarbonate layer

DVD

flf

650 nm red laser

two 0.6 mm

0.74 pm

polycarbonate layers

Blu-ray

405 nm blue laser

one 1.1 mm

0.30 pm

polycarbonate layer

Memory sticks/ pen drives/ USB flash drives

Mi

h i

%

x

V:

%

Pen drive

TZZu T ” T f ,

,



Pe d ivei and U 5B fl h drives) lid » tate technology (see earlier). They usually cornea through the USB port V h ir POWer' «icks are usually small, reqUire n ddi l al since software run to > ooem most operating systems usually automatically recognise them as the E - drive,

oortaWeT,

89

”,

"°'

"

'

*

,,



“"

*

v^

1

$ \

V, V

Hardware

\

Hits -. "I tof; '

%

often used by are users They as a form of back up for . on so nd ve dr ‘ f fj|es jn case of any problems with the fixed hard drive system.

^

'

packages store security files on software memory sticks nsive pe e N V| ^C supn|y with the software. These are known as dongles and * h resent when the software is run. This prevents companies and for unauthorised use. software the using ' dualsfrom

** ' "" ^

%

disk drives hard e / Removab

-T“ ^

IT ** *°
aVe

^

saves the ^ an , example for , on fo||0ws the . mid

^

electronic keyboard instrument, the keyboar electronic Any . notes lle instruction to faithfully play back the n ^^ Mstrument can be hooked

.

to computer the up to

«

ad of using mid es is that or sounds, so their file size is much mple, using MP3 format to store one

***

^ « the same one minute of audio u 0 ^ Kbyte file size. This makes MIDI ea



"

PS (MPEG-3)

rt

nce

play ac



ctual music

««

9

"

MP3 « require aUdio of re y on format

,

^

.

mg tones for

flles/MP3 play«r* , Mf EG-3 ( to « 9 V tecWolo MP3) uses audio compress ® n

° MP3 format; normal music » e 01

about 10 whilst retaining m

s

° ^Mbyte music file is compressed

'

^^

are compr

the mus>c a64

"""“trtot ,a

^

%There are clearly

exarnple

je

11

*

Guide Revision Cambridge IGCSE Computer Science from a computer via USB downloaded usually are ip | format 3 / \ iH Music files in battery which own its allows has a player 3 MP The . port to an MP3 player headphones or connected personal through files music the to listen user to . system sound amplification to an external

, which shaping removes music perceptual of use The MP3 format makes , example if two For . sounds properly are hear cannot ear sounds the human which is sound the louder keeps only also being played, the MP3 format the softer sound is discarded.

MP 4 ( MPEG-4 ) files/ MP 4 players rather than just multimedia allows which format a ) are ( files MPEG 4 MP4 audio files (as in MP3).

, photo , video and audio store they but , 3 to MP way similar a They work in animation files. They also allow streaming of multimedia files over the Internet. They work by compressing files without affecting the quality of, for example, the video by making certain aspects of the original file redundant.

JPEG ( joint photographic experts group ) files Jpeg is an image encoding system that compresses photographs and other images. It is a lossy format and makes use of certain properties of human vision to eliminate certain unnecessary information. It is a very complex process which goes way beyond the scope of this book. Putting it in simple terms, it relies on the human eye being unable to

distinguish colours of similar brightness or similar hues. A typical RGB (red, green, blue) bit map image is converted to a YCbCr image (where Y = brightness of the pixel, Cb/Cr = chroma, which are the blue and red differences, respectively); these images are considerably smaller in size than the original.

Lossless and lossy compression File compression can be termed either lossless or lossy in nature.

Lossless Lossless file compression is based on the idea that files can be broken down into files of 'similar size' for transmissi - ion or storage, and then put back together again at the receiving end so it can be used again. Lossy

%

Refer to jpeg system described earlier, for example.

Lolsy co%?ZioTaTgodthmSs e2n«?

It becomes impossible to get

.

algorithm

hi

,

^

bac

“XnSdinnd aH klf

s^ rr 0

te

»

00

t0

o the 0

0r

'

°

SSleSS

^

COmpreSSi n '

°

.

in a file and eliminates he Ne

, ,

Hardware

11

pter cha of End question 5

,,.5.1

A company has decided to buy 50 laptop computers. (i)

What features should they look for when deciding which laptops to buy ?

(ii) Discuss the relative advantages and disadvantages of using laptop computers compared to desktop computers.

11.5.2 (a)

ttlerttl8., ft r

Name two household devices that use microprocessors.

(b) For each named above, describe what

functions the

microprocessor controls.

Photo at

Berthe Polity of, fc

eredunfe

s and other of human

11.5.3 A manufacturing company has decided to buy new input and output devices to allow it to carry out its day-to -day operations. The company manufactures parts which require welding, grinding and painting. There is also considerable office space where finance, management, research, design and customer relations/sales takes place. (a) Discuss the relative advantages and disadvantages of using dot matrix, inkjet and laser printers in the company. Part of your discussion should include where each printer type would be most suitable.

lis book.

(b) What input devices could be used in the company for :

to

(i)

Administration work

3BM

(ii)

Design and research work

t~

(iii) Video conferencing

differences original.

. nel person certain only to (iv) Security devices to allow entry (c)

en put

0P'

list specia the s Discus . The company has several disabled workers

s worker these help could input and output devices which . s system ter compu interface with the y memor s acces random 11.5.4 (a) Describe the main differences between (RAM) and read only memory (ROM). le suitab a Name . exist (b) Various external, removable memory devices e cou whic , case each in le examp device, giving a different in oice c your or reason a Give . applications used in the following each case: (i)

Storing multimedia files

(ii)

Storing music files

(iii) Storing documents

ssor proce word a in produced

ses purpo security (iv) Backing up files for security the allows that system (v) A security camera recording . time same the at ack playb staff to record and

Q

, how Approximately much . size in memory Mbytes 40 is file music ) A ( 11.5.5 a in MP stored 3 was it if format need ? file music same the would

floppy disks from as over the taken DVDs and CDs have (b) Why home on media computer ) storage memory ( secondary main systems ?

4

to decided introduce has team management station 11.5.6 A railway information kiosks to keep passengers up to date regarding train arrivals/departures and time tables. These kiosks will be unmanned and each kiosk will have six large TFT monitors. (a )

What input devices could be used at these information kiosks ?

(b) What advantages do these kiosks give customers compared to manned information desks ? (c)

What advantages does the system give to the management team?

(d)

Apart from arrivals/departures and time tables, what other information could be made available to passengers at the railway station ?

.

11.5 7 (a )

Describe how LED technology is used in LCD flat screen monitors. What are the main benefits of using LED technology in this application ?

UH

(b) (i) Name the two types of technology used to 'spray' ink onto paper using inkjet printers. (ii) Give one difference of each type of technology. (c)

(i) Explain the main differences in ink technology used by

inkjet and laserjet printers. (ii) Why are laserjet printers considered to be a potential health

hazard when used in an office environment ? (d)

Explain the role of buffers when carrying out a printing operation.

11.5.8 A CD contains 12 music files (songs). Each song requires 216 000 bytes of memory for each second of recording. (a)

( i) If each song lasts ( on average) for 5

minutes 20 seconds, how much memory does each song use on the CD ?

(ii) How much memory is used to store all 12 music files ? ( b) It is possible to download this CD

from an Internet music store. If the download speed offered by a service provider is: 56 megabytes/second, how long would it take to download all 12 music files ?

(0

2P

h\

It was decided to store the CD in MP3 format. Assuming this gives 90 per cent reduction in the file size, how much memory would the 12 files occupy in the MP3 format ?

% K \ k

\

\

9 mit

\Z\

NS%

tffOi

\ % r%

’0

%

er5 co %s %|

3na9ftne

Hardware are scanners How ) used at ( a airports to read passp 9 5 H (b) (0 How are barcodes used at the

(b) Describe how jpeg file technology is used to store photos in a

format that generally retains the quality of the original photo but uses up less memory when the file s are stored. (c) Apart from memory requirements, give another advantage in storing files in the jpeg format. (d) By using

arrows, connect the memory/storage devices on the left to their correct descriptions shown on the right. Each description can be used only once.

ersatz

RAM

optical disk system that uses blue laser technology to read and write data

ROM

primary memory which holds data currently in use; data is lost when power to the computer is turned off

Blu-ray

makes use of NAND flash memories which involve millions of transistors wired in series on a single circuit board

® inko /

d

5edty

Itis

,pe^

' pixed hard

disk

WD -RAM

primary memory used to hold the BIOS; a permanent memory which retains its contents even when the power is turned off to the computer

magnetic media used as the main secondary storage device in a computer

oP

ry

checkout of a supermarket ?

(ii) Which other hardware devi vices are used at the rsupermarket checkout ? Describe the use of each named device. 115.10 (a) What is the difference between lossy and lossless data compression?

whatofe

creen ) technck

orts ?

Sol d State

'Drive

optical disk system that allows simultaneous read / \Nrite operations to take place

11

•'

Chapter

i

Operating systems

t mm

Learning Summary

’/

w

In this chapter you will learn about:

• Operating systems

• Interrupts 0

Batch processing

0

Real time processing Computer architecture Fetch-Execute cycle

0 0

i

&

'r

Data transmission Many of the tasks carried out by computers are taken for granted. This is often down to a good operating system which automatically carries out many of the mundane tasks such as interrupt handling, user interface and so on. There are also specialist areas such as batch processing, real time processing and network systems. Computer architecture is an important part in the understanding of how computers

0

work, together with the knowledge of how data is transmitted to and from a computer.

12.1 Operating systems

Mo

ESBt

Iv

The operating system (OS ) manages the basic tasks carried out by a computer, such as input from a keyboard, output to a printer, file management, security and device drivers. It provides a software platform which enables applications programs to run. On many computers, when it is powered up, the first program that runs is stored on a ROM chip. This program checks system hardware to make sure everything functions normally. The next thing to check is the CPU, the internal memory and basic input -output system (bios) for errors. If all proves to be acceptable, the bios activates the memory drives. When the hard drive is activated, the operating system is found and is loaded.

:

JMOT \ trol

bus

) ns io ct re di th (can carry signals in bo d an l ro nt co e th to - this carries signals relating ( r fo r te pu m co e th in th wi es iti tiv ac of n tio na coordi

) . ns tio nc fu ite example: the read and wr

However the figure the actual'

banner.

1device

t ou ab n io at rm fo in can be re-written to show more

ing low fol e th in main components in a typical computer system

I

12

Cambridge IGCSE Computer Science Revision Guide

UUII

// /Jr

Memory

*

MDR

MAR

Output

Input

device

device Processing unit

A

%It is left as an exercise to the reader to link the two figures - to confirm that they both show the same links

data

A

TEMP

ALU

Key

;t {

I l

control

Control unit

between computer components.

n

CIR

PC

Main components in a computer system We will now consider the five main components shown in the figure.

vfatmtu

Memory The computer memory is made up of partitions (much like a set of drawers). Each 'drawer ' consists of an address and its contents . The example on the right uses 4 bits for each address and the contents are made up of 1 byte (8 bits). In reality, the address and its contents are usually much larger than this !! The address will uniquely identify every location in the memory (much like the address used to uniquely identify the location of a house in a particular city) and the contents will be the binary value stored in each location. The figure on page 159 also shows that the memory is made up of items known as the MAR (memory address register ) and the MDR (memory data register ). These work as follows:

• address

contents

0000

00110000

0001

01011001

0010

11001100

0011

00011000

1100

10001000

1101

11110001

1110

11000000

1111

00010001

%

ill

JHI

"

M

to READ / LOAD data from a

memory location called L: - the address of location L to be read from is written into MAR — a read signal is then sent to the computer memory and the data is read from memory location L into MDR .

Thus, if data in memory location 0010 is to be read, 0010 is written into MAR and the data value at that location, 11001100, is read into MDR.



iflM’

to WRITE /STORE

data into a location L: - the data to be stored is written into the MDR the address of location L is written into MAR - a ' write' signal iis sent to the computer memory. Thus, if data 11110001 iis to be written into the memory location with address 1101, be Wri te Snd MDR then the eddr mi written into MAR.

! '

«T

^

X

V

V.

1

Vv

N •\

% v

,"

\

un

“ epassing

of up the made is etic arithm and logic unit (ALU ) and unit . ( etic for arithm allows example, add, and subtract) and ALU The Misters, OR, NOT ) operations to be carried out. Registers AND , le examp ( for are ic I also anc contam the results from the ALU. areas rage rarysto temp

Si

^

°

%

es devic t Outpu input/

% Also refer to chapter 10 ( binary systems) for more information about registers.

depth in chapter 11 and are the primary way of great in ed cover are These entering data into and getting information from computer systems. Input data into a form al extern the computer can understand rt conve devices ( le examp , for rds keyboa s proces and microphones). Output then can and of results computer processing in a human readable form the show devices (forexample, printers and monitors).

Control unit The control unit controls the operation of the memory, processor and input/ output devices. It contains the current instruction register (CIR ) and the program counter ( PC) . The CIR will contain the current instruction during processing. The PC contains the address of the next instruction to be executed.

/ers).

le right

its). :his !! ike the city)

-

I

I

Basically, the control unit reads an instruction from memory (the address of where the instruction is found is stored in the PC) and then interprets this instruction, generating signals to tell the other components in the computer what to do. j

12.7 Fetch-execute cycle fetch memory the from the fetch-execute cycle the next instruction is fetched ddr«s currently stored in the program counter (PC) and is then stored m the that so ed ment incre then is PC instruction register (CIR) . The

';"

thecurrent t * instruction can be acted upon.

^

o

cy the of part decoder then interprets this instruction in the next

Execute The r

'^e

$

,

as a set of

control

un t (CU) passes the decoded information all allows This . ter compu 0 the aPProPr a te components within ry actions to be carried out.

st

'

'

d

SB

*

Cambridge IGCSE Computer Science Revision Guide

at

W/

cycle and the fetch last the are tw boxes < five ( first the process buses in the boxes are the execute cycle). be to instruction next the of address the the PC contains

fetched

via MAR to copied is PC the in contained address the address bus

ei

the instruction is then copied from the memory location contained in MAR and is placed in MDR

the entire instruction is then copied from MDR and placed in CIR

the value in the PC is then incremented so that it points to the next instruction to be fetched

the address part of the instruction is placed in the MAR

n

the instruction is finally decoded and then executed

12.8

Data transmission

oow

When data is transmitted between two machines, it can occur in a number of different ways. The transmission is characterised by:

-

the direction of the data transmission (one way or two way transmission) - the method of transmission (number of bits sent simultaneously) - the method of synchronisation between sender and receiver.

Simplex, half-duplex and full-duplex connections Simplex Simplex data transmission allows data to flow in one direction only , i.e. from sender to receiver only. An example of this is when sending data from a computer to a printer.

Half-duplex Half - duplex data transmission allows data to flow in both directions but not at the same time, data can be sent from sender to receiver and from

V.

»

ft "

*

%

Operating systems

\ I r s c^

I

one way at a time. An example of only but sender to this would be

only where one person speaks at a time. conversation

duplex Full

transmission allows data to flow in both directions data duplex fullsimultaneously. An example could be when using a broadband connection . line phone ona

Serial and Parallel data transmission Parallel P3 ralleldata transmission refers to the transmission of several bits of data (often 1 byte at a time) simultaneously along a number of wires or

channels.

sender.

0

urnbtf )

nssion '

receiver

8 bits sent down 8

channels

This method works well over short distances and is a much faster method f data transmission than serial. However, since the conductive wires are dose to each other in the ribbon cables used for parallel transmi '/ ion, interference can occur and degrade the signal quality. An example of use of a from data sending is parallel data transmission c mputerto a printer.

°

°

Serial

*

Q\1

fro



1

Jrialdata

b > \ at a one transmission refers to data being transmitted Ver a single wire/channel.

1 bit sent down 1

sender

receiver

channel

12

f Cambridge IGCSE Computer Science Revision Guide

This method works well over long distances but has a slower transmission rate than parallel. However, cabling tends to be cheaper since fewer channels are required. Since a single wire is used, problems exist in how to synchronise the sender and receiver (i.e. the receiver cannot necessarily distinguish characters being sent because the bits are sent one after the

»

other). An example of serial data transmission is sending data from a computer t a modem for onward transmission over the telephone network.

Asynchronous and synchronous data transmission

4 •

Asynchronous

A&

*

With asynchronous transmission, signals are sent in a previously agreed pattern of bits. The bits being sent are grouped together and consist of actual data and control bits . In other words, a start bit is sent at the beginning of the group of data and a stop bit is sent at the end of the group of data. This therefore informs the receiver where the transmitted group of bits starts and where it ends. Otherwise it would be impossible tc distinguish when each group of bits is being received. • sr seals It is an inexpensive and effective form of serial trans mission and is best suited to low speed connections such as keyboards

and mouse.

Synchronous

:fH6

Synchronous transmission is a data transfer met hod where a continuous stream of data is also accompanied by timing sig nals (generated by the internal electronic clock ) to ensure sender and rece iver are in step (i.e. synchronised with each other ) . With this method, the receiver counts the bits sent and then reassembles the bytes. It is essential that timing is maintained as there are no start and stop bits and no gaps (as in asynchronous transmission) . Accuracy is depend ent on the receiver keeping % an accurate count of the bits as they come in.

%

It is faster than asynchronous transmission since

fewer bits are sent and is therefore the choice for network co mmunications links.

Universal serial bus (USB) The universal serial bus (USB ) is an asynchrono us serial connection that has become the standard on computer systems and associated hardware. It consists of a four -wired shielded ca ble with two wires for power and earth and two wires for data transmiss ion. When a device is plugged into a computer using one of the USB ports, the computer automatically detects

c

s v %

%

0

x

Operating systems

vo lta in ch ge an ge le ve l on a th e data signal wires. The to du e ce the devi is us th en ua lly dr iv er loaded up so that all the device de vi ce ate it also allows communication between an d ut ili se d be can device

er

appropn

features C PU and of nu be m ne be fit s and drawbacks in using the USB a r ar e th er e , However standard. Benefits

Drawbacks

au to m at ica lly ar e de vi ce s Hardware co nf igu red when be ca n an d detected

Cable length is limited to 5 metres

first attached (loads up device driver)

USB connectors are shaped so that it is not possible to install devices

reec

Transmission speed is limited to 480 megabits/ second ( Mbps)

incorrectly

st

The USB standard is an ‘ open standard’ and has considerable industry support

the the

nitted

USB support may not be available for very long when using older devices or earlier operating systems

USB connectivity supports many different data transmission speeds and data transfer types

sibleto

cst

The latest USB 2.0 standard is

backward compatible with the older USB 1.1 standard

J 0li5

Error checking following data transmission

:he

e.

The methods used to determine if a V transmission of data are covere in

9

r

of this book, , tr an sm is si on use of serial data -n t e r or to some external

As mentioned

earlier, USB c o n n e d0n S They are often used to transfer data ra9e



Parallel data transmission is used„ .n the internal drcuW

nd 's

m ny other

el ec tro ni . c de vic es * of integrated

|

> r*

i

th du e rin g ed oc have curr

d

'

devices are parts are 1»

^ , where a

^ ny

^ ^^

of

buses (see

circuits (ICs) 00 ear »er), the tr an sm it e (-S parallel method of data transm ch an ne l th e channels are usually 8-bit, 16-bit, Qf 64-bit the the in si de hen the faster the data transmission rate. An interna . se qu en ce device ensures that al in ar riv e l of the transm

'

'



-

^

12

Cambridge IGCSE Computer Science Revision Guide

12.9 End of chapter questions 12.9.1 (a) Name five functions of a typical operating system.

il

(b) Explain why many microprocessor -controlled household devices do not have an operating system as part of their software

.

^ '

12.9.2 Explain the difference between real time transaction processing and real time process control .

12.9.3 (a) Name the three types of buses used to connect up computer components according to the Von Neumann model. (b) Name the four main components of a typical computer system according to the Von Neumann model.

address

100000 100001 100010 100011

111000 111001 111010 111011

contents

0111 1110 0110 1111 1001 1000 11110000

12.9.4 (a) What is meant by the two computer terms: MAR and MDR1 (b) Using the diagram on the right . (i)

if the MAR contained 100010 what would be contained in the MDR following a read signal sent to the memory ?

(ii)

if the MDR contained the value 1011 1010 and the MAR contained 111001, show the change produced in the diagram on the right following a write signal being sent to memory.

(c) Name and describe two other registers.

12.9.5 Put the following stages in a typical fetch-execute cycle into their correct order. The first one has been done for you. Order of carrying out

Description of stage

each stage

Address contained in PC is copied to MAR via address bus Address part of instruction is placed in MAR

Entire instruction is then copied from MBR and placed in CIR Instruction is finally decoded and then executed

Instruction is then copied from memory location contained in MAR and is placed in MBR PC contains the address of the next

instruction to be fetched

Value in the PC is then incremented so that it points to the next instruction to be fetched

1

dri

Operating systems

12.9 .6

12

being data parallel by sent using simplex meant is data What ) (a

transmission ? being by serial data sent using half -duplex data meant is What ) (b

transmission ? 12.9.7

(a)

Describe the main differences between asynchronous and synchronous data transmission .

(b) (i) Give two benefits of using a USB to connect a device to a computer.

?r

em

'

(ii) Give two drawbacks of using a USB to connect a device to a computer.

in

to

M

Chapter

papers Practice

t V /

13.1 Practice paper 1

$

1 Five applications are shown on the left and five methods of automatic data capture on the right. Match each application to the correct method of data capture by drawing connecting arrows.

Bank system reading and processing cheques

Data logger

Reading pencil marks on a questionnaire

MICR



ft

*



Automatic recording of data monitoring conditions in a river

-.

SH

Controlling an operation using human speech

Biometrics

Use of fingerprinting in a security system

Microphone

\ S

[5] 2 A large tank has its acidity monitored and controlled by sensors and a

microprocessor.

t\

Practice papers , ling trol ry con by ssa ce wai ne as , a d de ad lve Va 9 d an by be switching jadcM

lla

stirrer.

the ng ori nit mo (c n the above example, what is the difference between ? ns itio nd co ank k tan the

'*

conditions and controlling

... [ 2 ]

3

0

ats thre y urit sec five how to guard against each of the following t lnt ernet users:

Scribe °

Phishing;

'

*••••••»

13

Guide Revision Cambridge IGCSE Computer Science hacking:

viruses: .•••• •

wardriving (tapping into WiFi):

i j



fraud (reading credit card numbers):

[ 5]

4 Give a suitable application, with reasons for your choice, for each of the following types of printer. A different application should be given in each case:

! 3 '“

cl

laserjet printer

application:

311

....

Ht

,

S

reason for choice:

dot matrix printer

*\

application:

m

reason for choice:

3D inkjet printer

v

application:

4|

\

reason for choice:

[ 6]

runn A

%

Practice papers

13

Ss

v

terms are described on the left below and five computer computer Five 5 right below the . on named 1s are

tern

description to the correct term by drawing correct the arrows on Connect : below diagram the the output where processing of Type input the influence can

Field

Space allocated to an item of

information; data items that make up a record

Interrupt

Signal sent from a device, for example, printer, which temporarily halts

Real time control

execution of a program

R

each of f be giver

Program/ code which self-replicates

with the intention of doing some harm

Verification

to a computer system

Check on input data ( often by typing in

same data twice) to see if it has been entered correctly

[ 5] 6 A burglar system alarms (i.e. A

Input

W

D

Binary values

Conditions by window

sensor

1

intruder detected

0

sensor window by no intruder detected

1 0

F

. inputs three of status the to = 1) according

1 0

by detected doorjsensor intruder sensor door by intruder detected

no

identified identified condition fault no fault condition

_

ea rm, A, returns a value of 1 if.

^

eit er:

^

" «

,i

*

intruder detected by window

sens door by or sensor

f 0ult condition identified



no intrud detected by window fault condition is identified

and no

a , and sensor doo by and sensor i

-

o

Cambridge IGCSE Computer Science

Revision Guide

all showing your , system working : above the for circuit logic ) the (a Draw working:

[2 ]

logic circuit:

[5] (b) Complete the truth table for the above system: i

W

D

F

0

0

0

0

0

1

0

1

0

0

1

1

1

0

0

1

0

1

1

1

0

1

1

1

A

l

[41 7 A computer system is being used to display on a control panel the speed (in km/h) of a high speed train.

Each digit is represented by a 4- bit binary code. For example :

5 1M digit

2 nd digit

is represented by:

3 rd digit

o

0

0

0

1st digit

0

1

0

1

2 nd digit

0

1

1

0

3 rd digit

8

4

2

1

\

\

Practice papers be in must the 4 bit values registers t represe What ) (a t the followiing speed shown on the speedometer ?

°

"

1st digit

21 1 digit st

2 nd digit

2 digit

3 rd digit

3 rd digit

nd

[3 ] (b) What is shown on the

digital speedometer if the 4-bit registers contain the following values: 0

0

0

1

1st digit

0

1

0

0

2nd digit

1

0

0

1

3rd digit

> 2nd digit

3rd digit

[3 ]

(c) What is the theoretical maximum speed which can be displayed ? [1] (d) Give one advantage of showing speed in digital form rather than in

analogue form.

I

[ 1] 8 (a)

Convert the denary (base 10) number 202 into binary, and hex notation:

binary

if

*

1

40 {0

,

hex

[ 2]

b) 0) Perform : below B and A values two the the AND logical function on A B

1

1

0

1

0

1

1

0

0

1

1

1

1

1 1 [2]

AAA/D B

•'

( ) What

? result above the of is the hexadecimal value

13

Cambridge IGCSE Computer Science Revision Guide

f

9 (a) What is meant by even parity !

f

[ 1] (b) The following seven bytes are transmitted together with a parity byte (even parity is being used). One of the bytes has been incorrectly

1

transmitted since one of the bits is incorrect. column 5

column 6

column 7

column 8

1

1

1

0

1

1

1

0

0

0

1

0

0

1

1

1

1

0

1

0

0

0

1

0

1

1

0

0

0

1

1

0

0

0

parity bit

column 2

column 3

byte 1

1

1

0

byte 2

0

1

byte 3

1

byte 4 byte 5

column 4

byte 6

1

1

1

1

1

1

0

0

byte 7

1

1

0

0

0

1

1

0

»

£

llll •

8

.- 1

& parity

1

0

0

1

1

0

0

1

byte

(i) Identify the column and row of the bit

which has been

incorrectly transmitted: column: row:

[ 21 (ii) Explain how you arrived at your answer to (i).

,\ t

\ \ \ •••• \

[ 3]

SB

Practice papers

N

Mi|

arty

•CorrectK

°re attemptingSectionAofthiS PaPer-

^ issk

and times names the in s minute for store 20 and s student input 1-

c%, 8 1

a program tested and to e these three tasks complet written have uld

n school maratho race the . Anyone run taking have who is fied disquali minutes . You must store the 300 than more ional array dimens and the one a times for each student in names All . the times must be validated on entry array ional dimens one in and any invalid times rejected. You may assume that the students' names are unique.

1

Task 2. Find the fastest and slowest times; calculate the average time for the whole class. Output the fastest, slowest and average times.

1

Task 3. Select the students with the three fastest times and output their name and times.

0

0

0

Your program must include appropriate prompts for the entry of data. Error messages and other output need to be clearly set out and

understandable. All variables, constants and other identifiers should have meaningful names. Each task must be a separate part of the program and be fully tested.

1

Section A 1 (a)

Declare the arrays to store the students names an

in minutes.

[2]

[2]

Sln 9 pseudocode

or a flowcha t 0 c mplete Tasks 1 and 2.

°

* * * •••••••

.

•••

[3 ]

algorithm your of design rt, show the

13

Cambridge IGCSE Computer Science

Revision Guide /

MM

/ / /

/

/

[7] (c) Show two different sets of student data that you could use to check the validation used in Task 1. Explain why you chose each data set

i

Set 1

n

Reason for choice

Si a i

n Set 2



J

Reason for choice

[4] ( d ) (i) Explain how you select the students with the three fastest ( Task 3), you may include pseudocode

illustrate your explanation.

times or program code to help

Practice papers •M,

••••

[6 ] (jj) How does your program work when there is more than one student

with the same time?

[ 1]

Section B

DOBJ

tc set

V#

IP

2 A company offer back issues of football team annuals. The following data has to be typed into a computer screen page t or

• 16-digit credit card number • name of the person • today's date in the form: dd/mm/yyyy • price of the annual (in $) • year of annual • name of the football team.

°

data the of some on used ame c validation check which could be . ms - Give a different validation check in each case .

1*1

na >e of person.

"

today's date:

Pfice of annual: •••

ye r

° of annual:

. 14]

13

I

: : *

Cambridge IGCSE Computer Science Revision Guide

li

(b)

of method validation . a as used are digits check Describe how J

[ 3 Study the following flowchart very carefully:

( START )

±

D 17) and ( age < 101)) or (count = ac count := 0;

repeat

begin write ( ' Enter your gender '); readln (gender);

«,

*S

\

V

Answers to questions

(c) • nt cm/ =

(d)

1 + count

female)

= gender ( end ) or male = ); 3 gender = ( ! or (count L«ti

.7

UHWjttPrtrp f1..7] of real; nr 69 • ’; Sunday neiji] -’; Monday • eek\2):= *; Tuesday • *we ® := *; Wednesday ' ] : = neetf

wa > S

Field: i ref no

'Saturday'; *

tor

Table: HOTELS

to 7 do

begin

of hours ( ' Enter write

); ] day [ forweek

sunshine

) ; dayl [ ( sunshine readln

]n».

[rdeni

< - 25

Friday*;

c

> 0.24

5.6.10 (a) 9 (b) ref no (c) 2, 4, 5, 9 (d)

Thursday’;

]:

FREEZER FEATURES

or:

; integer )i :

)

Table. FREEZER FEATURES

FREEZER FEATURES

Criteria:

ainfall, totalsunshine

[

capacity (m3)

Show:

rainfall ; vrinay real of ] [1.7 arraysunshine : real;

** ' ; 5 = •«Wkf* 6 ' •mwkf7 = bar-

Field: freezer id

lowest temp (C)

Sort:

, string ) of

V

C, E, F, G, H

km to airport

no of

weekend tariff (S)

rooms

HOTELS

HOTELS

HOTELS

Sort:

Show: 0

Criteria:

; sunshineldayl + totalsunshine : totalsunshine = ); dayl ( week for \ rainfall of cms write ('Enter ); ] day [ ( rainfall readln ] rainfalltday + totalrainfall : = totalrainfall

or: (e)

_ refno : [ Field

end ); totalsunshine is \ week for wntein (Total sunshine ); * totalrainfall , is week for rainfall ( wrneln Total ter day := 1 to 7 do begin if rainfall[day] = 0 then ]) day [ week writeln (*no rainfall on \

.

HOTELS

Table

)

weekend tariffJS HOTELS

Sort:

Show:

Criteria or :

end,

Finance ) 0 9 ( a 11 . 5.6 E R M A N Y G P F M D (b) M A J I ; errors typing Fewer (c) ; data the in type to Faster . data store to memory data the less update Uses change/ to necessary be (d) It would

• «noplayers

rdocounfl , discount2, cost : real; , nohours : integer;

in (noplayers, nohours);

^ tor.

noplayers * nohours * 5; if noplayers > 3 then discount1 = cos * 0.25; = Inohours > 3 then discount2 = cost * 0.1«

*



^

every year.

It

; 2 discount cost ! discount *

.

"

tteln (cost)

** tension hint:

members,

*****

that a file contains all gornhm will need player to input na d it's on the file. Also input the W ate digits and check each dig n *' Hu match, the formula in the thi TK yers • nohours * 4

•‘

*

^

en

^f ur^ t

0

^ |f the name

" ‘ ^ changesto

^

U) 0) 8 (»i) to) freezer id

the

6

to use better would be

the joined date person

be to company. teed be guaran can fields the of (e) none member each unique. \ characters 6 alphanumeric , Id identification . unique Staff ) (f a given be of staff could code.

Cambridge IGCSE Computer Science Revision Guide 6.5.3

Chapter 6 6.5.1

c

)

START

total highest

( START )

0 0

I 1

count INPUT H, M INPUT country

INPUT Yes

is country = Singapore?

no vehicles

H+6 M

H M

total + no _ vehicles

total

No

is country = West Canada ?

Yes

H M

H M

- 10

is no vehicles > highest ?

_

No

is country India ?

Yes

M

_

highest

no vehicles



•v

No

H+ 3 M + 30

H

Yes

count + 1

count

No

OUTPUT “error”

INPUT H, M OUTPUT country

/

Yes

END

total/365

average

135 lyS

suml

X'INPUT code ^X

suml + 1

is code > . 399? ^

No

Yes

/

/

OUTPUT "error ”

/

/

No

is year = 7?

No count

Yes

is heightyYes v< 175 ?

sum 2 sum 2 +1

is code 299?

.

No

>

.

Yes

drinks

drinks + 1

books

books + 1

No

is code > . 199?

count

.

-

+1

Yes

No

V

Yes

is count

99 ?

No sweets

/ OUTPUT

count

suml, sum2

V Yes

stat

stat + 1

No sweets + 1 count + 1

i

( END )

Yes

is count \650?

per _drink

per _book per stat per_sweet

_

/ OUTPUT

drinks / 6.5 books/ 6.5

/ per _ drink,

stat/6.5 sweets/ 6.5

per stat, per sweets

_

per book,

_

Answers to questions 6.5.7 "

( START )

( START

INPUT no _players, no hours

1

resort

totall 0: total2

0

I

charge

f

INPUT rain, sun

i

_

no hours

/

is no players

is sun > high_sun?

——» high_sun Yes

sun

_ .

low _sun

sun

_ _

charge - discountl discount2

charge

No avge rain avge sun

^

totall/ 365 tota 12/365

'OUTPUT _

avge rain , avge_sun /

OUTPUT

resort + 1

resort

charge

is resort = 10?

c total

START

/

OUTPUT

No

. ^

high_sun,

low rain

/

{

END

(

)

number

count

temp

52

0

52

1

42

2

32

3

22

4

12

NPUTtime ,

speed

5

2

2, 52

-20

0

-20

error

3

0

3

1

-7

0

1

1



/

30/time

I

^

X OUTPUT speed is speed > ^

)

.

)

0: highest

END

6.5 8

*

count

Yes

/

OUTPUT “ max speed

7

100? No

is speed > highest?

total + 1

speed

highest

No

sunny

wet

foggy

0

0

0 sunny

2

sunny

count + 1

wet

1

.,

is count = 3?

No

7s

Yes

_

totall + rain total2 + rain

totall total2

_

5 * no pl ayers *

1

days

^

10000 I

0: low.rain

sun

foggy sunny

last

OUTPUT

Cambridge IGC5 E Computer Science Revision Guide

.

7.3.2 line 3

6.5 10

totall total2 X Y count temp avgel avge 2 OUTPUT 0

0

0 0

1

24

1

2

24

3

16

4

31

5

20

16

1

55 36

2

2 83

3

6

28

104

4

7

21

54

3

8

18

70

4

9

16

129

5

10

25

154

6

11

25

17.5

25.7

17.5, 25.7

6.5.11 C

No_ ppl > 4 is incorrect (question referred to 3 or more)

-

The statement should change to: if no _ ppl >= 3 line 3 - The discount is incorrect, i.e. cost start or vice versa

• Calculate fare between start end finish • Calculate cost of tickets • Calculate discount if > 3 passengers • Loop to control input of money • Calculate money added to machine • Loop to print out required number of tickets • Output tickets Sample program: total £ 0: reduction £ 0 input passengers input start, finish if finish > start then fare £ finish - start else if start > finish then fare £ start - finish

fare * 20 * passengers if passengers > 3 then cost £ cost

• Calculate average height

• Output OUTSIDE the loop • Input INSIDE the loop

repeat

input money total £ total + money until total = cost for x £ 1 to passengers print ticket next x

V

%

% x

cost £

• Loop

• Total height calculation • Count number of floors > 50 • Find highest

FORWARD 20/REPEAT

LEFT 90/REPEAT FORWARD 20/ LEFT 90 LEFT 90/FORWARD 20 FORWARD 20/ENDREPEAT

3

4

FORWARD 20/RIGHT 90

FORWARD 20 PENDOWN FORWARD 40/REPEAT RIGHT 90/FORWARD 40 FORWARD 40/RIGHT 90 RIGHT 90/ ENDREPEAT

* 0.9

*

$

N

\

%

VARDjfl 'IGHT 9o

BEAT

PEAT SD 20 FT 90



EAT

'EAT

RD 20 HT 90

EAT

nm ADC, 11-14

'

Fields, 56

Algorithms, 21, 39-40, 42, 60, 64, 68-73, 87-89 150, 205 Assembly code, 45, 48

Flowchart symbols, 67

Barcode readers, 138, 141-143 Batch processing, 156

Hacking, 33, 56-57 Hard Disk (drive), 26, 127, 146, 147, 149 Hexadecimal system, 118-121 High level languages, 45-46, 48 Household devices, 128 HTML, 19-21, 121 http, 19, 20-21

Binary systems, 115-118 Biometrics, 40 BIOS, 146, 154 Bit/data streaming, 26 Blogs, 24 Blu-ray disks, 147-149 Broadband, 22-23 Buffers, 3, 146

Call centres, 44, 188 Chat rooms, 3, 31 Checkdigits, 111-112, 198 Chip and PIN cards, 42-43 Command line interface (CLI), 5 Compilers, 46 Components of a computer system, 2-4 Computer Aided Design (CAD), 130, 133, 134, 140 Computer interfaces, 5-6 Computer languages, 45-48 Computers and society, 105 Control of a process, 11-15 Cookies, 36

DAC, 11, 13-14, 16, 137 Data capture, automatic, 108-110 Data capture, manual, 108 Data logging, 109 Data Protection Act (DPA), 44 Databases, 55-56 Design, 20, 64-65, 103 Digital media sharing websites, 25 Dot matrix printer, 130, 134-135 Drop down menus, 66-67 Dry running flowcharts, 73-78

Electronic funds transfer (EFT), 42 Electronic mail (email), 7-8

Graphical User Interface (GUI), 5-6

Information centres, 139 Inkjet printer, 131-132, 135 Instant messaging, 27 Interactive maps, 27 Internet, 19-21 Internet Service Provider (ISP), 22, 25 Interpreters, 46-48 Interrupts, 3-4 Intranet, 29-30

Keyboard, 2-3, 41, 108, 138-139, 143-144 Laptop computer, 147 Laser printer, 132-133, 135 Library of routines, 53, 65 Logic gates, 93-96 Logic networks/circuits, 96-100 Loss or corruption of data, 35 Low level languages, 45-47

Machine code, 45-48 Memory sticks/pens, 148-149 Menus, 65-66 Microprocessors, 6, 128, 154, 158 MIL logic symbols, 93-94 Mobile phones, 9 Monitoring of a process, 11-15 Monitors, CRT, 135-137 Monitors, TFT, 135-137 Mouse, 144 MP3 files/players, 149-150 MP4 files/players, 150

Cambridge IGCSE Computer Science Revision Guide

Netbook computers, 128 Operating systems, 154-167 Optical character recognition (OCR), 109, 140 Optical mark recognition (OMR), 110, 139 Optical storage media, 147

Parallelism, 163 Personal data, 33, 36, 110 Pharming, 34 Phishing, 34 Podcasts, 25 Pop ups/pop unders, 36 Pseudocode, 85-92 Queries, 56-58 Radio frequency identification (rfid), 109 Random access memory (RAM), 3, 145-146 Read only memory (ROM), 146 Real time process control, 158 Real time transaction processing, 158 Records, 56, 122 Robotics, 16-17 Search engines, 21 Sensors, 11-18, 109, 123, 130, 131, 139, 142, 158, 183 Shoulder surfing, 35 Smart cards, 110, 198 Social networking sites, 23 Solid state memories, 128, 147, 153 Spam, 36 Specialist input/output devices, 144

Spreadsheets, 3, 14, 107, 144 Spyware, 33, 35, 44, 187 Structure diagrams, 64-67 System flowcharts, 64-84 Tables, 56 Tagging, 26 Test data, 73 Test strategies, 73 Three dimensional (3D) printers, 134 Top down design, 64-65 Touch screens, 9-10, 65, 139 Trace tables, 73-78 Trackerball, 138, 139, 200 Truth tables, 94-96 Turtle graphics, 48-50 Using flowcharts to solve problems, 68-72 Using pseudocode to solve problems, 87-89

Validation, 110-113 Verification, 113-115 Video conferencing, 7, 139, 151 Virtual reality, 12, 130 Viruses, 7, 30, 33-34 Voice over Internet Protocol ( VoIP), 8-9 Voice recognition, 143, 198 Wardriving, 64 Web browsers, 35-36, 21, 24-25, 38-39 Wikis, 23 WIMP, 6 Word processors, 140

K

Acknowledgements Thanks to the following sources for permission to reproduce photographs:

.

p. 2 f Denis Rozhnovsky/Shutterstock; p. 2b Maksym Bondarchuk/Shutterstock p 3 / hadescom/ shutterstock . p. 3rS1001/5hutterstodc; p. 13 Federico Rostagno/Shutterstock. p 22/ Alexey D Vedernikov/ Shutterstock . p. 22r tuanyidc/Shutterstock; p. 24/ Palto/Shutterstock. p 24r Grawi/5hutterstock p 28 Imagery 02015 Infoterra Ltd & Bluesky. Landsat map data 02015 Google, p. 127 Valeri Potapova/ Shutterstock ; p. 129 Bayanova Svetlana/Shutterstock. p . 130 Grandpa/Shutterstock. p 133 Piero Cruc atti/ Alamy; p . 135 nerijus jurevicius/Thinkstock, p . 142 - 143 Vendor /Shutterstock

.

page position t

I

r

m

top, b = bottom, / * left r m right

Cambridge IGCSE® Computer Science Revision Guide David Watson and Helen Williams

Cambridge IGCSE Computer Science Revision Guide has been thoroughly updated to help students prepare for examination. The book instils confidence and thorough understanding of the topics learned by students as they revise. Key Features • Clear and concise explanations of the essential content. • Introduction consisting of different types of questions and techniques for writing answers to focus students’ revision efforts. • Key points, tips and notes for avoiding common errors and improving examination skills. • Revision questions at the end of each chapter for practice. • Practice papers and answer key at the end of the book to test understanding. This revision guide is also suitable for Cambridge O Level Computer Science (2210). David Watson is an experienced teacher of computing. He has been an examiner for over twenty years.

S\

wm, it

111

fewI yam

EKIF. svS

MBam

\

Helen Williams graduated in Mathematics and currently teaches Data, Computing and Information at University level. She has been an examiner for Computing and ICT for over 20 years and has edited several ICT and Computing textbooks. Completely Cambridge - Cambridge resources for Cambridge qualifications Cambridge International Examinations is the world’s largest provider of programmes and qualifications for 5-19 year olds. Cambridge University Press is the oldest publishing house in the world, having been operating continuously since 1584, and is one of the largest academic publishers globally.

Cambridge University Press works with Cambridge International Examinations and experienced authors to produce high-quality endorsed resources that support Cambridge Teachers and encourage Cambridge Learners.

To find out more about Cambridge International Examinations visit http:// www.cie.org.uk Visit education.cambridge.org/cie for information on our full range of Cambridge IGCSE titles including ebooks and digital resources.

Other titles in the series: Coursebook - ISBN 978 -1-107- 51869 - 8 Programming Book for Microsoft® Visual Basic - ISBN 978 -1-107- 51864 -3

CAMBRIDGE fay UNIVERSITY PRESS

Achievemt through excellence

linnI

ISBN 978 - 1 -

ENDORSED BY

CAMBRIDGE SI W International Pvo

9 781 1 7 6 9 6 3 4 1

>