0% found this document useful (0 votes)
39 views126 pages

Log On To IT - 111820

Uploaded by

Stephanie Jonaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views126 pages

Log On To IT - 111820

Uploaded by

Stephanie Jonaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 126

What is a computer?

A computer is a programmable electronic device that processes data,


following a set of instructions to produce information which it can output or
store for future use. An electronic device uses tiny electric currents, flowing
through circuits, to perform its operations.

What is the difference between data and


information?
Data is all the raw facts and figures that a computer processes by following a
set of instructions called a program. Data by itself has no meaning; it can be
in the form of letters (a, b, c, d... x, y, z, etc.), numbers (1, 2, 3, 15, 456, etc.),
pictures, sounds or symbols. It is only when we attach meaning to data that
we get information.

For example, if you collect the temperature of your classroom each day for a
month, you have collected data. When you instruct a computer to arrange
(sort) this data, you could get information such as the following:
• The highest temperature over the period
• The lowest temperature over the period
• The mean (average) temperature over the period.

This information may then be useful, for example, to determine whether a


classroom is too hot or too cold for comfortable working. If the information
were just raw data, it would not be easy to interpret. Hence, the computer
has helped you look at a real-life situation or problem and make some sense
of it.

Why do we use computers?


• For their data-processing speed: computers are very fast; they can
perform tens of millions of operations per second. With this speed comes
the power to undertake many different tasks such as predicting weather
forecasts, performing scientific research and producing thousands of bills
for utility companies.
• For their data-processing accuracy: computers are very accurate. Errors
occur only if there is an error in the way hardware and software have
been set up, or if there are errors in the data that has been input. When
errors occur it is therefore usually because of some human error.
Computers can only do what they are set up and programmed to do.
• For storing large amounts of information in a small space: there are
many types of computer storage media that can be used to store large
volumes of data and information. For example, a single CD-ROM disk can
hold the equivalent of a shelf of library books in electronic form.
• For their ability to work continuously: computers can work continuously
0 for very long periods, only stopping for upgrading or maintenance
checks. In fact, most modern computers can be left switched on all the
4 ^^ time if desired, 24 hours per day and 7 days a week, continuously
processing data.
Hardware and software
A computer system consists of both
hardware and software. Hardware is
all the parts of the computer system
you can see and touch. These devices,
which are also called peripherals,
include keyboards, printers, speakers,
mouse and hard drives. Software is a
set of instructions (called a program)
that a computer needs to carry out its
tasks. For example, if you want to use
the computer to type a letter, draw a
picture or do some accounting work,
you would need different types of
software to accomplish these tasks.
Some typical examples of software are
word processors, spreadsheets,
graphics packages and database
packages. Both hardware and software
are needed to process data.

Figure 1.1

The parts of a personal computer
Stages of processing ,•
Tb accomplish its tasks a computer has to process data. Processing data to
get information involves three stages: input, processing and output.

Input Processing Output


aid you know?
Figure 1.2 Stages of processing Did you know that the
scientific unit of measure
Input devices are used to get the data and instructions into the computer for
'hertz' (Hz) is named in
processing. The processing takes place in that part of the computer called
honour of the German
the central processing unit (CPU). The CPU, also known as the processor, is
physicist Heinrich
the `brain' of the computer. It takes raw data and, following a set of
Rudolf Hertz (1857-1894).
instructions (programs), converts it into information. The speed at which a
Hertz did the groundwork for
CPU processes data to convert it is measured in megahertz (millions of
the development of the vacuum
machine cycles per second) or for newer machines in gigahertz (billions of
tube. He also discovered
machine cycles per second). A machine cycle is the sequence of
electromagnetic waves.
instructions performed to execute one program instruction. Machine cycles
are measured in nanoseconds (one billionth of a second) or picoseconds
(one trillionth of a second). The CPU consists of two smaller units known as
the Control Unit (CU) and the Arithmetic and Logic Unit (ALU).

Control unit
The control unit is the main part of the CPU. It directs and co-ordinates all
the activities within the CPU. The control unit determines the sequence in
which instructions are executed. It does not execute the instructions itself;
instead it sends the data and instructions to the ALU for processing. The
CPU is primarily responsible for movement of data and instructions from


5••


itself to the main memory and ALU and bac The CU executes an
instruction by performing the following steps:
1 Fetching the instruction from memory
2 Decoding the instruction
3 Fetching the data required by the instruction from memory
4 Sending the data and instruction to the ALU for processing
5 Sending the data to the memory unit after processing
The control unit contains a number of registers. A registc r is a temporary
storage location that holds a single instruction or data item. Registers are
used to store data and instructions that are needed immediately and
frequently. Two examples of registers found in the control unit are.the
program counter (PC) and the instruction register (IR). The program
counter holds the address of the current instruction (the instruction being
processed) and the instruction register holds the instruction itself.

Arithmetic and Logic Unit


The Arithmetic and Logic Unit (ALU) performs all the arithmetic and logic
functions in a computer. For example, if an instructie =. -: es an
arithmetic operation such as addition, subtraction, multiplication or division
or the comparison of data, the control unit sends the data to the ALU for
processing.
Some of the logic functions are comparisons, such as:

equal to = not equal to #

less than < greater than >


less than or equal to < = greater than or equal to > _

For example, using the 'equal to' logic function, the ALU compares two
values to determine if they are equal.
Other logical operations performed by the ALU are AND, OR and NOT. You
will learn more about these in Chapter 8.
Figure 1.3
The components of a basic
computer system

The main memory


Central Processing Unit The main memory, which is directly
1 accessible to the CPU, holds data and
Control Unit (CU) instructions that the computer is
processing at the time. Therefore, the
data collected in the example about
the temperature of the classroom
Arithmetic and Logic Unit (ALU) would be placed in main memory
Input ---- Output while it is being processed.
Devices Devices
Output devices then translate
Main Memory _ ____ information processed by the
computer into a form which the user
can understand. After processing, the
data and information can be either
Secondary or Auxiliary Storage stored in a secondary storage device,
Devices/Backing store/disk storage such as a disk, or sent to an output
device such as a printer or a computer
6•. screen.
0
I

Types of computer*
Computer systems are classified on the basis of system performance, which
in turn affects physical size and cost. Given the rapid pace at which
computer technology is changing, classifying computers on this basis is
often very difficult, since many of the newer, smaller systems can
outperform the large models of a few years ago. Nevertheless, some broad
categories can be defined, as follows.

Personal computers (PCs)


Personal computers (PCs), also
sometimes called microcomputers, are
the most common type of computer.
They come in many different shapes,
sizes and colours, depending on the
manufacturer. PCs are designed to be
used by one person at a time and fit on
an office desk, hence the other name
given to them, 'desktop computers'. A
PC consists of a system unit, a
keyboard, a mouse and a display
screen, and has all the functional
elements found in any larger system.
It is designed to perform the input,
control, arithmetic/logic, output and storage functions
mentioned earlier in the chapter, just like any other
computer system would do. It can execute software
program instructions to perform a very wide variety of tasks.

Laptops
A laptop computer is a portable version of a PC, equipped with a flat liquid
crystal display (LCD) screen and weighing about one to four kilograms. The
two principal types of laptop computers are notebooks and sub-notebooks.
A notebook computer is a portable computer that weighs two to four
kilograms and is roughly the size of a large thick notebook, around
35 x 25 x 4 centimetres. They have a fairly large LCD colour screen
(about 30 cm across) and a fairly large keyboard, usually with a small
touch-sensitive pad which serves as a mouse. Notebook PCs can easily be
tucked into a briefcase or backpack, or simply under your arm, and can use
power from an electrical outlet or rechargeable batteries. Notebooks are
usually just as powerful as a desktop PC but cost more than their equivalent
desktop PC.
A sub-notebook computer weighs about half a kilogram and can fit in a large
jacket pocket. It has a small screen, sometimes in colour, and a small
keyboard without the mouse function. It can perform many of the functions
of notebooks, but not to the same degree of complexity.

Figure 1.5
A notebook computer


7 ^•

Minicomputers
Minicomputers have become outdated and are rarely used today. They were
very popular in the 1960s. Their cost, storage and processing capabilities
were somewhere between those ofa PC and a mainframe computer. They
were mainly used in small manufacturing plants, research labs and
businesses. Mini systems were usually designed to handle simultaneously
the processing needs of multiple users. They allowed many users to share
access to central hardware through stations called terminals. Minis can
support dozens of terminals. A typical terminal has a keyboard, a display
screen and a wire that connects the terminal to the computer system.

Mainframes
Mainframes are very powerful
computers and are therefore very
expensive. Mainframes are systems that
offer faster processing speeds and
greater storage capacity than a typical
mini. A mainframe can handle more
than a thousand users at a time. They
are found in large organisations such as
banks, government agencies, insurance
companies and corporations where they
perform tasks that require a lot of
computational power: typically, bulk
data processing such as censuses,
industry/consumer statistics and bank
transaction processing. The IBM zSeries
990 Model D32 is currently one of the
most powerful mainframe computers
available.
Figure 1.6
A mainframe computer Supercomputers ('monsters')
Supercomputers such as NEC's Earth Simulator and California Digital
Corporation's Intel Itanium2 Tiger4 were two of the largest, fastest and most
powerful computers in the the year 2004. They are typically used for
'number crunching' in scientific simulations, scientific research and
developments in areas such as energy, space exploration,
medicine and industry. Supercomputers are designed
to process complex scientific applications.
These systems are the most expensive
computers in the world, often
costing millions of dollars.

Tablet PC
A tablet PC is a computer that
looks like a notebook computer
except that data can be entered
through the use of a keyboard, touch
screen or a digitising tablet. Data can be
entered through the digitising tablet with the
use of a special pen called a stylus.

Figure 1.7
:^^ A tablet PC
ers and palmtop computers
;se are so-called because they fit in the palm of
iur hand and are therefore less powerful than
otebooks and sub-notebooks. They can fit into a
hirt pocket and weigh perhaps 300 grams on
verage. They might have a very small keyboard,
)r a palm-sized screen (sometimes in colour)
which can be written on with a special pen.
Electronic organisers are mainly used to store
appointments, addresses, phone numbers and
'to do' lists.

Palmtop computers are more powerful than


electronic organisers, and these days can even
run some of the same software as sub-
notebooks and notebooks. Some cellular
phones are now powerful enough to act as very
small personal organisers.

pure 1.8 A palmtop computer

Embedded computers
An embedded computer is a special-purpose computer used inside a device
and is usually dedicated to specific functions. It is housed on a single
microprocessor board with the programs stored in ROM. It is connected to
sensors - devices which detect changes in the environment such as light,
temperature or pressure - and actuators, hardware output devices that
convert an electrical control signal into a physical action. They are
commonly used in items such as washing machines, cameras, cars, motors,
sewing machines, clocks and microwaves.

Generations of computers
Computers can be broadly classified into five generations. These
generations are based mainly on the basic electronic component that was
used to build the computer.

First generation (1945-1956)


The vacuum tube or valve was the main electronic component of first Figure 1.9
generation computers. This made the computers very large; they contained The button panel
many kilometres of electrical wire, used a lot of electrical power and of a microwave
generated a lot of heat. Because vacuum tubes were blown so easily,
processing was unreliable. Also, each computer had a different binary coded
program called a 'machine language' that told it how to operate, and had to
be programmed directly in this machine language. This made the computer
difficult to program and limited its versatility and speed.
The Harvard Mark I (electromechanical) was the first computer in this
generation. The ENIAC (Electronic Numerical Integrator and Calculator)
produced in 1946 was the first computer to use electrical signals for
calculating and storing results, with no mechanical operations involved.
Other first generation computers include UNIVAC, Burroughs 220 and the
S
IBM 700 series. 9 ^0
0
Second generation (1956-1963)
Did you know?
Did you know that the Tt hansistors were invented in 1947 and these formed the basis for second
V transistor is considered generation computers. A transistor is a device used to open and close a
to be one of the greatest circuit in computer processors and digital memory. Computers became
inventions of modern smaller, faster, more reliable and more energy-efficient than their
times? Without transistors, predecessors. The machine languages of the first generation computers
modern computers would not were replaced by assembly language, allowing abbreviated programming
have been possible. The codes to replace long, difficult binary codes. Some popular second
transistor was invented at Bell generation computers include the IBM 1400 and 1600 series, UNIVAC III,
Laboratories in December 1947 NCR 300 series and the Burroughs B500 series.
by John Bardeen, Walter
Houser Brattain and William Third generation (1964-1970)
Bradford Shockley. They were
awarded the 1956 Nobel Prize in With the invention of the integrated circuit (IC), or chip, computers became
physics for their outstanding even smaller, faster, more reliable, more energy-efficient and cheaper than
achievement. their predecessors. Another third generation development was the
invention and use of'high-level' languages, which used English words and
the base ten number system to program the computer. Some third
generation computers include the IBM System 3 and System 7, UNIVAC
9000 series, NCR Century series and the Burroughs 6700.

Fourth generation (1971-present)


Fourth generation computers are still based on the chip, but with many
more components packed inside. First there was large-scale integration
(LSI), where hundreds of components were placed on the chip. By the 1980s
very large scale integration squeezed thousands of components onto a chip.
Ultra large scale integration (ULSI) increased that number to millions of
components. Computers became even smaller, cheaper and much more
reliable; their processing capabilities increased accordingly. Some examples
of fourth generation computers include the IBM System 3090 and RISC 6000,
HP 9000 and the Cray 2 XMP, which were developed in 2002.

Fifth generation (present-future)


Fifth generation computers will be able to mimic many of the things that so
far have only been within the capacity of human beings to achieve, i.e. they
will demonstrate a certain level of artificial intelligence. For example, fifth
generation computers, including standard PCs, are starting to accept spoken
word instructions (voice recognition) and can now assist doctors in making
very specific diagnoses (expert systems).

Computers of this generation make use of parallel processing: they are


capable of performing multiple, simultaneous operations using more than
one microprocessing chip. This makes them especially powerful. The
eventual goal of fifth generation computers is to develop devices that
respond to natural language input and are capable of 'learning'. An artificial
intelligence program would therefore eliminate the need for users to write
programs, since they could communicate their orders to the computer via
ordinary English.

1st ,•
capabilities were between those of a PC and a
Summary mainframe. They were mainly used in small
1 A computer system consists of both hardware and manufacturing plants, research labs and
software. businesses.
2 Hardware is all the parts of the computer system 18 Mainframes are very powerful computers and are
you can see and touch, e.g. printers, keyboards, very expensive. They offer faster processing
mouse, system unit. speeds and greater storage capacity than a typical
3 Software is a set of instructions (program) that a mini. A mainframe can handle more than a
computer needs to carry out its tasks. thousand users at a time. They are found in large
4 Data is all the raw facts and figures that a organisations such as banks, government agencies
computer processes by following a set of and insurance companies where they perform
instructions (called a program) to produce tasks that require a lot of computational power -
information. typically bulk data processing such as censuses
and bank transaction processing.
5 Input, processing and output are the three stages
of processing. 19 Supercomputers are the largest, fastest and most
powerful computers at present. They are typically
6 Input devices are used to get data and instructions
used for 'number crunching' in scientific
into the computer for processing.
simulations, scientific research and development
The Central Processing Unit is the 'brain' of the in areas such as energy, space exploration,
computer. It consists of two smaller units known medicine and industry.
as the Control Unit (CU) and the Arithmetic and
20 Laptops, notebooks and sub-notebooks are all
Logic Unit (ALU).
portable computers with flat LCD screens.
The control unit is the main part of the CPU. It
21 A tablet PC is a computer that looks like a
directs and co-ordinates all the activities within
notebook computer except that data is entered
the CPU.
through the use of a digitising tablet or touch
9 A register is a temporary storage location that screen.
holds a single instruction or data item.
22 Electronic organisers are mainly used to store
10 The program counter (PC) holds the address of the appointments, addresses, phone numbers and 'to
current instruction (the instruction being do' lists. Palmtop computers are more powerful
processed) and the instruction register (IR) holds than electronic organisers, and can even run some
the instruction itself. of the same software as sub-notebooks and
ii The Arithmetic and Logic Unit (ALU) performs all notebooks.
the arithmetic and logic functions in a computer. 23 An embedded computer is a special purpose
12 The main memory holds data and instructions computer that is used inside a device and is
that the computer is processing at the time. usually dedicated to specific functions.
13 Output devices translate information processed by 24 The vacuum tube or valve was the main electronic
the computer into a form which the user can component of first generation computers.
understand. 25 Transistors were invented in 1948 and formed the
14 Computers are used because of their great speed, basis for second generation computers. Computers
accuracy, large storage capacity and ability to became smaller, faster, more reliable and more
work continuously in solving a variety of energy-efficient than their predecessors.
problems that would otherwise require many 26 The integrated circuit (IC) or chip formed the
human hours of work. basis for third generation computers. The use of
15 Computer systems maybe classified as embedded high level languages, which used English words
computers, personal computers (PCs), and the base ten number system to program the
minicomputers, mainframe computers and computer, was a feature of this third generation.
supercomputers ('monsters'). 27 Fourth generation computers are based on the
16 Personal computers (PCs), also called desktop or chip but with many more components packed
microcomputers, are the most common inside. Ultra large scale integration (ULSI)
computers. PCs are designed to be used by one increased that number to millions of components.
person at a time and can usually fit on an office 28 Fifth generation computers will be able to mimic
desk. A PC consists of a system unit, a keyboard, a many of the things so far only achievable by
mouse and a display screen, and has all the human beings (artificial intelligence). These
functional elements found in any larger system. computers will be able to accept spoken word
17 Minicomputers have become outdated and are instruction (voice recognition) and assist doctors
rarely used today. They were very popular in the in making diagnoses (expert systems). 11 ^•
1960s. Their cost, storage and processing •

8 First generation computers were based


Questions on the integrated circuit (IC) or chip. Tq Fq
9 CRAY T3E 900 and GRAPE are
Copy and fill in the blanks examples of personal computers. TD FD
1 A set of instructions that a computer needs to 10 The most popular computers today
carry out its tasks is known as are mainframe computers. Tq Fq
2 is a set of raw facts and figures. 11 A register can hold data permanently. Tq Fq
3 are used to get the data and 12 The program counter (PC) is found in
instructions into the computer for processing. the control unit. TDF q
4 Processing takes place in that part of the computer
known as the
Multiple choice
5 computers will be able to mimic
1 ENIAC was the first:
many of the things that so far can only be done by
human beings. (a) Electromechanical computer
6 The vacuum tube or valve was the main electronic (b) Electronic computer
component of generation computers. (c) Computer with integrated circuits
7 The directs and co-ordinates (d) Microcomputer
all the activities within the CPU. 2 Which is not an example of a peripheral device?
8 An computer is a special purpose (a) Keyboard
computer that is used inside of a device and is
(b) Mouse
usually dedicated to specific functions.
(c) Floppy disk
9A is a temporary storage location that
holds a single instruction or data item. (d) Speakers
10 The holds the address of the 3 A program is a:
current instruction in the control unit. (a) Hardware device
11 The performs all the arithmetic (b) Memory device
and logic functions in a computer. (c) Set of instructions
12 holds data and instructions that the (d) Register
computer is processing at the time. 4
Which device is not found in the CPU?
13 translate information processed
(a) ALU
by the computer into a form which the user can
understand. (b) Control unit
14 A computer system consists of both (c) Instruction register
and (d) Printer
15 All the parts of the computer system you can see 5 The ALU processes data and stores it in:
and touch is known as (a) A diskette
(b) Main memory
True or False? (c) The instruction register
1 Data and Information are the same. Tq Fq (d) The program counter
2 The CPU is the main part of the 6 Which one of the following is not a function of the
computer. Tq Fq control unit?
3 All the data is processed in the (a) Fetch instructions from memory
memory unit. Tq Fq (b) Decode instructions
4 The control unit sends data from the (c) Process instructions
memory to the ALU for processing. Tq Fq
(d) Fetch data for required instructions
5 Output devices translate information
7 Complex scientific research is usually done using:
processed by the computer into a form
which the user can understand. Tq Fq (a) Microcomputers
6 A modern mainframe has the same (b) Supercomputers
processing power of a very powerful PC. T q Fq (c) Minicomputers
7 An embedded computer is housed on (d) Mainframe computers
a single microprocessor board. Tq Fq

A
8 The main component that formed the basis for 10 Discuss with your classmates how a portable
second generation computers was: computer could assist these professionals with
(a) Vacuum tubes their work:
(b) Registers (a) A teacher
(c) Integrated circuits (b) A police officer
(d) Transistors (c) A newspaper reporter
9 Third generation computers were used during the (d) A sales representative
period:
(a) 1933-1945
(b) 1945-1956 Crossword
(c) 1956-1963
(d) 1964-1970
10 Which generation of computers used ultra large
scale integration (ULSI)?
(a) First generation
(b) Second generation
(c) Third generation
(d) Fourth generation

Short answer questions


1 Define the terms hardware and software.
2 Using examples, explain the difference between
data and information.
3 Draw a diagram showing the three stages of
processing.
4 (a) Draw a block diagram to illustrate the main
components of a computer system.
(b) Describe the functions of the two main units
found in the central processing unit.
Across
5 Explain the purpose of the following devices:
1 A device in the control unit that is used to store
(a) Input device
data and instructions that are needed immediately
(b) Output device and frequently (8)
(c) Main memory 6 A type of processing that will be used in fifth
6 State FOUR reasons why computers are used. generation computers (8)
7 Describe the features of a personal computer (PC) 7 Performs the logic functions in the computer (3)
8 (a) Explain the difference between a mainframe
computer and a supercomputer. Down
(b) State TWO reasons why a bank may want to 2 It represents billions of machine cycles per second
purchase a mainframe computer. (9)
(c) Differentiate between a notebook computer 3 A special purpose computer that is used inside a
and a sub-notebook computer. device (8)
(d) What is an embedded computer? 4 A set of instructions that the computer needs to
9 (a) List the components that formed the basis of carry out a task (8)
the first four generations of computers. 5 Also known as the brain of the computer (3)
(b) What are some of the expected features of
fifth generation computers?

15 •

0111 £9ra ►ifK=

computer needs input, output and storage devices s6that it can


accept data, process that data and produce useful output. All the
input, output and storage devices connected to and dependent on a
computer for operation are called peripherals. Input devices are pieces of
equipment that are used to put data into the computer.

Data collection
Data capture
Data capture is the first stage of getting data into a computer. It is at this
point that the various input devices are used to import data that the
computer will process and/or store.
There are two main ways of inputting data:
• Manual data input: Data is entered directly into the computer one
transaction at a time by hand. Keyboard, mouse, touch screen, light pen,
graphics tablet and voice input devices are some of the devices used.
• Automatic data input/data capture: Data is entered directly into the
computer from source documents. Source documents are documents
on which data is first recorded before it is entered into the computer.
Data entered from these documents is transferred directly from the
document into the computer's memory. Data is captured at the source,
for example directly from barcodes on supermarket items into the
computer or directly from national lottery slips into the computer.

Data verification and validation


The data captured or entered manually must be verified and validated by
the computer before it is transferred to backing storage.
The process of verification is checking for accurate transcription or
copying. A person copying the data may be required to type the data twice.
Data typed in the second time is compared with that typed in first time. If
there is a difference then it is considered that an error has occurred and has
to be corrected by re-entering the data. For example, when you are asked to
enter a password twice it is usually to verify that what you entered the first
time is correct.
Once data has been entered into the computer, it is usually checked by the
computer to see that it obeys the rules which apply to it; this is called
validation. For example, you maybe asked to enter your birthday according
to the format mm/dd/yyyy. However, suppose you entered 21/10/1988
instead of 10/21/1988. There are only 12 months in a year, so the computer
checks to see that you have entered a value within the correct limit:
between I and 12 for months, between 1 and 31 for days of the month, and
so on.


14 %

Typical input devices '
typical input devices include the following peripherals. In this next section,
we will look at each of these in turn.

Keyboard Optical Mark Reader (OMR)


Mouse Barcodes
Joystick RFID
Digitising tablet Magnetic reader
Thuch-sensitive screen Smart cards
Light pen Voice data entry
Digital stills camera Sound capture
Magnetic Ink Character Video capture
Recognition (MICR) Biometric systems
Image scanner (OCR) Remote control
Flatbed/drum scanners etc Sensor

Keyboard
The most common input device is the keyboard. A digital code is sent to the
computer when each key is pressed. For example, the code 01100001 is
produced when the 'A' key is pressed. Keyboards play a pivotal role in the
input of data into the computer. Their design is of critical importance for
comfort and usability, since users may spend long periods of time entering
data. Many keyboards are therefore designed with ergonomics in mind.
There are two types of keyboard: the alphanumeric keyboard and special-
function keyboards. The alphanumeric keyboard contains letters, numbers
and symbols in particular layouts. This keyboard is modelled on the
typewriter keyboard, also known as a QWERTY keyboard (based on the
sequence of letters at the top left). Keyboards maybe attached to the
computer by wires or they maybe wireless.
Special-function keyboards are invented for a particular purpose. For
example:
a The Braille keyboard has its keys marked with raised dots to aid the blind.
a The concept keyboard contains a flatbed of contact switches covered by a
flexible membrane. Over each contact switch whole words, pictures or
symbols are superimposed. The computer is then programmed to
respond appropriately to these. These keyboards are used in education as
an early-learning aid, in restaurants so the operator can visually add up
the cost of standard menu items, and in messy places where a normal
keyboard would be at risk.
• The left-handed keyboard is designed for the left-handed individual.
• A virtual/projection keyboard is projected onto any surface and touched.
The keyboard can register your finger movement and hence translate
that movement into a keystroke. An example is the touch-screen
keyboard of the automatic teller machines (ATM) found in front of
banks, etc.

Poir tg devices
Pointing devices are used by graphical operating systems such as Windows
to show the motion of a pointer or cursor, and enable the control and
selection of objects on the display.
15


Mouse
The movement of the mouse over a flat surface is mirrored by a pointer on
the monitor screen. Under the mouse is a ball which rolls and turns two
shafts, one for each direction - left/right and up/down (Figure 2.1). Buttons
F1 on the mouse allow you to make selections from menus, move objects
around the screen and paint or draw.

Rollers The ball can get dirty and transfer the dirt to the shafts. This can cause the
mouse pointer to move erratically. The mouse therefore needs to be cleaned
regularly.
Besides the regular mouse, there are other kinds of mouse: some designed
for comfort and others a matter of preference:
• The optical mouse can slide over most surfaces since it does not have a
ball. It emits a small beam of red light which bounces off the surface into
Figure 2.1 a sensor. The sensor sends co-ordinates to the computer which in turn
Illustration of the moves the cursor or pointer on the monitor screen, according to these co-
mechanics inside a mouse ordinates. The advantage of this type of mouse is that you do not need to
worry about dirt and cleaning, and it is very easy to manipulate. Since
there are no moving parts the mouse is less likely to fail because there is
less wear and tear. The disadvantage is perhaps that this type of mouse is
more expensive than an ordinary mouse. A mouse can come with or
Did you know? i;. without a wire attachment, hence we have the wireless mouse.
• The trackball mouse has a large ball on top rather than underneath. You
Did you know that the
can roll the ball with the palm of your hand or fingers. These are found
measurement for the
mainly on laptop computers. Buttons placed close by allow you to select
speed and movement
features on the screen.
direction of a computer
• The pointing stick mouse found on laptop computers looks like a pencil
mouse is called a mickey?
eraser. It protrudes from the keyboard between the B, G and H keys.
One mickey is approximately
Pushing on the pointing stick with your finger will move the pointer
of an inch.
around the screen. Once again, buttons placed close by allow for
selection of features on the screen.

The touchpad mouse contains a


touch-sensitive pad and is
normally found on laptops. It is a
pressure- and motion-sensitive flat
surface of about 5 cm X 5 cm, over
which you move your fingers to
control the cursor/pointer on the
screen. Buttons placed close to this
surface allow for selection of
features on the screen.

Figure 2.2
An optical mouse Joystick
Ajoystick is a device which lets you control the movement of an object on
•• the screen by operating a small lever. It is used mainly for computer games
16 • such as flight simulators.

Digitising tablet (graphics tablet)
Tb digitise data means to conve rt it from an analogue form (like a picture) to
a digital form (binary numbers - see Chapter 5). A digitising tablet is a
board which can detect the position of a pointing device such as a stylus or a
puck on its surface. A stylus is a pen-like pointing device for a
graphics/digitising tablet. A puck is a mouse-like device which is moved
over the surface of the tablet. It has cross-hairs to position it accurately and a
number of bu ttons for different actions. Drawings and sketches can be easily
entered onto the computer using the digitising tablet.
Figure 2.3 A light pen

Touch-sensitive screen
This pointing device lets you interact with the computer
by touching the screen. The pointer is the human finger.
There are three forms of touch screen: pressure-
sensitive, capacitive surface and light beam. These
screens are used in bank ATM machines, for example.
They allow you to perform actions on your bank account
by following instructions and options on-screen, using
your finger to choose the option you wish.

Light pen
This is shaped like a pen (Figure 2.3) and is connected to
a VDU/monitor. It allows you to point and make
selections more accurately on a screen. The tip of the
light pen contains a light-sensitive element which, when
placed against the screen, detects the light from the
screen and enables the computer to identify the location
of the pen on the screen. Making selections with a light
pen is far more accurate than using your finger to make
selections on a touch sensitive screen. Light pens also
allow the user to draw dir ctly on the screen. However,
they are not as accurate as a igitising tablet and drawing
can become uncomfortable.


1 What is the most common 3 A device that enables the 5 Which type of ^•
input device? user to control the movement keyboard would most ^•
(a) Mouse of objects on the screen by likely be used by a
operating a small lever is a physically challenged
(b) P ri nter
(a) Thuch-sensitive screen person?
(c) Monitor
(b) Joystick (a) Concept keyboard
(d) Keyboard
(c) Puck (b) Alphanumeric keyboard
2 Which of the following is not
(d) Light pen (c) Virtual keyboard
a pointing device?
4 Which of these has a ball (d) Left-handed keyboard
(a) Joystick
positioned at the top?
(b) MICR
(a) Optical mouse
(c) Light pen
(b) Pointing stick mouse
(d) Mouse
(c) Touchpad mouse
(d) 'I7ackball mouse


17
S•

Scanning devices
Scanners
Scanners were originally designed to scan pictures (image scanners) but now
their use is extended, for example to scan text into a word processing program.
There are many types of scanners:
• Flat-bed scanner: The picture is placed on a fl at scanning surface and the
image is captured, similarly to how a photocopying machine works.
Household versions are inexpensive, costing less than 100 US dollars.
• Hand-held scanner: The scanner reads in the picture while the user drags the
scanner over it. The quality of the image provided by this scanner is poor,
but it is useful for quick data capture.
Figure 2.4 • Drum scanner: These are normally used in the publishing indust ry
A flat-bed scanner (magazines, books) to capture images with high detail. These scanners tend
to be expensive, costing perhaps thousands of US dollars.
• Sheet fed scanner: The sheet that contains the image is fed through rollers
and the picture is scanned as the paper passes through.

Magnetic Ink Character Recognition


(MICR)
MICR is mainly used in the banking indust ry to read cheques. Bank cheques
have the following information encoded in them:
• The cheque number
• The bank branch number
• The customer's account number.
• After the customer has written a cheque, the bank also encodes the amount
of money using a special magnetic irik which contains iron oxide.
The cheques can then be read by an MICR reader. As the document passes into
the MICR reader the shapes of the characters can be recognised electronically.
The characters have to be printed in a special font since the reader can only
recognise a speci fi c font and a limited number of characters: some readers can
only recognise 14 characters.
Advantages
Bank of EMR, EMR Building, 1 Main Street, Trinidad. 01-23-45 • Documents are difficult to forge.
O7- !21 / 2002 • Documents can still be read after
PoY GS A DO i MM / YYYY being written on, folded, soiled etc.

owe tl^o saved v Disadvantages


1000.00 • MICR readers and encoders are
expensive.
JSS44itl1 • The system can accept only a few
Mr Smith characters.
Cheque number Branch so rt code Account No

0
n 002S640 6250- 1357 , : 00023456789 0

Figure 2.5
Photo of a bank cheque Optical Mark Reader (OMR)
OMR detects the position of black marks on white paper. The documents to be
read have empty boxes pre-printed on them. The user makes pencil or ink
marks in the approp ri ate boxes. The intensity of the reflected light from these
marks on the form is detected by the OMR. This is sometimes called mark
• sensing. The computer records the position of the marks and analyses it to
determine the meaning of the data. OMRs are used mainly in assessing
.• multiple-choice examinations or questionnaires given out by market researchers.
Optical Character Recognition (OCR)
Optical character recognition is used for reading characters from paper,
using special OCR readers. The reader includes an optical scanner for
reading the text. The shapes of different characters are detected by shining
light on them from a photo-electric device and sensing the patterns of
reflected light. The reader looks at each pattern (say, a letter, like 'R')
individually. Sophisticated software allows each pattern to be compared
with a set of stored patterns until the closest match is found. This match is
translated into electronic text in the computer, so it can be m'arfipulated by
the user.
Advantages
• OCR is great for converting large volumes of printed data into a form that
can then be manipulated on the computer, for example in a word
processing program. It can therefore be used to create computer archives
of old printed books and documents, preserving these in a searchable
electronic form for the future.
Disadvantages
• OCR has difficulty understanding handwritten text if the letters in that
text are not formed properly. OCR also has difficulty recognising certain
unusual fonts.

Figure 2.6
- Barcode readers A scanner being used
to 'read'a barcode
A barcode is a set of vertical lines of differing thickness with a string of
numbers printed at the bottom. The barcode is read by a scanner in which a
laser beam scans the barcode and the light is reflected back into the scanner.
The information received by the scanner is sent to a computer for
processing. The system gives fast and error-free data entry into the
computer. Barcodes provide a quick method of recording the sale of items.
You can see barcodes on items in supermarkets, books in libraries and on
such things as magazines.

Point of sale (POS) system


Barcodes form part of the POS system usually found at retail outlets. A
terminal is connected to a central computer which records details after the
barcode of an item has been scanned. The price of the product is displayed
on a monitor at the point of sale. Meanwhile the central computer calculates
the amount due, including VAT, and prints an itemised receipt. The
information recorded can also be used for stock control and sales analysis.
Advantages
• Customers get a quicker more accurate service, which improves
efficiency.
• Supermarkets can get instant or continuous stock checks.
• Saves on paper work. ISBN 0-582-83648-4
Disadvantage
• Barcodes cannot be read by people.

RFID (radio frequency identification) H H1


Radio frequency identification (RFID) uses radio waves as a means of 9 780582 836488 N
identifying animals, persons and objects. A chip connected to a small
antenna makes up the RFID transponder or RFID tag. Information such as a
serial number is transmitted to an RFID receiver that converts the radio
waves to digital information so that it can be processed by the computer.

19 ••

RFID chips are used for tracking animals, for example, as they can be
embedded in the skin of the animal and the tag can be read once the animal
is within range of the reader. Some stores are now tagging their merchandise
with RFID tags to record POS information, and also as a means of security to
reduce theft. Alarms can be raised when someone tries to exit a store
without paying for an item. The disadvantage of RFID is that it is a lot more
expensive than barcoding.

Barcodes
Barcodes must be passed over a reader to be read. REID tags can be read once the items are within range
of a reader.

Barcode labels can be ripped, soiled or removed RFID can be tagged on the surface or embedded in the
making it difficult or impossible to read them. object. Since radio waves can travel through non-
metallic material, the RFID chip can be encased in
plastic for further durability.

Barcodes do not identify single unique examples RFID can distinguish between two identical cartons
of a single product-type. For example, they from one manufacturer with different expiry dates.
distinguish between milk made by two different
manufacturers, but cannot distinguish between
two identical cartons with two different expiry
dates from the same manufacturer.
Barcodes are much cheaper than RFID and More expensive than barcodes but more effective for
effective for certain tasks. certain tasks.

Barcode tags cannot be reused RFID tags can be reused again and again.

Table 1 Comparing barcodes to RFID

Magnetic strip codes


A magnetic strip is a short length of magnetic coated tape printed on the
surface of or sealed into a ticket or card. It contains information to identify
the ticket or card and its user.
The card is read by swiping it - moving the magnetic strip through a reader
so that the strip can be read. Such strips are found on bank cards which
identify the card holder's bank account, so that the card holder can perform
banking transactions.
Cards with these magnetic strip codes can provide quick identification of
people entering buildings, allowing access to the card holder. These cards
are therefore used for security purposes too. Examples of other uses are in
phone cards and debit cards for cell phones. The magnetic strip in this
instance contains information about the amount of money left 'on the card.
Advantages
• They are easy and cheap to produce.
• The strip can store enough information for simple transactions.
• Cuts down on paperwork that would otherwise be involved in a
transaction.
Disadvantages
• The data can be changed, altered, forged or erased by magnetic fields.
• The strip can be damaged by scratching.
• The strip can store only a limited amount of information.
Sma rt cards
In recent years, new means of storing data on cards have become available.
'Smart' cads with very thin gold-coloured memory chips sealed into them
can store more information than magnetic strip cards. Data is stored on the
memo ry chip embedded in the card, allowing a greater amount of
information to be kept and updated on the card than would be the case with
the old-style magnetic st rip. The chips can hold information for cell phone
use, debit and credit cards, and any prepaid services. Eventually, sma rt
cards may store information about a person's driving histo ry , their bi rt h
ce rt ificate or paper, and could even be imp ri nted with the holder's voice,
fingerp ri nts and retinal scans.
Advantages
• The chip can store a good deal of information, including personal
information, helping to confirm that the user of the card is also the
owner of the card.
Disadvantages
• The chip can potentially be damaged.
Figure 2.7
• The chip (and the machines that read it) are a li tt le more expensive to Photo of a sma rt card chip in close-up
produce than the old-style magnetic strip.

Across Down ^•
3 Has difficulty translating
hand written text to
electronic text (3)
1As
ve
va
)ne es of
ickness
4 Scanning device found in (7)
the publishing industry, 2 Us scanner
to capture images of high ov e (2
detail (4) wo
6 Scanned image must be 5 Us d
fed through device ch )
containing rollers (2
words) (8)
7 Type of scanner where
the image is placed on a
level surface (2 words) (7)

Audio and video input devices. •


Voice data entry/voice recognition
Voice recognition systems require the use of a microphone. This system
accepts the spoken word as input data or commands. Human speech is very
complex, because it carries tones, inflections and emphasis of various parts
of words and phrases. The computer is programmed to recognise certain
patterns of speech. Using a microphone, human speech is coded into a
sequence of electronic signals. These signals are compared to a set of stored
patterns. If they match, the command or data being entered is accepted by
the computer and is processed. •
21 ^•

Simple commands can be used to control machines, or even 'type' letters in
a word processor. Voice recognition has become important in many areas of
our lives. It has made life easier for people with movement difficulties, such
as the paralysed, who with suitable equipment can now operate a
wheelchair, lighting and even open doors using voice commands.
Advantages
• No typing is required.
• The system can be used-remotely, e.g. by telephone.
Disadvantages
• Recognition of words is still relatively slow.
• The system is not suitable for use in noisy places.
• You may need to train the system extensively to understand your
,' particular voice patterns.

Sound capture
All modern computers contain a built-in microphone for sound capture.
This means that you can record your voice, for example, to make comments
that are embedded in a word processing document. A sound card on your
computer is required for recording voice or music. The sound card digitises
the information into a form that the computer can understand.

MIDI instruments
Electronic musical instruments can have a MIDI port (Musical Instrument
Digital Interface) for input into the computer. The sounds are digitised and
stored as a file, can be displayed on screen, edited and played back, using
appropriate software.

Digital cameras
Digital cameras capture an image and store it in memory within the camera.
These cameras have a sensor that converts the light into electrical charges.
The processor in the camera converts this information into digital data and
stores it on a small diskette, fl ash memo ry or flash RAM card. The digital
images can then be uploaded from the camera to a computer where they
can be displayed, manipulated or printed. The memory can be erased so
that more images can be captured. Unlike normal RAM memory
(sometimes called tempora ry memo ry or volatile memory) where the
information is lost when the computer is switched off, flash RAM is non-
volatile. That is, the images are not lost when the camera is switched off.
The resolution of the camera is measured in pixels. The larger the number
of pixels the camera has, the clearer the image and the greater the detail
Figure 2.8
captured.
Digital camera
Advantages
• Photos can be shown on a small screen on the
• ^^ camera, and resized and erased as you go along, so
+^ o •® p that you only store on the camera the images that
you really want.
Disadvantages
• The sharpness and colour balance of a digital
z camera may not always be as good as with a
,o traditional film-based camera.
• It is relatively easy to lose or erase a digital camera's
^ ^ ^1^ memory cards by, for example, accidentally passing
SET MENU DISP. FUNC. ;^ ►'J_ J^ the camera through an airport X-ray machine.
22 .- r. \ /^lT
Digital video camera
The digital video camera (also called a digital video camcorder or DVD
camcorder) works in much the same way as a film camera, where light is
focused onto a film treated with chemicals. The chemical reaction of the
film to the light intensity forms the image on the film. Similarly, in a digital
camera, light is focused onto an image sensor called a charge-coupled device
which contains thousands of light-sensitive diodes called photosites. These
detect the light intensity and record an image. The digital video
camera/camcorder detects not only light intensity but also levels of colour
to reproduce a coloured image. The camera takes many pictures per second
to give an impression of movement.


Other input devices::.
Biometric systems
Biomet ri cs refers to the science of identifying an individual through their
body characte ri stics such as face geomet ry and hand geometry (e.g.
fingerp ri nts), iris or retinal scans, vein and voice patterns. All these forms of
identifying an individual can be input into a computer system set up for
secu ri ty purposes. In the near future they may become common, for
allowing access to buildings and bank accounts, for example.
Retinal scans use a ray of light directed into the eye to identify the distinct
network of blood vessels at the back of the eye. Fingerprint readers scan the
imp ri nt made by the pattern of ridges on the finger and compare it to a set
of patte rn s stored in memory. Fingerprints are considered unique, as no two
individuals have the same fingerprint.

Remote control
A remote control emits a beam of infra-red light that carries data signals.
Commonly used for input to televisions, stereo systems, VCRs and DVD
players, they are now being used by computers as a wireless means of
communication.

Sensors
Chemical or physical Input
changes in humans Analogue Digital Computer software
connections
and their Sensor the
processes the
signal interface to signal
environment can be information
computer
conve rt ed to
electrical signals
using sensors that
Figure 2.9
pass information to a computer, where it is analysed, stored and
How a sensor system works
manipulated by specialist software. These sensors are useful in the fields of
medicine, environmental planning and preservation, weather reporting,
and so on. A variety of sensors can be used to measure such things as heat,
light, sound, pressure, strain, acidity (pH), oxygen concentration, humidity,
pulse, water level, water flow, speed, tilt or even something like a door or a
valve opening or closing.


23 ^•

Summary 14 Biometrics refers to the science of identifying an
individual through their body characteristics such
1 Input devices are pieces of equipment that are as face geometry, fingerprint, hand geometry, iris,
used to put data into a computer. retina, vein and voice patterns.
2 Data capture is the first stage of getting the data 15 Sensors can be used to measure heat, light, sound,
into the computer. The two main data input pressure, strain, acidity (pH) and other changes in
means are manual and automatic data input (or the environment.
data capture).
3 Data verification is checking for accurate
transcription, whilst data validation is the
computer checking to see that the entered data
obeys the rules already set up within the Questions
computer.
4 The most common input device is the keyboard of Matching descriptions
which there are two types: alphanumeric and
Match each item in the first list to a description in the
special-function keyboards.
second list.
5 Pointing devices are used to move a pointer or
(1) MICR
cursor on the computer screen, and enable the
control and selection of objects on the display. (2) Braille keyboard
These devices include the mouse, digitising tablet, (3) Joystick
touch-sensitive screen, light pen and others. (4) Barcode reader
6 Scanning devices use laser beams and reflected (5) OMR
light to interpret and convert images, pictures and
(6) OCR
text into digital form.
(7) Smart card
7 Magnetic Ink Character Recognition (MICR) is
used mainly to read cheques whose data is
encoded with magnetic ink. (a) Found on items in the supermarket
8 Optical mark readers (OMR) detect the position of (b) For playing games
black marks on white paper. They are used mainly (c) A card containing a tiny memory chip
in multiple-choice exam marking, and assessing (d) Used to assess multiple choice exams
market research questionnaires.
(e) Used by visually impaired persons
9 Optical character recognition (OCR) senses the
(f) Used to read bank cheques
patterns of reflected light off scanned text via a
photo-electric device and compares it to the (g) Translates text on paper into electronic text on the
patterns in memory. The text is converted and computer
stored in the computer, and can be manipulated
by the user, e.g. in a word processing program. True or False?
10 A barcode is a set of vertical lines of differing 1 RFID must be passed over a scanner. Tq Fq
thickness with a string of numbers printed at the
2 A smart card contains a microchip
bottom; it holds information about a product or
embedded in the card. Tq Fq
item.
3 Digital cameras do not require film. Tq Fq
11 Radio frequency identification (RFID) is the use of
embedded chips and radio waves to identify 4 Biometric devices are less accurate than
individual unique examples of animals, persons passwords. Tq Fq
and objects. 5 Remote controls are now used by
12 Voice recognition system recognises certain computers as a wireless input
patterns of speech and accepts it for processing by communication device. Tq Fq
the computer. 6 OMR is used to read cheques. Tq Fq
13 Video input devices capture images and stores
them in memory.


24.•

rig=
Multiple choice Short answer questions
1 Checking for accurate copying of data is known as: 1 You have been asked to select input devices that
(a) Validation would be used by physically disabled persons in
an organisation. List at least FOUR devices and
(b) Verification
explain the kind of person that would be able to
(c) Source document use the device and why.
(d) Data capture 2 State TWO advantages and TWO disadvantages of
2 Which one of the following is not an advantage of the smart card over the magnetic strip card.
magnetic strip codes? 3 A pharmaceutical research company has decided
(a) They are easy and cheap to produce. to introduce biometric systems for security
(b) The st ri p can store enough information for reasons. Consider TWO alternatives and discuss
simple transactions. the advantages of using biometric systems over
those systems.
(c) The data can be changed, altered, forged or
erased by magnetic fields. 4 List TWO advantages and TWO disadvantages of
voice data entry systems.
(d) Cuts down on paperwork that would
otherwise be involved in a transaction. 5 Explain the difference between voice data entry
and voice recognition systems.
Which of the following is not true about barcodes?
6 List FOUR features of digital cameras that give
(a) They are cheaper than RFID.
them an advantage over regular cameras.
(b) They can be reused again and again.
7 State TWO disadvantages of a digital camera or a
(c) They can become difficult to read if they are digital video camera.
ripped, soiled or removed.
8 Explain how sensors work and list FOUR types of
(d) They must be passed over a reader. sensors.
Sensors can be used to measure all of the 9 What is RFID and how does it work?
following except:
10 List at least FOUR applications of RFID.
(a) Pulse
(b) Temperature
(c) Sound
(d) OMR
OCR:
(a) Detects marks on paper
(b) Detects the unique ridges in a fingerprint
(c) Understands and easily converts handwritten 10

text

(d) Detects the shape of characters


Which of the following is a scanning device?
(a) Optical mark reader
(b) Touch pad
(c) Light pen
(d) Remote control


25 ^•

torage refers to the media and devices used by a computer to keep data
and instructions available for immediate or later use. Storage can be
S grouped into two categories: primary storage and secondary storage.
Primary storage, also called main memory or immediate access store (IMAS)
is a group of chips that resides in the motherboard (main circuit board) of
the computer. The distance the electrical signals have to travel from the
CPU to primary storage or vice versa is much shorter than the distance
i
between the CPU and secondary storage devices, which are connected to the
motherboard via cables. This shorter distance, along with the design of the
chips, allows for faster interchange of data and instructions. This speedy
access is necessary since the CPU can only act on data and instructions held
in primary storage. So for the computer to work fast, the primary storage
must be as quickly accessible as possible.

Primary Storage
Primary storage consists of two types of memory chips: Random Access
Memory (RAM) and Read Only Memory (ROM) chips. A memory chip
is an integrated circuit (IC) made up of millions of transistors and
capacitors.

Random Access Memory (RAM)


A computer uses RAM to hold data and instructions (programs) temporarily
while processing is taking place using that data and program. It also holds
the data that results from processing - data that is waiting to be output or
stored in a secondary storage device. RAM is therefore also called working
memory.
Did you know? Programs and data stored in secondary storage must therefore first be loaded
Did you know that having into RAM before they can be processed. For example, before a letter can be
more RAM may make a typed, or data for a spreadsheet entered, the CPU must first load the
microcomputer operate application programs - such as a word processing or spreadsheet program -
faster and its software into memory. These application programs, and whatever the user inputs
perform better? Most computers using them, are held in RAM until the application is closed or the power is
sold today come with 256 MB or turned off.
512 MB RAM as standard; extra If programs and data are not stored on a secondary storage device they will
RAM can easily be added, be lost when power is turned off. This is because the information in RAM is
expanding the computer's volatile: it is temporary and changeable. The information in RAM can also
capacity to 1 GB or more. be accessed directly and easily, hence the term 'random access'. If the power
is turned off or the computer is rebooted (started up again) all the
information that is held in RAM will be lost. RAM chips are limited in
storage capacity. RAM chips are also expensive and are a major determinant
of the final price of a computer.

• Cache memory
26 % Currently, processors can operate at speeds much greater than memory can
supply the necessary data. In an effort to speed up processing, most
microcomputers have cache memory (pronounced cash). Cache memory
is very fast memory that the processor can access much more quickly than
main memory or RAM. Usually there are two levels of cache, called Ll and
L2. Newer computers have also included a third level called L3 cache. Ll
cache is on the same chip as the microprocessor, while L2 cache is usually
separate. When the microprocessor and motherboard both have L2 caches,
the motherboard cache is designated L3, since it is further away. Cache is
made of high-speed static RAM (SRAM) instead of the slower and cheaper
dynamic RAM (DRAM) chip that is used for main memory.
Generally most programs access the same data or instruction over and over.
By keeping as much of this information as possible in SRAM, the processor
avoids accessing the slower DRAM. Cache memory works by attempting to
predict which memory the processor is going to need next, loading that
memory before the processor needs it, and saving the results after the
processor is done with it. This speeds up processing.

Read Only Memory (ROM)


ROM chips hold data and instructions necessary for starting up the
computer when it is switched on. It is commonly used to store system-level
programs such as the BIOS (Basic Input/Output System) program. ROM
chips may also hold translators for high-level languages and operating
systems.
These instructions are fixed at the time of manufacture and are sometimes
described as being'hard-wired'. This ensures that the instructions stored in
ROM are always there, whether the power is on or not. ROM is therefore
non-volatile: it cannot be easily changed, because it is 'read-only'. This is
necessary since when the computer is first turned on, the system memory is
empty and needs the instructions stored in ROM for the PC to boot up. ROM
is also sometimes found in some input and output devices, such as scanners
and printers.
ROM cannot easily be modified and therefore provides a measure of
security against accidental or malicious changes to its contents. Users of a
system cannot infect ROM chips with a virus. Variations of ROM chips
namely PROM and EPROM, allowing some flexibility in storing data and
instructions, are also available.
• Programmable ROM (PROM): This is a type of ROM that can be r
programmed using special equipment; it can be written to, but only
once. This is useful for companies that want to make their own ROMs
from software they write themselves: when they change their code they
can create new PROMS without requiring a whole ROM manufacturing
plant.
• Erasable Programmable ROM (EPROM): An EPROM is a ROM that
can be erased and reprogrammed, which can make it more useful than
an ordinary PROM, although EPROM chips do not last as long. This is
done by exposing the chip to ultraviolet light of a specific frequency for a
specified period of time. Reprogramming may become necessary if there
Figure 3.1
are updates to the current data or instructions that are held in EPROM.
RAM and ROM chips
• Electrically Erasable PROM (EEPROM): This is a special type of ROM
chip that can be erased and reprogrammed repeatedly by a user. A chip is
erased by exposing it to an electrical charge, which erases the entire chip.
Unlike EPROM chips, EEPROM chips do not have to be removed from the
computer to be reprogrammed. EEPROM is non-volatile and can be used
to hold data and instructions which need to be updated regularly. Flash
memory is a type of EEPROM and is also used in a number of electronic
devices such as CompactFlash cards known as 'electronic film' for digital 27 %
cameras, memory cards and video game systems.
••

Units of storage/
The memories of all digital computers are two-state (bi-stable) devices. This
means the components can be set to one of two states. On a disk or tape it is
a magnetised spot or an unmagnetised spot. In a chip it is the presence or
absence of an electrical charge, and in the case of optical disks, it is the
presence or absence of the reflection when a laser beam hits the surface of
the disk. The two states of all these devices are represented by the binary
numbers 0 and 1 and are called a bit. A bit is the smallest unit of storage in a
computer.
The amount of data and instructions that can be stored in the memory of a
y
computer or secondary storage medium is measured in bytes. A b te is
made up of a combination of eight bits and has the storage power to
represent one character. A character can be a letter, a number, a symbol, a
punctuation mark or a blank space. A word is the amount of bits the
computer can process in one operation. Word length is the number of bits
in a word.

Name Symbol Binary Decimal Number of bytes Equal to


measurement measurement

kilobyte KB 210 103 1 024 1024 bytes

megabyte MB 220 106 1 048 576 1024 KB

gigabyte GB 230 109 1 073 741 824 1024 MB

terabyte TB 240 1012 1 099 511 627 776 1024 GB

petabyte PB 250 1015 1 125 899 906 842 624 1024 TB

exabyte EB 260 1018 1 152 921 504 606 846 976 1024 PB

zettabyte ZB 270 1021 1 180 591 620 717 411 303 424 1024 EB

yottabyte YB 280 1024 1 208 925 819 614 629 174 706 176 1024 ZB
x
Table I Larger units of storage

Secondary storage devices


Secondary storage, also called auxiliary or backup storage, is used to store
data and instructions when they are not being processed. Secondary storage
is more permanent than main memory, since data and instructions are
retained when the power is turned off. Secondary storage is also much
cheaper than primary storage and is unlimited - you can have as much of it
as you can afford.
A computer for home use will not need as much secondary storage as a
computer used in a large organisation such as a bank, hospital or an
insurance company. Because of this diverse range of storage needs, a
number of secondary storage devices are available. Devices are chosen for a
particular use based on their:
• Storage capacity (how much data the device can store)
• Access speed (the time needed to locate the data and transmit it to
the CPU)
• Size (necessary for storage on shelves or portability)
• Portability (ability to be easily removed and used on another system)
• Cost.
nom.
The most commonly used secondary storage devices are magnetic storage
( magnetic tapes and magnetic disks), optical storage (CD-ROM, CD-R, CD- Summary characteristics
RW, DVD-ROM, DVD-R and DVD-RW) and solid state memory (flash
of magnetic tapes
memory and USB drives).
• Provide sequential access
to data stored
Magnetic tapes • Easy to transport and store
• Cheaper than disk
Magnetic tape is a ribbon of plastic material coated with a metal oxide film
• Mostly used for backups or
on which data is recorded as magnetised or unmagnetised spots. The
archives (tertiary storage)
magnetic orientations of the magnetised and unmagnetised spots represent
• Limited shelf-life (2 years)
the binary digits 0 and 1. On mainframe computers the tape is stored on
• Must be stored in a suitable
reels or cartridges. In microcomputers tapes are stored in cartridges similar
environment (smoke, dust,
to those used to store music, but of a much higher quality. Just like the tape
temperature and humidity
in a tape recorder, data can be written to, or read from, the tape as it passes
must be carefully
the magnetic heads.
controlled)
Magnetic tape is not suitable for data files that are revised or updated often • Difficult to update files
because it stores data sequentially. This means that data is retrieved in the (cannot make changes to a
order in which it was stored. Therefore accessing data is very slow as you record without writing
cannot go directly to an item of data on the tape. It is necessary to start at over the entire tape)
the beginning of the tape and search for the data as the tape goes past the
heads.
However, magnetic tapes are erasable, reusable and moderately durable,
and are made to store large quantities of data inexpensively. For these
reasons they are mainly used for emergency backup purposes.

Magnetic disks
Magnetic disks are one of the most widely used secondary storage media for
computers. All magnetic disks provide direct access to data stored. This
means that you can go directly to a specific piece of data without having to
access any other data either before or after the data you want. The capacity
and access speeds of magnetic disks vary with each device or medium.
Magnetic disks include floppy disks (diskettes) and hard disks.

Floppy disks (diskettes)


A 3.5-inch diskette or floppy disk is a removable, flexible plastic disk coated
with a magnetisable material. The disk is contained in a hard plastic case to
protect it from dust and grease. (The term floppy' refers back to the 5.25- Figure 3.2
A floovv disk
inch diskettes that were used in the 1980s, and were actually soft r
flexible. These are not used any more.)
Each disk surface contains a set of numbered concentric rings knc
i racks. The tracks are also divided into wedge shaped (pizza slice)
pieces known as sectors, which themselves are numbered. A sect
the amount of data that can be read from or written to a disk by th,
computer in one read/write operation. Data is stored as magnetise
spots on the tracks.
Before a disk can be used to store data, it must be formatted.
Formatting a disk means writing electronic information on the dis
so that the computer can recognise the disk as a valid storage
device and data can be stored. The formatting process sets up a
method of assigning addresses to the different areas. It also sets
up an area for keeping the list of addresses. Without formatting
there would be no way to know what data is where. When a
disk is formatted the following happens:
1 All data in the disk is erased.
Track 00 2 The surfaces of the disk are checked for any physical and
Sectors
(outer track) magnetic defects.
Track 01 3 A file allocation table (FAT) is created to record where data
is stored.
Track 02
Floppy disks are useful for transferring data between
computers and for keeping a backup of small files. They are
relatively slow to access because of their rotation speeds.
Floppy disks hold 1.44 MB of information. This is plenty of
space for most text documents (Word and Excel files), but for
files containing graphics, a floppy's capacity may be
insufficient.
Innermost track
has highest number Although generally PCs come with floppy drives, these are
being replaced by CD drives, especially in most laptops.
Figure 3.3 However, an external floppy drive can easily be attached via any of the USB
How data is laid out on a disk ports available in modern computers. The present 3.5-inch floppy disk, like
its predecessor, will nevertheless soon become obsolete as smaller devices
with higher storage capacities become available.

Care of floppy disks


Summary characteristics Taking care of your disks and handling them in the right way can prevent
of floppy disks your data from being lost. Here are some simple precautions to protect the
• Provide direct access to data on your disk:
data stored • Keep your disks away from liquids, dampness, dust and dirt.
• Small and very portable • Do not bend disks or handle them roughly.
(e.g. files can be • Do not touch exposed portions of a disk.
transported from one • Take care when inserting or removing a disk from a computer's disk
computer to another) drive.
• Suitable for backing up • Keep your disks in a disk box, not loose in your pocket or inside a book.
small files • Do not leave the disk in the drive. If you do the read/write head remains
• Data security (e.g. you can resting on the disk surface.
store small files that you
don't want other computer Hard disks
users to see)
• Easy to store Hard disks as the name implies are thin but rigid, inflexible disks made of
• Limited shelf-life (2 years) highly polished metal. The surface of each side of a disk (also called platters)
is covered with a substance that can be magnetised, thereby allowing data to
be stored on both sides as magnetised or unmagnetised spots.
The disks constantly rotate at a high speed and may have one read/write
Figure 3.4 head per disk (moveable head) or, on more expensive disks, every track in
The inside of a hard disk
each disk may have its own read/write head (fixed head).
The combination of the disk, read/write head and the
circuitry that goes with these is called the hard disk drive.
The access time (time to get data) from a spinning disk with
one read/write head is a combination of:
• Seek time - how long it takes the head to get to the right
track;
• Rotational delay or latency time - how long it takes for the
data to rotate under the head; and
• Transmission time - the time taken to read the data and
transmit it to the CPU.
For fixed-head disk drives, where each track has a
read/write head, the time taken to access data and
instructions is reduced, as the seek time is eliminated.
Hard disks are much slower than internal memory. Tb
increase the speed at which data is written to and read
from a hard disk, a cache, also often called a buffer, is
included in most modern hard drives. The purpose of
this cache is similar to other caches used in the PC,
even though it is not normally thought of as LI, L2 or
Track
L3 cache. For hard disks, the cache is used to hold the
results of recent reads from the disk, and also to
'predict' and hold data that is likely to be requested in
the near future, for example, the data immediately
after the one just requested. The use of cache Cylinder
i mproves performance of any hard disk, by reducing
the number of physical accesses to the disk on
repeated reads.
Like floppy disks, a hard disk must also be formatted
before any data can be stored on it. Formatting sets up
the tracks, sectors and cylinders. A cylinder is made
up of all the tracks of the same number from all the
metal disks that make up the hard disk, which can be
Figure 3.5
read or written to at the same time. For example, if you Cross-section of a hard
start from the bottom of a stack of disks, track 5 of the disk to show how it/s
second disk will be directly above track 5 of the first disk. Track 5 of the third disk will arranged and divided
he directly above track 5 of the fi rst and second disks and so on. If you put these all into tracks, sectors and
together on top of each other, you'd have something that looks like a tin can with no top cylinders
or bottom - a cylinder.
The computer keeps track of what it has put where on a disk by recording the addresses
of all the sectors used - a combination of the cylinder, track and sector numbers. Data is
written down the disks on the same cylinder. This works quickly because each metal
platter has a read/write head for each side and they all move together. So for one
position of the read/write heads, the computer can put some data on all the platters.
Almost all PCs come with a hard drive that is housed inside the system unit and
attached to the motherboard by a special cable. These hard drives are not removable
and vary in storage capacity from around 20 GB to 120 GB and more. The hard drive
usually stores applications software (word processor, database, spreadsheet, etc.) and
the operating system. It is much faster than floppy disks because it rotates at a much
faster speed.
Two additional types of hard drives that can be used with a PC are external hard drives
and removable disk.
• External hard d ri ve: An external hard drive can be used if there is no space in the
system unit to house another hard d ri ve. It may come with its own power source
and is connected to the system unit via a special cable. External hard drives can be
easily removed and connected to another computer, thereby giving them a certain
amount of portability and flexibility of use.
Examples of a removable hard disk are the Maxtor one touch 300 GB, Western
Digital Dual Option 250 GB and the Seagate 200 GB models.
For Olarger computer systems hard disks consist mainly of removable hard disk packs,
fixed disk drives and RAID storage systems.
• Removable hard disk pack: A removable hard disk pack may contain between 6 and 20
hard disks aligned one above the other in a sealed unit. The storage capacity is
usually very large, in the terabyte range.
• Fixed disk dri ves: These are similar to those found in PCs. They have a high storage
capacity and are more reliable than removable hard disks. A mainframe computer
may have between 20 and 100 fixed disks housed in a single cabinet. Data is
transmitted to the CPU using a single data path. •
31 ^•

• RAID storage system: RAID stands for Redundant
Array of Independent Disk. A RAID storage system
consists of a cabinet which may contain a large
number of disk drives (up to 100). Besides holding
4 more data than a fixed disk, it stores multiple copies
of data on different drives. If one drive fails, others
can take over allowing the data to be recovered. Data
is transmitted to the CPU using multiple data paths.
Figure 3.6
RAID cabinet Optical disks
Optical disks are disks that are read by laser lights. The disk is made mainly
of a type of plastic (polycarbonate). The data is stored on a layer inside the
plastic. A metal coating (usually aluminium) reflects the laser light back to a
Summary characteristics sensor. The main types of optical disks are CDs and DVDs.
of hard disks
• Direct access CD-ROM (compact disk)
• Fast data transfer speeds
CD-ROM stands for Compact Disc-Read Only Memory. This means that you
• Vast storage capacity
can only read (access) what is on the disk, but you cannot add or change
anything. The data is encoded and read optically with a low intensity laser
light. The data is represented as a series of pits and lands. A pit is a little
depression formed by the laser burning into the data layer when the CD is
created. The land is the part between the pits or the smooth surface.
Reading a CD is done by shining a laser light at the disk and detecting
changing reflecting patterns. When the laser beam reflects off the smooth
surface (land) it is interpreted as a 1 bit. When the laser enters a pit there is
Figure 3.7 no reflection, which is interpreted as a 0 bit.
Compact disk
The speed at which the data is accessed depends on how fast the disk spins.
The faster the disk spins, the faster the data can be transferred to the
computer's memory. The speed of a CD-ROM drive is indicated by a number
followed by an 'X'. Typical CD-ROM drive speeds are 48X, 50X, etc. The
higher the number the faster the disk spins, resulting in faster data access.
Because of their large storage capacity (up to 750 MB), CD-ROMs are used to
store software packages for sale or distribution. They are particularly useful
for storing multimedia (text, graphics, sound and videos) and application
software packages such as encyclopedias, word processors, training
programs, games and graphics packages.

CD-R
CD-R stands for Compact Disc-Recordable. This disk allows you to write
data onto the disk once only using a CD recorder (burner). The disk then
becomes CD-ROM as the contents cannot be changed. It is ideal for storing
large volumes of data that does not need to change. A typical use is to create
music CDs. The storage capacity of CD-R, like all CDs, is around 750 to 800
MB maximum.

CD-RW
CD-RW (Compact Disc-Re-Writable) is now a very common choice for
backup storage. The data layer of these disks uses a phase-changing metal
alloy film. By using a higher intensity laser light the film can be melted to
level out the marks made by the laser burner when the data was stored,
effectively erasing previously stored data. New data can then be recorded
using a lower intensity laser light to burn the new data. In theory you can
erase and write on these disks as many as 1000 times. It therefore makes it
32 % an ideal backup storage device for storing large volumes of data that change
•• frequently.
DVD disks
DVD stands for Digital Versatile Disk. The main types are DVD-ROM (read Summary characteristics
only), DVD-R (recordable) and DVD-RW (rewritable). They look similar to a of optical disks
CD-R disk but are capable of holding much more information. This is • Much sturdier and more
possible because: durable than tapes or
• The tracks on a DVD are placed closer together as compared to a CD, floppy disks
thus allowing more tracks. • Not usually sensitive to
• The pits in which data is stored are much smaller in a DVD than a CD. being casually touched,
This means many more pits will fit on the disk, allowing more though they too can get
information to be stored. dirty or scratched. Despite
• Some DVDs are double-sided. This allows data to be stored on both sides this they can be cleaned
and therefore dramatically increases the disk's capacity. easily with a soft cloth
A typical DVD disk can hold between 4.7 GB and 17 GB of information. They • Unaffected by magnetic
are used mainly for storing movies. The quality of sound and video output is fields
much superior to video tapes. • Hold much more data than
floppy disks
Care of optical disks • Provide direct access to
data stored
CDs and DVDs are not indestructible, as they were made out to be when
they first became popular. Although they are more reliable than diskettes,
CDs must be handled with care otherwise data maybe lost. Data loss results
from: Did you know?
• Physical damage (breaking, melting, scratching, etc.) Did you know that many
• Blocking of laser light by dirt, paint, ink and glue computers have a single
• Corrosion of the reflecting layer. drive to read and write
The following are some guidelines for the proper handling of CDs and
to CD-R, CD-RW, DVD-R
and DVD-RW?
DVDs.

1 CDs and DVDs should be stored in their cases when not in use to
prevent them from being scratched or getting dirty.
2 Avoid soiling the surface of a CD - hold it by the edge or centre hole.
3 Keep your CDs clean by gently wiping both sides with a clean damp
cloth from the centre to the outer edge, not by wiping around the
disk. Wiping in a circle can create a curved scratch, which can
confuse the laser. For stubborn dirt, use isopropyl alcohol or
methanol, or CD/DVD cleaning detergent.
4 Do not write on the top side of the CD with a ballpoint pen or other
hard object as this can damage the data layer on the other side. Use a
CD marker instead.
5 Don't write on the top side with a fine-point marker or with any
solvent-based marker. (Solvent may dissolve the protective layer.)
6 Do not expose a CD to high temperature or humidity for an
extended period of time, as the CD may warp.

Other storage media


The modern computing industry is continually developing new products to
assist the computer user.

Flash memory
Flash memory technology is based on EEPROM (Electrically Erasable 0
Programmable Read Only Memory) technology. Like EEPROM, flash 33.E
0
memory is non-volatile. However, reading from and writing to flash memory
is a lot faster than with EEPROM. This is because data in flash memory can
Summary characteristics
be erased a block at a time instead of only a single byte at a time as is the
of flash memory case with EEPROM. Flash memory got its name because a block of memory
• Physically very small
cells is erased in a single action or'flash'.
• Highly portable
• High data capacity, The compact nature of flash memory enables it to be incorporated into very
ranging from 16 MB to 2 small solid state (no moving parts) devices that are available in all shapes
GB, and even more and forms. These devices are rapidly becoming an integral part of modern
• High data transfer speed to living. Flash memory is particularly well known today because of the
the device they are part of popular flash memory cards used in digital still cameras. These include
or attached to (camera, PC, CompactFlash (CF), SmartMedia (SM), MultiMediaCard (MMC), Secure
etc) Digital (SD), Memory Stick (MS) and xD Picture cards.
• Large storage capacity
compared to diskettes

Figure 3.8
Different types of flash
memory cards
For example, the Sony Memory Stick is an extremely versatile storage card
for digital images, music MP3 and more. This type of flash memory comes
in the form of a card shaped like a stick of chewing gum, with dimensions of
21.5 X 50 X 2.8 mm and a storage capacity up to 2 GB. The Memory Stick
weighs just 4 g and has a data-protection tag feature on the reverse which
enables users to protect data written on the flash memory.
Flash memory is also used in many electronic devices including PCs, cell
phones, PDAs, cable TV set-top boxes and video game consoles.

USB drive
Summary characteristics This new type of flash memory storage device does not yet have a generally
of USB drives accepted name. Each company calls it something different, including flash
• Easy to use drive, flash pen, thumb drive, key drive and mini-USB drive. They often
• Convenient (small size - double as MP3 players, i.e. you can download music to them from your PC,
can be placed in a pocket plug in some headphones and listen to your favourite songs.
or on a key chain)
• Large storage capacity
compared to diskettes
• Highly compatible -'plug
and play' (no software
needed)
• Fast access
• Password protection
• Disk write protection
switch (prevents data from
being accidentally written
over)

0
Figure 3.9
34 ^0 USB drive

All are small, about the size of your thumb or a large car key, and plug into a
USB po rt on the computer. No additional software is needed for Windows XP,
2000 or ME. Plug it in and the computer notices that a new hard drive has
been added, and will show it on your desktop.
These small flash dri ves can have storage capacities from 8 MB to 1 GB or
more! Some flash drives include a password protection facili ty an d the
ability to run software directly off the USB drive.

Storage Storage Advantages Disadvantages


device capacity

Magnetic Usually • Easy to transpo rt and store • Provides sequential access to data stored
tape 2-8 GB • Cheap • Limited shelf-life (2 years)
• Mostly used for backups or • Must be stored in a suitable environment
archives (smoke, dust, temperature and humidi ty
must be carefully controlled)
• Difficult to update files (cannot make
changes to a record without writing over
the entire tape)
Magnetic 1.44 MB • Provides direct access to data • Small storage capacity (unsuitable for
disk stored storing files containing graphics)
• Small and ve ry portable • Limited shelf-life (2 years)
• Easy to store • Slow read/write speeds
• Suitable for backing up
small files
• Data security (e.g. you can store
small files that you don't want
other computer users to see)
Fixed hard 40-120 GB • - Direct access • Not portable
disks •/^ Fast data transfer speeds
• Vast storage capaci ty

Removable Up to 2 GB • Dire ct access • Computer must have a USB port


hard disks • Fast data transfer speeds
(Maxtor one • Vast storage capaci ty compare d
touch 300 to diske ttes
GB, Western • Portable
Digital Dual•
Option
250 GB and
the Seagate
200 GB)
Optical CD - up to . • Direct access • Data on CD-ROMs cannot be changed
disks 800 MB • Fast data transfer speeds • Access times are slower than hard drives
DVD - up • Vast storage capacity compared • DVDs are still not widely used for storage
to 17 GB to diskettes because they have not been around very
• Portable long.
• Can be cleaned easily with a soft
cloth
• Unaffected by magnetic fields

Table 2 Advantages and disadvantages of seconda ry storage devices


••
Questions 8 Magnetic tape is used to:
(a) Hold data necessary for starting up the
computer
Multiple choice
(b) Back up large amounts of data
Choose the most appropriate answer for each (c) Hold data that the computer is processing at
question. the time
1 The acronym ROM stands for: (d) None of the above
(a) Random Only Memory
(b) Read Only Memory True or False ?
(c) Read Optical Module 1 A 3.5-inch diskette is capable of holding
(d) Random Organising Memory a large amount of graphical data. Tq Fq
2 Which device holds data and instructions when it 2 Primary storage consists of RAM and
is not in use? ROM chips. Tq Fq

[1 ] TIiffi SIOf f A II1 I1 O 1 10 1i1 11n liE d II 1[ V^


(b) System unit concentric circles called tracks. Tq Fq
(c) Monitor 4 RAM chips hold data permanently. Tq Fq
(d) Secondary storage 5 The user inputs data and instructions
3 The smallest unit of storage is a: into a ROM chip. Tq Fq
(a) Byte 6 A byte has the capacity to represent
one character. Tq Fq
(b) Bit
7 EPROM chips cannot be erased. Tq Fq
(c) Megabyte
8 Magnetic tapes allow direct access
(d) Thrabyte
to data stored. Tq Fq
4 Which device has the largest storage capacity? 9 Magnetic tape is difficult to update. Tq Fq
(a) Diskette 10 Floppy disks provide direct access. Tq Fq
(b) CD-ROM 11 Some CD-ROMs can hold more than
(c) DVD 650 MB of data. Tq Fq
(d) Hard disk 12 DVDs are used to store movies. Tq Fq
5 Another name for primary storage is: 13 A USB drive cannot be easily removed
(a) Secondary storage from a system. Tq Fq
(b) I mmediate access storage 14 A digital camera is one device that
(c) Magnetic tape uses flash memory. Tq Fq
(d) Hard disk
6 Where are data and instructions held so that they Fill in the blanks
are available to the CPU for processing? Fill in the blanks with the most appropriate word.
(a) ROM 1 A can hold the code for one
(b) DVD character.
(c) CD-ROM 2A is the smallest unit of storage.
(d) RAM 3 is the data access method used
7 When a disk is formatted, which of the following by magnetic disks.
happens? 4A is about 1 billion bytes.
(a) All data on the disk is erased 5 Magnetic tapes are mainly used for
(b) It becomes damaged
(c) Data files are copied onto the disk 6 Optical disks are read by
(d) It contains files to boot up the computer 7 The concentric circles in a disk are known as

8 The tracks with the same number in each disk in a


disk pack are known as
• 9 All diskettes must be before
38 ^• they can store data.

Short answer questions Crossword
1 Explain the functions of RAM and ROM.
2 Explain with the use of examples the difference
between the terms 'storage device' and 'storage
medium'.
What is the function of secondary storage?
List the criteria used in selecting a secondary
storage device for a particular use.
What kinds of secondary storage devices do large
computer systems use?
Explain, using examples, the terms 'serial access'
and 'direct access'.
Define the following terms: bit, byte, word and
word length.
Define the terms track, sector and cylinder.
Explain what happens to a disk when it is
formatted.
1 D Explain how data is accessed from a disk that has
one read/write head.
1 " Name an application in which a CD-ROM is used
for storing information. Across
State the advantages and disadvantages of using 1 Memory device used in digital cameras and cell
CD-ROMs rather than diskettes. phones (5)
1 i Give one of the main uses of DVDs. 4 Holds data and instructions necessary for starting
14 Explain, giving examples, THREE ways in which up the computer (3)
data maybe lost in an optical disk. 5 Stores movies with high quality sound and video
t r List THREE precautions for the care of optical (3)
disks. 6 This medium only provides serial access (4)
List THREE precautions for the care of floppy 7 A type of storage which holds data on a permanent
disks. basis for later use (9)
17 Give the similarities and differences between each
of the following pairs: Down
(a) RAM and ROM 1 Performing this operation on a disk erases all the
(b) Hard disk and floppy disk information (10)
(c) Hard disk and magnetic tape 2 The number of bits the computer can process in
one operation (4)
(d) Primary storage and secondary storage
3 It contains millions of transistors and capacitors
(4)

39 ^0

r)iitnhit nlpvwi

utput devices are pieces of equipment that are used to get information
or any other response out of a computer. If the output can be read by
O human beings it is said to be human readable. If the output cannot be
understood by humans it is said to be machine readable.

There are two types of output. Soft copy output or temporary output refers
to information displayed on a screen or in audio or voice form through
speakers. This kind of output disappears when the computer is switched off.
When the computer is off neither the screen nor the speakers work, because
they are always linked to and driven by the computer. Then there is hard
copy output or permanent output - this refers to output printed onto paper.

The main output devices you are likely to come across are:

• VDU or monitor • Non-impact printer


• Multimedia projector - thermal
• Voice response - inkjet
• Speech synthesis - laser
• Modem • Plotter
• Impact printer - pen
- dot matrix - inkjet
- daisy wheel - electrostatic
- drum, chain or band • Robot/control system
printer • Microfilm/microfiche

Figure 4.1
i close-up view of
p
er showing pixels

Soft copy
output device, 0
Monitor/visual display unit (VDU)
The visual display unit (VDU) or monitor (also called simply 'the screen') can
output still or moving pictures. The screen is similar in appearance to that of
a television and helps the user to interface visually with the computer.
I mages and text are formed by many tiny dots of coloured light called pixels
(short for picture element). A pixel is the smallest unit on the screen. It can
be turned on or off or coloured in different shades. Pixels are so numerous
that when placed together in certain patterns they appear to form a smooth
image on the screen, be it a character in a word, a diagram or a photograph.

40 .• There are two types of monitors: cathode ray tube (CRT) and flat panel
display.
CRT
The most common type of display is the Al
same as that of the standard television set.
The inside of the screen is coated with
phosphorescent material. An electron beam
(a beam of charged particles) strikes this
surface, exciting the phosphors and causing
them to glow. A colour display has three
different types of particles coating the inner
surface of the screen. Each particle
produces different colours: red, green and
blue (RGB). These colours light the pixels on
the screen. When viewed from a little
distance away, the colours appear to blend,
forming the full range of colours as
required.
Figure 4.2
Flat panel display Cathode ray tube (on the left) and a flat panel monitor
There are two types:
• LCD (liquid crystal display): This display, as the name suggests, uses
Did you know?
liquid crystals which change their appearance when an electric current
is passed through them. It is small, light and flat with no moving parts, Did you know that the CRT
and uses much less power than the CRT display. It is therefore was invented in 1897 by
extensively used on laptop computers. the German scientist
• Plasma display: In this display light is created by a plasma discharge Karl Braun? It was first
from phosphors between two flat panels of glass. used in the cathode ray
oscilloscope, a scientific
instrument used to display data
Characteristics of monitors
about electric currents. Later, it
A monitor's full capabilities depend on several factors: became the basis of television.
1 The graphics/video card or adaptor being used The first successful
transmission of moving
The monitor's size
television images took place in
Its resolution 1925, by the Scottish inventor,
4 Its 'image aspect ratio' John Logie Baird.
5 Its 'refresh rate'
Let us look at these:
• Graphics/video card or adaptor: This is an electronic link between the
computer's processor and the monitor - it is a circuit board that connects
the processor to the monitor. It determines the display resolution, the
number of colours available and the refresh rate of the monitor. Both the
type of monitor and the graphics card determine the resolution. The
adaptor contains VRAM (video RAM memory) that will support a certain
resolution. You cannot set a resolution higher than the adaptor can
support. The more powerful the card is, the more capable the monitor
will be in all these aspects.
• Size: This is the diagonal dimension of the screen. Common sizes
include 15-inch, 17-inch and 19-inch monitors.
• Resolution: Resolution determines the clarity and sharpness of an
image when displayed on the screen. The more pixels there are on a
screen, the higher the resolution, and the greater the level of detail that
can be shown in an image. Some common resolutions are:
- VGA (Video Graphics Array) = 640 X 480 pixels
- SVGA (Super Video Graphics Array) = 800 X 600 pixels
- XGA/XVGA (Extended Graphics Array/Extended Video Graphics

Array) = 1024 X 768 pixels
- SXGA (Super Extended Graphics Array) = 1280 X 1024 pixels 41 %
- UXGA (Ultra Extended Graphics Array) = 1600 X 1200 pixels 40
• Image aspect ratio: This refers to the ratio of width to height of an
image on the screen. Most monitors have a 4:3 width to height ratio.
Notice that all the pixel dimensions shown above can be reduced to this
ratio mathematically.
• Refresh rate: This is the number of times the image is repainted or
refreshed on the screen per second. We get the impression that, for
example, a drawing on our screen is still, but in fact it is being repainted
continuously. If this process is slow, the screen may appear to flicker.
• The refresh rate is measured in hertz (cycles per second), e.g. 150
hertz (Hz) means the screen is refreshed 150 times a second.
- • The faster the refresh rate the less noticeable the flickering on the
screen.
• The higher the resolution the more lines need to be scanned across
the screen, or repainted per second.

Other visual output devices

Multimedia projector
This device is used to create and deliver dynamic multimedia
presentations (presentations in which sound, photos, video, text and other
moving graphics may be combined to interesting effect). There are two
types of multimedia projectors: LCD projector and LCD panel.
The LCI) projector has its own built-in lenses and light source and
connects directly to computer, television, video/DVD player and video
camcorder. Images from these devices are projected through the LCD
projector onto a screen or wall. Versions of the LCD projector now come
with a digital video camera on an arm extension attached to it. This video
camera allows real-time videos and pictures to be instantly projected
through the LCD projector onto a screen. For example, the camera can be
directed at a page in a book or at someone performing a demonstration; the
video camera image is projected through the LCD projector onto a screen or
wall.
The LCD panel is used with a normal overhead projector (OHP). This panel
is the size of a notebook and is placed directly on the surface of the OHP.
Like the LCD projector, the panel can be connected to devices such as
computer, television, video/DVD player and video camcorder. The image
displayed on the panel is projected onto a screen when the light of the OHP
shines through it.

Sound output
Sound output is another form of soft copy' output: it isn't permanent, as
printing would be. Some of the devices involved are as follows:

Speakers
A simple speaker will make a range of sounds available to the computer
user. Computer-generated sound, music output, computer-synthesised voice
and the normal speaking voice are now conventional output using a
speaker. Sound cards need to be installed in microcomputers to obtain good
sound quality for music or games.

42 %

Voice response systems
The voice response system selects from a set of digitised prerecorded words,
phrases, music, alarms or other sounds stored on disk. The system
combines these prerecorded words into responses based on selections made
by the user. For example, many phone banking systems use voice response
systems. Based on the information given to them when a caller selects
1 you knr
options on their telephone keypad, the bank computer outputs voice
information to the caller. The sounds must be converted from digital format Did you know that
back to analogue before being output to the speaker. speech synthesis can
now be demonstrated
on the Internet?
Speech synthesis
Connectto the World Wide Web
This system converts written text into computer generated speech ('text to and see what speech synthesis
speech'). It is used for computer-aided conversations by hearing- and web sites you can find.
speech-impaired persons, or for converting conversations/text from one
language into another.

The modem
A modern (short for modulator/demodulator) is a communication device
that sends and receives data. Therefore it is both an input and an output
device. It is used to convert digital data from the computer into analogue
data that can be transmitted over the telephone line. When the data gets to
the other end, another modem converts the analogue data back into digital
data so that the computer at that end can process it. A modem is an
extremely common device, often built into the computer. For example, it is
used to read data from, and transmit data to, the Internet.

1 Copy and fill in the blanks using A to E below. 2 Copy and fill in the • •
(1) = resolution blanks:

(2) = pixel Temporary output is also known as


output. Monitors are
(3) = refresh rate
temporary output devices;
(4) = speech synthesis and are the two types of
(5) = voice response systems monitors. The most common is the
A The smallest unit on the screen The electronic link
between the processor and the monitor is
B Converts written text into computer
Three characteristics
generated speech
that affect the capabilities of monitors are
C Selects and plays back prerecorded sounds and
D Measured in hertz
E The clarity or sharpness of an image

Hard copy output devices


You can print out information that is in the computer onto paper or film. By
printing you create what is known as a 'hard copy'. It is tangible - you can 0
hold it in your hands.
43.0
^•
Printers
Printers are used to present and store all kinds of information on paper, such
as letters, legal documents, scientific data and graphs, photographs and
advertising material. There are really no limits to the amount and type of
information that can be printed on paper - just take a look at the paper-
based material around you, in your classroom or in your home.
There are therefore many different kinds of printers, which vary in their
speed and print quality, depending on the desired print output. One way of
classifying printers is as:
• Character p ri nters: These print one character at a time much like a
typewriter. They are slow.
• Line printers: These are much faster; they print a line at a time, or so it
appears as multiple hammer-like keys forming a line of text hit the page
at one time. They are used with mainframe computers where high speed
is vital for the large volume of printed output required. They print a
limited number of characters and do not print graphics.
^• Page printers: These print a whole page •at a time. They are therefore
even faster and deal with very large volumes of printed output.

The print quality will vary depending on the type of printer, and also the
instructions you send to the printer as to the quality you require. For
example, in a standard household or office printer, there is letter quality,
near letter quality (NLQ), draft quality printing and photo quality.

Another more common way of classifying printers is as impact printers


and non-impact printers. We will now look at these printers in detail.

I mpact printers
The print head of an impact printer contains a number of metal hammers
which strike an inked ribbon placed between the print head and the paper.
These hammers may contain complete characters; alternatively, they may

0 contain dots' that are used to build up a character. The main types of impact
printer are:
• Dot matrix printer
• Daisy wheel printer
• Drum, chain or band printer.

Dot matrix printers (character printers)


4 ' 0 Characteristics of these printers include:
• Characters are formed from a matrix of dots.
o• • • • The speed is usually 30-550 characters per second (cps).
• This is the noisiest of the printer family.
• These printers are relatively fast.
• The print obtained is usually poor. They are useful for low-quality carbon
Figure 4.4 copy printing of text, or printing text on continuous sheets of paper.
Example of how a matrix printer • They are not good for printing shaded graphics or photographs.
constructs a character
Daisy wheel printers (character printers)
Characteristics of these printers include:
• Moulded metal characters similar to typewriter keys are mounted on
extension arms attached to a rotating wheel. Prints are made by a
hammer-like action of the keys hitting the print ribbon.
• The process involves a lot of moving mechanical parts and is very noisy.
•• • Printing is slow (less than 90 cps).
44
•••
• Printouts are similar to that produced by an electric typewriter.
• The text is generally crisp and clean - letter quality print.
• The size and font produced can only be changed by using a different
wheel, as the characters on the wheel are fixed.

This printer is not used much any more: it is becoming obsolete, as laser
printers are able to produce the same quality print as the daisy wheel
printers and are much more versatile.

Drum, chain or band printer (line printers)


These are line printers which contain characters on a drum, chain or band
that rotates at constant speed; the keys strike the page as the required
characters pass the print position. Characters do not get printed one at a
ti me from left to right. Instead they are printed in the order in which they
pass the head. They are high speed - 2500 lines per minute - and are used to
print large volume of information.

Non - i mpact printers


The print head of a non-impact printer does not strike the paper, so they are
much quieter than impact printers. Most non-impact printers produce dot
matrix patterns. Several technologies are now available and have been used
to produce a variety of printers. The main types of non-impact printer are:
• Thermal printer
• Laser printer
• Ink jet printer.

Thermal printers (character printers)


There are two types of thermal printers.
• Direct thermal printer: This printer uses heated elements/pins to form the
characters. These elements/pins come into contact with special heat-
sensitive paper to form darkened dots where the elements have reached
a critical temperature, thus shaping the characters. The pins actually
burn the dots into the specially coated paper. Exposure to sunlight and
heat tends to darken the thermal printer paper, which also tends to
darken over time even at room temperature; the print quality produced
by thermal printers is therefore poor.
• Thermal wax transfer printer: The print head of this printer melts a wax-
based ink from a transfer ribbon onto the paper. This printer does not
require special paper.
Thermal printers are widely used in battery-powered equipment such as
portable calculators, fax machines and some ATMs (automated teller
machines).

Laser printers (page printers)


Did you know?
Laser printers use a process similar to that of a photocopying machine, and
Did you know that the
are very common in the modern office. A laser beam and dry powdered ink
fastest black-and-white
called toner produces a very fine dot matrix pattern. This pattern is
laser printers can
transferred to the page and then fused onto it by heat and pressure. These
produce around 40 fully
printers can generate a large number of pages per minute depending on the
printed pages per minute? The
specification and quality of the printer.
fastest colour laser printers are
Colour laser printers use four different colour toners and work by printing only slightly slower, producing
four times - once with cyan toner, then with magenta toner, then yellow and around 30 pages per minute.
then with black. The mix of these colours can produce all other colours, and S
the output quality is very good. 45 S0
0
r-

4,

arl L

Figure 4.5
Laser printer

Figure 4.6
Inkjet printer

Compared to black-and-white laser printers, colour laser printers are a lot


more expensive, sometimes thousands of dollars more than the black-and-
white ones.

lnkjet printers (line printers)


Inkjet printers produce an image by spraying ink onto the paper in a dot
matrix pattern. Colour graphics can be produced by spraying cyan,
magenta, yellow and black ink onto the page. Inkjet printers can print in
both colour and black-and-white. They are very common for home use and
the print quality is good, even very good, but not as good as laser printers. A
typical printer of this type may cost around US$ 100, though the cost of
continuously replacing ink should also be borne in mind.

Characteristics of non-impact printers


• Much quieter - useful in hospitals, busy offices, etc.
• Much faster printing speeds
• Sometimes require special paper
• Do not have multiple-copy facilities, that is they cannot produce
multiple copies by printing on duplicating paper

Characteristics of impact printers


• Noisy
• Can produce multiple copies by printing on duplicating paper
• Used in many businesses

One other type of printer worth mentioning is the Braille printer. This is an
• impact printer which converts text into the Braille code, producing patterns
46 of raised dots on paper for use by the blind.
•••
a
Plotters
A plotter is a peripheral used to draw
high quality, high resolution graphics,
charts, graphs, maps and vectors or co-
ordinate graphics on large sheets of
paper.
• Plotters are slow, but can draw
continuous lines often in a variety of
Li
colours.
• They are useful for producing
architectural drawings, building
plans, maps and CAD (computer
aided design) drawings, where
precision is required.
• The paper is sometimes laid on a flat
bed (flat-bed plotter) or on a rotating
drum (drum plotter).
There are three main types of plotters:
pen plotters, inkjet plotters and
electrostatic plotters.
• Pen plotters use a mechanical arm or
rail that holds a pen which can be
moved across the page.
• Inkjet plotters work in the same way
as inkjet printers by spraying ink onto
the paper.
• Electrostatic plotters work in the
same way as laser printers.

COM (computer output on microfilm/microfiche)


COM is a method that is used to store computer documents by reducing
them in size to fit on very small photographic prints. They are therefore a
physical output like printing, and are used to store large volumes of data.
These prints can be read using a special magnifying machine. Microfilm is
a roll of film and microfiche is a rectangular sheet of film on which many
frames/pages of information can be stored.

Robot and control systems


Computer processors can send signals to a robotic hardware device to
produce a physical action. This is another type of output, therefore. Robotics
is very common in the manufacture of high-tech goods such as cars,
television sets and so on, in a complex factory production line process.
Control systems use sensors to measure physical quantities. Sensors send
input to the processor of the controlling computer, which responds by
sending an output signal to activate an item of hardware. An example sensor
would be a smoke detector; once smoke is detected it can send a signal to
the sprinklers in a building or to an alarm in a fire station.


47:•

Summary Questions
1 Output devices are pieces of equipment that are
used to get information or any other response out Crossword
of a computer.
2 Output can be human readable or machine
readable.
3 Soft copy or temporary output disappears when
the computer is switched off.
4 Hard copy or permanent output refers to output
printed onto paper, microfiche or microfilm.
5 Monitors or VDUs are soft copy output devices.
Types include CRT, LCD and plasma.
6 A pixel is the smallest unit on the screen that can
be turned on or off or coloured in different shades.
7 A monitor's performance depends on the
graphics/video card or adaptor, its size, resolution,
image aspect ratio and refresh rate.
8 Sound is soft copy output. Computer-synthesised
voice, computer-generated sound, music output
and the speaking voice are output using a speaker.
9 Modems are both input and output devices, and
are used to communicate information over a
telephone line, e.g. to and from the Internet.
10 Printers are hard copy output devices and can be Across
classified as character, line and page printers. 3 Sound output (7)
11 Printers can be divided into two broad categories: 5 The print head of this printer strikes the paper (6)
impact printers and non-impact printers.
7 Clarity of an image (10)
12 I mpact printers include dot matrix, daisy wheel
and drum/chain/band printers. Down
13 Non-impact printers include thermal, laser and
1 Sprays ink onto paper in a dot matrix pattern (6)
inkjet printers.
2 Permanent output (2 words) (8)
14 A plotter is used, e.g. in CAD, to draw high quality
graphics, charts, graphs, maps and vectors or co- 4 Specialised output device used to produce
architectural drawings (7)
ordinate graphics on large sheets of paper.
15 Computer output on microfilm/microfiche (COM) 6 Smallest unit on the screen (5)
is hard copy output used to store computer
documents by vastly reducing them in size to fit
on photographic prints.


.•
48

Multiple choice 7 Describe how a robotic arm can be used in an
assembly line.
A monitor's capabilities depend on all except:
8 You are a consultant to a small business that types
(a) Resolution
documents and creates presentations for
(b) Size individuals. Select a suitable printer and explain to
(c) Refresh rate your client why you have chosen that printer for
(d) Print quality their business.

2 NQL refers to: 9 List TWO attributes of a monitor that affect its
display and explain how the monitor is affected.
(a) Refresh rate
10 There are two types of flat screen monitors, LCD
(b) The number of characters per second
and plasma. Explain the difference between the
(c) Print quality two.
(d) Type of monitor 11 State what you would use to print the following
3 All the following are non-impact printers except: documents: printer or plotter.
(a) Chain (a) A resume
(b) Thermal (b) A prenuptial agreement contract
(c) Inkjet (c) A design for a new gown
(d) Laser (d) A recipe
4 Which is not a characteristic ofJaser printers? (e) The redesign of a bathroom
(a) They are quiet (f) A map to get from the centre of the town to
(b) They have high print speeds your home

(c) Use toner similar to that found in


photocopiers
(d) Can produce multiple copies by printing on
duplicating paper
5 Microfilm output is stored on:
(a) Rectangular sheet of film
(b) Photographic paper
(c) Magnetic paper
(d) A roll of film

Short answer questions


1 Give TWO advantages and TWO disadvantages of a
non-impact printer over an impact printer.
2 Explain the difference between a line printer and
a character printer.
3 Explain the difference between microfilm and
microfiche.
4 A number of output devices are used to assist the
physically challenged person. Select TWO and
explain how these devices work towards making
things easier for the physically challenged.
5 Give ONE advantage of output on microfilm over
that on printed paper.
6 There are a number of output devices that
produce human readable as well as machine
readable output. Explain what is the difference
and list ONE of each type of device.


49 •

s you may recall, data is all the raw facts and figures that a computer
processes by following a set of instructions called a program. The way
A in which data is stored and represented depends on the medium
storing it and the type of data. Generally there are two types of data -
discrete and continuous. Discrete data is data that can be counted; for
example, the number of cars in a car park or the number of people that
responded 'yes' or'no' to a question. It has no value in between; for example,
you cannot say two and a half students are present. On the other hand
continuous data is data that can be measured and can be recorded at many
different points. For example, the temperature of a liquid can be recorded as
35 degrees Celsius (°C). However, based on the accuracy of the instrument,
the temperature maybe recorded to greater levels of accuracy, such as 32.5
°C or 32.53 °C or 32.534 °C, and so on. Other examples of continuous data
are length, temperature and volume (such as the volume of water or air).
Discrete data is processed by digital computers while continuous data is
processed by analogue computers.

A computer consists of a number of two-state (or bistable) devices that


process and store data. A bistable device is one which can be set to one of
two states at any one point in time. An example of a bistable device could be
a light bulb. A light bulb can be either in the 'on' or 'off state. A circuit can
either pass a current or not pass a current through the bulb. The two states
of a bistable device can be represented by the digits 0 and 1. In the case of
the light bulb we can use 0 to represent the bulb being 'on' and Ito
represent it being'off. The binary number system, which consists of two
digits 0 and 1, is used by computers to represent the two states. These two
binary digits are also known as bits (short for binary digits).
A single bit can represent one of two values, 0 and 1. A group of two bits can
be used to represent one of four (2 2 ) values:
00 01 10 11

These four values can represent four different symbols or characters. For
example, the numbers 0, 1, 2, 3 could be assigned to the four bit patterns:

00 0 10 2
01 1 11 3
With three bits we can have 8 (2 3 ) bit patterns. This means we can now
represent eight different characters (0 to 7):
000 0 100
001 1 101
010 2 110
011 3 111

With four bits we can represent 16 (2 4 ) characters, with eight bits we can
represent 256 (2 8 ) characters, and so on. Therefore with 'ii'bits we will be
able to represent 2" characters.

50 %.
••
e
Number systems0;• Did you know?
The number system that you are most familiar with is the decimal (base 10) Did you know that the
number system. This is the system that is used in everyday mathematical Voyagers pace probe
operations. However, since computers can only perform binary operations, has binary messages for
you need to know how to perform calculations using the binary number any intelligent life form
system. The next section deals with converting numbers from binary (base it may encounter on its journey
2) to decimal (base 10), and vice versa. through space? Launched in
1977, Voyager 1 and its twin,
Converting a binary number (base 2) to decimal Voyager2, were the first space
(base 10) probes to explore the outer
planets of our solar system.
Before converting a binary number to decimal we need to revise some basic Voyager 1's primary mission
concepts of the decimal number system. This system consists of ten digits ended in 1980 when it completed
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and for this reason it is also referred to as the base its observations of Saturn. Since
10 number system. The base of any number maybe indicated as a subscript then, it has been heading into
on the extreme right of the number (e.g. 455 10 means '455 to the base 10'). deep space. Voyager 1 and 2
These digits and their combinations are used to represent numbers in the both carry a so-called 'golden
decimal number system. record'—a 12-inch gold-plated
Each digit in the decimal number system has a value that depends on its copper disk. The disk carries
1
position or place in the number. The place values start at 10 for the digit of greetings and an overview of
smallest value on the right. You know from your mathematics lessons that our culture for extraterrestrials
0 0
10 = 1, since any number raised to the power of 0 is 1. So 10 is the 'ones who may one day stumble
1
place' or 'ones column'. Similarly, 10 is the 'tens place'. The value of each across one of these man-made
place increases by a factor of 10 for each consecutive digit moving right to left, craft. The record includes
until the digit of greatest value is reached: the digit on the far left. Again, samples of music; natural
you will recall this from your mathematics lessons. sounds such as thunder, waves
crashing, bird song; and
Let us look at the number 325. This number is made up of the sum greetings in multiple languages.
(addition) of each digit multiplied by its place value. Table 1 shows the value
of each digit in the number.

Hundreds (H) 7^ns (T) Ones (0)

3 represents 3 hundreds 2 represents 2 tens j 5 represents 5 ones


3X100=300 2X10=20 5X1=5

Adding the totals together gives 325


Table 1
Another way of setting out the information in Table 1 is shown in Table 2.

H T 0
2 1
(10 ) (10 ) (101)

100 10 1 This row shows the value of each digit in that


position: the 'place value'.

3 2 5 Each digit in this row is multiplied by its place


value, above.
300 20 5 Sum the totals:
Table 2
The result is 325
Decimal number and place value

Converting a binary number to decimal is very similar since each digit in a


binary number also has a place value that depends on its position in the
number. However, in this case the place value starts at 2 0 for the least
significant bit (LSB) and increases by a factor of 2 for each bit that follows, •
again moving right to left, as in the decimal example just given. 51 .^
Tb conve rt a binary number to decimal, multiply each Example 3
bit by its place value, starting from the least significant Convert the number 9 10 to binary.
bit iL SB) on the right to the most significant bit (MSB)
on the left, and then sum the totals. Example 1
1 1W illustrates how this can be done. 2 9 a. Nine divided by 2 gives 4
remainder 1.
Example 1 2 4R1 b. Four divided by 2 gives 2
Convert 1001 2 to decimal. remainder 0.
10012 ^ 2 2R0 c. Two divided by 2 gives 1
remainder 0.
(MSB) (LSB)
2 1R0 d. One divided by 2 gives 0
remainder 1.
23 22 21 20 0R1 Write the remainders sta rt ing
from the last remainder moving
8 4 2 1 This row shows the value of up to the first.
each digit in that position: the This gives 10012
' place value'.
Therefore 9 10 = 10012
1 0 0 1 Each digit in this row is
multiplied by its place value,
above. The process is the same for
larger numbers.
8 0 0 1 Sum the totals:
The result is 9 Example 4
What is the binary equivalent of 22510?
Therefore 10012 = 910
2 225 a. 225 divided by 2 gives 112
Example 2 remainder 1.
Convert 111001 2 to decimal. 2 112 R 1 b. 112 divided by 2 gives 56
remainder 0.
25 24 23 22 2 1 20
2 56 R 0 c. 56 divided by 2 gives 28
32 16 8 4 2 1 This row shows the remainder 0.
value of each digit in 2 28 R 0 d. 28 divided by 2 gives 14
that position: the remainder 0.
'place value'.
2 14 R 0 e. 14 divided by 2 gives 7
1 1 1 0 0 1 Each digit in this row remainder 0.
is multiplied by its
place value, above. 2 7R0 f. 7 divided by 2 gives 3
remainder 1.
32 16 8 0 0 1 Sum the totals:
2 3R1 g. 3 divided by 2 gives I
The result is 57 remainder 1.

2 1R1 h. One divided by 2 gives 0


Therefore 111001 2 = 5710 remainder 1.
0R1 Write the remainders starting
Converting a decimal number from the last remainder moving
(base 10) to binary (base 2) up to the first.
This gives 111000012
Converting a decimal number (base 10) to binary (base
2) is a simple process. It involves dividing the decimal Therefore 225 10 = 111000012
number by 2 and recording the remainder until the
result is zero, then writing out the remainders sta rting
from the last remainder to the fi rst. The following
• example demonstrates how this can be accomplished.
52 ^0
1
Adding binary numbers Step 2: Add the digits in the second column: 0 + 1 = 1.
Write the 1 in the same column.
Tb add two binary numbers you need to remember the 01
following points. You should memorise these five
+ 10
sums, as they are a good basis for knowing how to add
in binary. 11

1. 0 2 2. 0 2 3. 12 Therefore 01 2 + 10 2 = 112

+ 0 2 + 1 2 + 02
Example 6
Add together 011 2 and 0102.
0 2 12 12
(MSB) (LSB)
011
4. 1 2 5. 12
+ 010
+ 1 2 + 12
Step 1: Starting from the rightmost column (LSB) add
+ 12 the digits: 1 + 0 = 1. Write the 1 in the same column.
102 011
112 + 010
1
'Ib understand how the above calculations work, you
can think of them as follows:
Step 2: Add the digits in the second column: 1 + 1 =
10. Write the 0 in the same column and carry the 1 to
1. 0 2 + 0 2 = 0 2 . This is the same as: the next column.
(20x0)+(2°X0)=(1X0)+(1x0)=0x0 (carry) 1
= 0.
011
0 10 in base 2 is 0 2 , hence the answer shown.
+010
Similarly:
01
5. 1 2 +1 2 +l 2 is the same as:
Step 3: Add the digits in the third column: 1 (the
(2°X1)+(2°X1)+(2°X1)=1+1+1 carried bit)+0+0 = 1
= 3.
3 10 in binary is the same as We now have:
1 011
(2 X 1) + (2° X 1) = 112
+ 010
You also need to remember always that when adding
101
binary numbers 1 + 1 # 2, because the digit 2 is not
used in binary; similarly 1 + 1 + 1 # 3. Therefore 011 2 + 010 2 = 1012

Now let us look at adding in binary with a few


examples.
Example 7
Add together 1011 2 and 00112
'xample 5 First place the binary numbers one above the other
Add together the binary numbers 01 and 10. ensuring the bits with the same weighting are in the
same columns.
First, place the binary numbers one above the other,
ensuring the bits with the same weighting are in the (MSB) (LSB)
same columns. This gives: 1011
01 +0011
+ 10 Step 1: Add the digits in the rightmost (LSB) column:
1 + 1 = 10. Write the 0 in the column and carry the 1
Step 1: Starting from the column on the right add the to the next column:
digits: 1 + 0 = 1. Write the 1 in the same column. I
1 n i 1
01
+ 10
1
r
Step 2: Add the digits in the second column, including the car ry bit: 1 + 1 +
•• 1 = 11. Write the 1 in the column and carry 1 to the next column.
i i
1 (a) De fi ne data. ^• 1011
(b) What are the • + 0 0 1 1
two types of
10
data?
(c) Explain, giving Step 3: Add the digits in the third column, including the carry bit: 1 + 0 + 0
examples, the = 1. Write the I in the column.
difference between 11
the two types of 1011
data. +0011
2 Using an example, 1 10
explain the term
`bistable device'. Step 4: Add the digits in the fou rt h column:
1 + 0 = 1. Write the 1 in the column.
3 Convert the following 1 1
decimal numbers to 1 0 1 1
binary: +00 1 1
(a) 7 10 (b) 15 10 (c) 25io
(d) 71 10 (e)20510 1 1 1 0
4 Convert the following Therefore 1011 2 + 0011 2 = 11102
binary numbers to
decimal:
(a) 0011
2
(b) 00110001.2
Representing signed integers
(c) 10111001 An integer is any whole number (positive or negative) that does not have a
(d) 10110111 z fractional part. So far, our discussion has focused on unsigned integers:
(e) 111111112 integers we always assume to be positive. However, in practice we need both
positive and negative integers, collectively called signed integers. In the
5 Add together the
decimal system the minus sign (-) is used to indicate that a value is negative
following binary
and an optional plus sign (+) is used to indicate that a value is positive. In
numbers giving the
binary there are many different ways of representing signed numbers. In
answer in binary form.
this chapter we will look at four of the more common methods: sign and
((a) er + 1102
magnitude, one's complement, two's complement and binary coded decimal
(b) 1 0 1 2 + 1002
(BCD).
(c) 01011 2 + 1102
(d) 011011 2 + 010112
(e) 110101 2 +01101 2 Sign and magnitude representation
In the decimal number system we can represent a negative number by
placing the minus (-) sign in front of the number, for example, -3, -245.
However, this is not possible in binary as we can only have binary numbers.
In sign and magnitude representation the leftmost bit is used to represent
the sign (positive or negative) and the remaining bits represent the
magnitude. Usually a 0 sign bit indicates that the number is positive and a 1
sign bit indicates that the number is negative.
The four-bit binary representation '0001' in sign and magnitude
representation is equivalent to the decimal number 'positive one' (+ 1),
while '1001' is equivalent to the decimal number 'negative one' (-1). Table 3
below shows the sign bit and the bits that make up the magnitude.

Sign bit Magnitude Decimal value


0 0 0 1 +1
1 0 0 1 —1

54 . Table 3 Sign and magnitude representation


Using four bits we can have 16 different combinations. From Table 4 we can see that there are two ways to
Using the convention 0 sign bit for positive and 1 sign represent the number 0, these are 0000 2 and 10002.
bit for negative, Table 4 shows the range of numbers Because of this drawback and a few others, computer
that can be represented. scientists have developed other methods of
representing numbers in the computer.
0000 0 1000 0
0001 +1 1001 -1 One's complement
0010 +2 1010 -2
0011 +3 1011 -3 In one's complement notation, positive numbers are
0100 +4 1100 -4 represented as usual in unsigned binary. However,
0101 +5 1101 -5 negative numbers are represented by simply flipping
0110 +6 1110 -6 all the digits. This means replacing all the zeroes by
0111 +7 1111 -7 ones and all the ones by zeroes. For example, positive
three (+3) in this system is written as 0011 2 . To get
negative three (-3) we replace the zeroes by ones and
Table 4 the ones by zeroes, so that it becomes 11002.
The range of numbers that can be represented using When converting a number to its one's complement
four bits is -7 to + 7. From the table we can see that the number of bits must be stated. It is therefore
when the 0 sign bit of any number is replaced by a 1 wrong to say, for example, 'find the one's complement
sign bit (except for the numbers representing 0) we get
of 100 2 '. You need to say, 'find the four-bit one's
the negative of the number. Example 8 describes how complement of 1002'.
a signed integer may be represented using sign and
magnitude representation. This numeric representation system is not used very
much today. It was common in older mainframe
Example 8 computers; the PDP-1 and UNIVAC 1100/2200 among
many others.
Give the eight-bit representation of -35 using sign and
magnitude representation. Example 9
First, find the binary representation of 35. What is the seven-bit one's complement of 0110?
- 35 R 1 Add three zeroes in front of the leftmost bit (MSB).
2 17 1
This gives 0000110.
2 Flip the bits. This gives 1111001.
2 8 1
The seven bit one's complement of 0110 is therefore
2 4 0
1111001. (The results do not need any further
2 2 0 explanation. Students would not be required to discuss
the decimal value of a one's complement number.)
2 1 0

0 1 Example 10
This gives 1000112 Using four bits give the one's complement representation
of-6.
Notice the answer consists of only six bits. To make it
an eight-bit number, we need add two zeroes to the 1 Find the binary representation of 6, following the
left, which gives 00100011 Note that adding the two process in Example 3. This gives 110 2 , i.e. (2 2 X
2•
zeroes to the left does not change the value of the 1)+(2 1 X 1)+(2 0 X 0)
binary string. 2 Add zero in front of the leftmost bit (MSB) to make
it a four-bit number. This gives 01102.
+35 =/001000112
3 Flip the bits. This gives 10012.

The four bit one's complement of -6 is therefore


Sign `
bit magnitude
10012.
To get -35 we change the leftmost bit to 1.

-35 = 10100011, Two's complement


/^J
This is one of the most commonly used methods of
Sign bit magnitude representing signed (positive and negative) integers •
55 ^•

To represent a number in two's complement notation The majority of modern computer systems use
we begin by first finding the one's complement of the two's complement form to represent signed binary
number, then add 1 to the result. The example below numbers. This is because there is only one
lists the steps involved. representation of zero and addition and
subtraction is made very simple. Using the two's
Example 11 complement system, the circuitry for addition and
subtraction can be unified, otherwise they would
Find the two's complement of the seven-bit binary number
have to be treated as separate operations.
0011011.
1 Find the one's complement. Example 13
Binary number: 0011011
Using six bits find the two's complement representation of
One's complement: 1100100
_2710.
2 Add one to the one's complement. 1 Find the binary equivalent of 27. This gives 110112.
1100100 2 Add a zero in front of the MSB to make it a six-bit
+ 1 7 0111 number. This gives 0110112.
1100101 6 0110 3 Find the one's complement of 011011 2 . This gives
5 0101 1001002.
The two's complement of 0011011 4 0100
4 Add 1 2 to 100100 2 . This gives 1001012.
is therefore 1100101. 3 0011
2 0010 -27 as a six-bit two's complement representation is
Table 5 shows the two's
1 0001 therefore 1001012.
complement representation of a
0 0000
four-bit binary number. From Example 13, -27 = 100101 2 . This is possible
-1 1111
because in two's complement coding the place value
Notice, there is only one -2 1110
of all the bits are the same except the MSB which
representation for zero: 0000. This -3 1101
represents a negative number. Table 6 shows the two's
is an improvement over one's -4 1100
complement binary representation of -27.
complement because when -5 1011
performing arithmetic you don't -6 1010
-7 1001 - (2 5 ) 24 23 22 21 20
need special circuits to deal with
the two representations of zero. -8 1000
-32 16 8 4 2 1 This row shows
the value of each
Table5 Four-bit two's digit in that
complement representation
Example 12 position: the
'place value'.
Find the two's complement of the eight-bit binary number
00000000. 1 0 0 1 0 1 Each digit in this
1 Find the one's complement. row is multiplied
by its place
Binary number: 00000000 value, above.
One's complement: 11111111
-32 0 0 4 0 1 Summing the
2 Add one to the one's complement. totals together
11111111 gives -27.

Table 6 The two's complement representation of-27


100000000
Example 14
Find the value of 9 10 - 610 using four-bit two's
(Discard the extra bit) complement binary.
Note that we now have nine bits. Since we are
This could be written as 9 10 + (- 610)•
working with eight bits we discard the leftmost bit.
This discarding action (performed by the 1 Convert 9 to its binary equivalent. This gives
computer) is a convention used in two's 10012.
complement notation to maintain the original 2 'lb find -6 we need to find the two's complement
• number of bits specified, in this case eight. The
answer is therefore 00000000, which is the same as
of 6. Convert 6 to its binary equivalent. This gives
01102.
56 • what we started with.

R
3 Find the one's complement of 0110. This gives
Binary coded decimal (BCD)
10012.
4 Add Ito get the two's complement. This gives
representation
1010 2 which is equal to -6. BCD representation is very common in electronic
5 Add 1001 2 and 10102. devices such as pocket calculators and microwave
ovens where a numeric value is to be displayed. In
1001
BCD representation each digit of a number is
+ 1010 represented as its four-bit binary code. For example, to
store the decimal number 256 using BCD, means
100112
finding the four-bit binary equivalent of 2, 5 and 6:
We discard the extra bit because we are using four- 256 = 0010 0101 0110
bit. The answer is therefore 00112. ^.
2 5 6
Subtraction of binary numbers So 256 10 = 0010010101102
Two's complement can also help us deal with This method can also be used to represent signed
subtraction of binary numbers. Consider the following integers (+ and -). This system uses four bits to
problem:
represent a number. We can therefore represent 16
10012-01102 different numbers (see page 50, where we saw how
three bits can represent eight different numbers;
This could be written as 1001 2 + (-01102).
logically, four bits allows 16). However, since we only
Instead of performing binary subtraction it is actually need ten different codes to represent the digits 0 to 9,
easier to find the two's complement of 0110 2 (not we can use any of the remaining six codes to represent
-0110 2 ), and add it to 1001 2 . First we need to find the positive (+) and negative (-). The most commonly
two's complement of 01102: used method represents positive (+) as 1010 and
1 Find the one's complement. This gives 10012. negative (-) as 1011.

2 Add 1 to the one's complement. This gives 10102. Therefore the BCD representation of -256 would be
3 Now add 1001 2 and 10102: 1011 0010 0101 0110
1001
2 5 6
+ 1010
Example 15
10011
What is the BCD representation of -325?
1 Find the four-bit representation of each digit.
(Discard the extra bit) 2 0011 0010 0101
Since we are using only four bits we discard the V^ V
extra (leftmost) bit. The answer is therefore 0011. 3 2 5
Table 7 contains some examples of different binary 3 Place the BCD code for negative (1011) to the left of
representations of different decimal numbers: all the other bits.
1011 0011 0010 0101
BINARY REPRESENTATION OF THE NUMBER
Decimal One's 3 2 5
Two's Sign and
number complement complement magnitude The BCD representation is therefore 1011 0011 0010
representation representation representation
0101.
1 00000001 00000001 00000001

-1 11111110 11111111 10000001

100 01100100 01100100 01100100


Data representation
Various codes have been developed to represent data
-100 10011011 10011100 11100100
in the computer and to enable it to be easily
transmitted between systems. Data that is represented
Table 7 in computers is made up of characters. Characters
include: ^•
• Number characters (0 to 9) 57
••

• Alphabetic characters (lower case letters and upper case letters)
• Special characters (punctuation marks, $, /, etc)
• Control characters (backspace, delete, insert, etc).

All the characters that a computer can store and process are called the
character set of that computer. Different types of computers may have
slightly different character sets, depending on their operating system. Each
character is represented by a code consisting of either seven or eight bits,
called the character code.
'Itvo of the most common codes used are Extended Bina ry Coded Decimal
Interchange Code (EBCDIC pronounced'Eb-see-dic') and the American
Standard Code for Information Interchange (ASCII pronounced 'As-key').
EBCDIC uses eight bits to represent each character and is therefore able to
represent 256 different characters (again, see page 50). ASCII on the other
hand uses seven bits to represent each character plus an extra bit called a
parity bit which is added to help ensure data integrity.

The standard ASCII code defines 128 character codes (from 0 to 127) of
which the first 32 are deliberately defined aS control codes. A control code is
a non-printable code that is used to tell the computer to carry out a
command such as 'skip a line' or 'start on a new page'. This is done by

Char 7 bit ASCII Char 7 bit ASCII Char 7 bit ASCII


A 100 0001 a 110 0001 0 011 0000
B 100 0010 b 110 0010 1 011 0001
C 100 0011 c 110 0011 2 Oil 0010
D 100 0100 d 110 0100 3 011 0011

E 100 0101 e 110 0101 4 011 0100

F 1000110 f 1100110 5 0110101


G 1000111 g 1100111 6 0110110
H 1001000 h 1101000 7 0110111
I 1001001 i 1101001 8 0111000
J 100 1010 j 110 1010 9 011 1001
K 100 1011 k 110 1011 blank 010 0000
TM
i, 1001100 1 1101100 0101110
M 1001101 m 1101101 ( 0101000
N 1001110 n 1101110 + 0101011
0 100 1111 o 110 1111 $ 010 0100

P 1010000 p 1110000 0101010


Q 101 0001 q 111 0001 ) 010 1001

R 101 0010 r 111 0010 - 010 1101

S 101 0011 s 111 0011 / 010 1111

T 1010100 t 1110100 0101100


U 101 0101 u 111 0101 = 011 1101

V 101 0110 v 111 0110 RETURN 0001101


W 1010111 w 1110111 LNFEED 0001010
X 1011000 x 1111000 0 0110000
Table 8
Characters and Y 1011001 y 1111001 0 0110000
58 ^• their ASCII code z 1011010 z 1111010 0 0110000

.•
assigning one of the control codes to a command. Method 1
Whenever the computer encounters the code it carries
Since G is near the start of the alphabet, we can add 1
out the command. Control codes give programmers
to the codes of the consecutive letters until we reach
the opportunity to assign commands to actions that
G.
they may want to personalise in a particular computer.
In many cases there are many unused control codes. The code for A is 100001; to get B we add 1 to the code
of A, this gives 1000010; to get C we add 1 to the code
The remaining 96 character codes are representable
for B, this gives 1000011: and so on. If we continue
(printable) characters (Table 8). ASCII code is mostly
adding we will find that G is therefore 1000111.
used in mini and PC computers while EBCDIC is
mainly used on large IBM computing systems. A 1000001 C 1000011 E 1000101 G 1000111
B 1000010 D 1000100 F 1000110
From Table 8 we can see that the codes increase by
adding 1 2 bit to the previous code. For example, the
code for the letter A is 1000001 2 . Tb get the code for the Method 2
letter B we add 1 to 1000001 2 , which gives 10000102. Here is another method which maybe more efficient.
This pattern is repeated for the entire character set. 1 Convert the binary code for A (1000001) to its
From this pattern we can determine the codes of other decimal equivalent.
characters if we are given the code of any character in
1000001 = 65
the set.
2 Find the decimal equivalent of the letter G. We
Example 16 know that A is represented by 65, B will be 66, C
will be 67 and G will therefore be 71.
The ASCII code for the letter A is 1000001. Determine the
Convert 71 to its binary equivalent.
seven-bit ASCII code for the letter G.
71 = 1000111
Let us look at two methods to solve this problem.
3 The ASCII code for G is therefore 1000111.

1 Determine the BCD 6 Subtract the binary number 12 What is the ^•


representation of 65 10 . 0011011 from 11110010. decimal equivalent of •
2 Explain the steps in 7 Explain the term 'parity bit'. the following two's
conve rt ing an integer to 8 What is the one's complement
binary using the BCD representations?
complement of 1001 using (a)
method. a. 1001
4 bits? (b) 6 bits? (c) 8 bits?
b. 1110
3 What is the BCD 9 Using 8 bits, give the two's c. 11100111
representation of —21 10 ? complement representation d. 10010111
4 a. Convert the decimal of (a) —25 (b) 15 (c) —125.
13 Give the ASCII
number 45 io to binary. 10 What range of integers can be representation of the
b. What is the one's represented using two's following statement, 'Meet
complement complement with (a) 4 bits? me at 6'. Do not include the
representation of —45 10 ? (b) 6 bits? (c) 8 bits? quotes.
c. What is the two's 11 What is the decimal
complement 14 The ASCII representation for
equivalent of the following the letter 'F' is 01000110.
re p
representation of 45 1'
0
BCD representations? The
d. What is the BCD (a) What is the ASCII
first four bits represent the
representation of —45 1 x? representa tion of the
sign (1011 for negative and
e. What is the sign and le tt er'K'?
1010 for 00 1 1 0
a. 0 ).
magnitude representation
p (b) What is the ASCII
a. 1011 1001 1000 0111
of —4510? b. 1010 0010 0101 0111 representation of the
The following eight-bit c. 1010 0101 0111 0011 1001 letter'B'?
pattern represents the two's 15 The ASCII code for the letter
complement of an integer: 'N' has a decimal equivalent
111001101. What is the of 78. What is the ASCII code
decimal equivalent? for the letter R'? 0
59•

Binary fractions operate in a similar way. Each digit to
Parity bit the right of the binary point has a weighting as shown
When data is copied from one part of the computer to in Table 10.
another or transmitted from one computer to another,
we must ensure that the data received is exactly the
Binary Place Decimal Decimal
same as the data sent. One method of ensuring this is
value fraction value
the use of a parity bit. A parity bit is an extra bit which
is added to a byte to ensure data integrity. There are First bit after 1/z
2-1 5
two types of parity: odd and even. the point .1

A computer only uses one of the two types. So, if a Second bit after Z
2 /4 .25
computer is using even parity, a 1 or a 0 is added to the the point .01
bit string to ensure that the number of ones in the bit
Third bit .001 2-3 1/8 .125
string is always even. In an eight-bit byte the leftmost
-4
bit would be changed to 0 or I to ensure that the Fourth bit .0001 2 '/16 .0625
number of ones is even. Fifth bit .00001 2 -5 1/32 .03125
For example, given the binary string 1100010, a one
needs to be added to ensure that the number of ones is Table 10
even. Therefore adding the parity bit would make this
Using the weighting for each digit in a binary fraction
binary string 11100010. If the device receiving the data
we can find the decimal equivalent. Let us look at an
detects a string with odd parity, the data is rejected
example.
and an error is reported.
The process is similar for odd parity, but done in the Example 17
opposite way.
Convert the binary frac ti on 11.101 2 to decimal.
Starting from the left of the binary fraction, we record
Fixed point the digits down the table:

representation Binary Weighting Value

So far we have focused on representing integers 21 1 X21 = 2


(whole numbers) as binary numbers. We now need to 20 1 X20= 1
consider how real numbers (numbers with decimal -1
2 1 X2 = .5
points such as 3.2, 6.375) are represented.
0 2-2 0X22= .00

Converting a binary fraction to 2-3 1 X 2 -3 = .125


decimal 3.62510

lb better understand converting binary fractions to Or


decimals, we need to revise some facts about real 3
(1 X 2 1 )+(1 X 2 0 )+(1 X 2 -1 )+(0 X 2 -z )+(1 X 2- ) _
numbers. Consider the number 3.257. This number is 2+1 +.5+.00+.125 = 3.6251 0
made up of the sum of each digit multiplied by its
place value, as shown in Table 9. Notice that digits to
the right of the decimal point are multiplied by Converting decimal fractions to
negative powers of 10, starting with 10 -1 , 10 -2 , 10-3. binary
In a similar way to converting decimal numbers to
binary numbers, where we used repeated division by
3 3X100 3
2, we can convert decimal fractions to binary fractions
2 2X101 .2 using repeated multiplication by 2. We repeatedly
multiply the fractional part by 2 until the fractional
5 5X102 .05
part becomes zero, or until the pattern starts to repeat
7 7X1 .007 itself. We record the bit that is on the left of the
3.257
decimal point in the result, placing it immediately to
Table 9 the right of the point in the binary number. The next
binary digit is placed to the right of that one, and so
60 ^9 on. The following example will help you understand
this.
Example 18
Convert the decimal fraction 0.75 to binary.
Step 1: 0.75 x 2 = 1.50, so the first bit is 1, with 0.50 remaining
Step 2: 0.50 x 2 = 1.00, so the second bit is 1.
Since all the digits after the decimal point are zero, we have no remainder,
so we stop. Starting from the top of our series of calculations, we record the
binary digits before the point.
Therefore 0.75 10 = • 112

Example 19
Convert .65 10 to binary.
0.65 X 2 = 1.30, so the first bit is 1, remainder 0.30
0.30 X 2 = 0.60, so the second bit is 0; but we are still not finished, we need
to multiply this remainder
0.60 X 2 = 1.20, so the third bit is 1, remainder 0.20
The discussion pertaining to
0.20 X 2 = 0.40, so the fourth bit is 0, remainder 0.40 rounding and truncating is very
0.40 X 2 = 0.80, so the fifth bit is 0, remainder 0.80 complex. Afurther explanation
will complicate matters and is
0.80 X 2 = 1.60, so the sixth bit is 1, remainder 0.60 not required at this level. The
0.60 X 2 = 1.20, so the seventh bit is 1, remainder 0.20 purpose of mentioning the
rounding and truncating was to
Carry on for a while, and you will soon notice that the pattern is now show that whenever we use a
repeating itself, resulting in a very long string of numbers after the binary small number of bits to represent
point. Depending on how many bits we want to store, we therefore truncate a number the accuracy of the
or round the result. Let us use five bits to store the value. If we truncate, the numbers decreases.
value would be 0.10100. If we round off we get 0.10101. The rounded version
gives 0.65625 and the truncated version gives 0.625. We see that both
versions are not very accurate ways to store real numbers.
In fact really large and really small numbers are hard to represent unless
you're prepared to allocate very many bits of storage.
1 Find the decimal
Example 20 equivalent of the
following binary
Convert 26.625 io to binary.
bina fractional numbers.
lb convert 26.625 10 to binary, we deal with the integer and fractional parts (a) 0.1011
separately. (b) 0.1110
(c) 0.0001
First, as we did earlier, we repeatedly divide by 2 to obtain 26 10 = 110102. (d) 1.0010
'Ib convert 0.625 10 to binary, repeatedly multiply by 2. (e) 11.11
(f) 101.111
0.625 X 2 = 1.25, so 1 remainder 0.25
2 Find the binary
0.25 X 2 = 0.50, so 0 remainder 0.50 equivalent of the
0.50 X 2 = 1.00, so 1 following decimal
numbers.
Since the fractional part is now 0, we stop. Starting from the top we record (a) 0.25
the digits. (b) 0.75
0.625 10 = 1012 (c) 0.375
(d) 5.435
Therefore 26.625 i o = 11010.1012 (e) 9.875
Floating point numbers, • Consider the decimal number 5.64367 X 104.
• The number is positive (sign).
In many scientific and engineering applications very
• The fractional part (5.64367) is called the
small or very large numbers have to be represented,
mantissa.
from the sizes of atomic particles to intergalactic
• The base is 10
distances. Tb be able to accomplish this, many
• The power to which the base is raised is called the
computers store numbers using the floating point
exponent (i.e. 4).
format. This method is similar to the method of
representing numbers in base 10 known as standard The number 5.64367 X 10 4 can therefore be
form. For example: represented as:

The number 58 000 000 The number 0.00000025 Sign Exponent Mantissa
could be represented as: could be represented as:
positive 4 5.64367
5 800 000 X 10 0.000 0025 X 10 -1
Binary fractions can be stored using a similar format
580 000 X 102 0.000 025 X 10-2 of sign, exponent and mantissa (SEM). Computers use
different amount of bits to store floating point
58 000 X 103 0.000 25 X 10 -3
numbers. Most computers use the IEEE standard
5800 X 104 0.0025 X 10 -4 which allocates 32 bits for single precision and 64 bits
for double precision. This is more complicated than
580 X 105 0.025 X 10 -5
we need for our purposes at present, so in our
58 X 106 0.25 X 10-6 examples we will use eight bits to represent a number
using the following convention:
5.8 X 107 2.5 X i0 -
Sign Exponent Mantissa
In each of the numbers represented above the decimal
points have been moved (or floated) along the digits. 1 bit 3 bits 4 bits
However, it is only the last representation of both
Consider the binary number 11.112.
numbers that is considered as standard form. This is
where the decimal point is placed between the first This could be written as .1111 X 2 2 . The process of
and second non-zero most significant digits. There are shifting the binary point and multiplying by a power
four components to a standard form (floating point) of two is called normalisation. This is similar to
representation. writing a base 10 number in standard form. Generally
when we shift a floating point number we shift the
binary point so that it is immediately to the left of the
leading I (e.g. 11.11 becomes .1111 X 2 2 ) unless the
number stored is zero. This is done to ensure the
maximum utilisation of the available memory space.
We will also use the following convention for the sign
bit: 0 for positive and 1 for negative. 'Ib represent
positive and negative exponents, the exponent will
be represented using sign and magnitude
representation.

r
Example 21
Store 11.11 2 using the SEM format.
Step 1: Normalise the mantissa. This gives .1111 X 22
Step 2: The exponent is 2, which is 010 in binary (using three bits to store the
exponent)

Step 3: The number is positive. The sign bit is therefore 0.


11.11 2 in SEM format is therefore 00101111.

Example 22
Represent 5.5 10 using sign, exponent and mantissa.
We can represent 5 10 as 1012
.5 can be represented as .1 in binary fraction format, as you have already
learned.

So 5.5 10 = 101.12

To represent 101.12 in sign, exponent, mantissa format we need to normalise


the mantissa. This gives
.1011 X 23

Using our convention the sign bit will be 0 because the number is positive.
The exponent is 3. Using sign and magnitude notation this will be 011.

Therefore 5.5 10 is 0 011 1011 using SEM representation.

Let us look at another example.

Example 23 Represent the •


following numbers •
What is the decimal equivalent of 10111011
using sign, exponent
Sign Exponent Mantissa and mantissa format.
1 011 1011
Use 1 bit for the sign, 3
bits for the exponent
The sign is negative, and Oil means the exponent is 3, so: and 4 bits for the
1011 X 2
3
= 101.1
mantissa. The exponent
is stored using sign and
101 2 =5 10 and .12=.510 magnitude format.
(a) 3.5
Therefore 10111011 2 = -5.510
(b) 2.75
(c) .375
Example 24
(d) -3.75
What is the decimal equivalent of 11011011? 2 What decimal numbers
Sign Exponent Mantissa are represented by the
following binary
1 101 1011
numbers - which are
The sign is negative, and 101 means the exponent is -1, so: represented using sign,
exponent and mantissa
.1011 X 2 -1 = 0.01011 2 = 0.343 7510
format? The exponent is
stored using sign and
magnitude format.
(a) 00010101
(b) 01010101
(c) 10111101
(d) 11101100
(e) 00110011
S

63 ^0

Summary 13 Tb ensure that data transmitted from one part of a
computer to another and from one computer to
1 Data can be classified into two types: discrete and another is accurate a parity bit is used. There are
continuous. Discrete data is data that can be two types df parity: odd and even parity. In an odd
counted while continuous data is data that can be parity system, if the numbers of is in the original
measured and can be recorded at many different bit string (the bit string being sent) is even, then
points. the parity bit is set to 1 to ensure that the total
2 A decimal (base 10) number can be converted to number of is is odd. The opposite applies for even
binary by dividing the decimal number by 2 and parity.
recording the remainder until the quotient is zero 14 'lb convert decimal fractions to binary fractions
and then writing out the remainders starting from you have to repeatedly multiply the fractional part
the last remainder to the first. by 2 until the fractional part becomes zero, or
3 A binary number can be converted to decimal by until the pattern starts to repeat itself. Then
multiplying each digit by its place value starting starting from the top of the series of calculations,
from the least significant bit (LSB) on the right to record the binary digits before the point to get the
the most significant bit (MSB) and summing the binary fraction.
results. The place value is a factor of 2 starting 15 'lb convert a binary fraction to decimal, multiply
from 2 0 for the LSB and increasing by a factor of 2 each digit by its weighting starting from 2 -1 for the
for each consecutive bit. first digit after the binary point and then by 2 -2,
4 Binary addition can be easily done by 2 -3 and so on for each successive digit. The totals
remembering the following rules: are then added together.
0 2 +0 2 = 02, °2 + 1 2 = 1 2 , 1 2 +0 2 = 12, 16 Floating point numbers are stored using the sign,
1 2 + 1 2 = 10 2 and 1 2 +1 2 + 1 2 = 112 exponent and mantissa format. All floating point
5 There are four main ways of representing numbers must be normalised before they can be
negation inside the computer: sign and stored.
magnitude, one's complement, two's complement 17 Normalisation means shifting the binary point in a
and binary coded decimal. In sign and magnitude, floating point number so that it is immediately to
one's complement and two's complement, the left of the leading 1.
positive integers (whole numbers) are represented
the same way as for unsigned binary numbers.
6 In sign and magnitude representation, the
leftmost bit (MSB) is used to indicate the sign (+
or -) of a binary number. Usually '1' represents
negative (-) and '0' represents positive (+). The
remaining bits give the magnitude of the number.
7 Finding the one's complement of a number
81 involves flipping the bits. This means changing
the is to Os and Os to is.
8 Two's complement is found by adding l to the
one's complement of the number.
9 The BCD system converts each digit of a decimal
number into its four-bit binary code. Negative (-)
is represented by 1011 and positive (+) is
represented by 1010.
10 The character set of a computer consists of all the
characters that a computer can store and process.
11 Characters (numbers, alphabetic characters,
special characters and control characters) are
represented by a code called the character code.
12 TWo of the most common codes used to represent
characters are the seven-bit American Standard
Code for Information Interchange (ASCII) and the
eight-bit Extended Binary Coded Decimal
• Interchange Code (EBCDIC).
64 S

Questions
1 An 8-bit register stores integers using two's
complement.
(a) What is the 8-bit representa ti on of 65 and -65?
(b) Using binary addition find the value of -1-65.
(c) What is the decimal equivalent of 111.111?
2 (a) Store the following bit st ri ngs using sign,
exponent and mantissa format (SEM).
1 bit - sign, 3 bits - exponent,
4 bits - mantissa.
(i) 11.01 (ii) 01.11
(b) Represent the following decimal numbers
using SEM format.
(i) 2.5 (ii) 3.75
3 (a) Using examples, explain what is meant by
'normalising' the mantissa.
(b) Normalise the mantissa in the following:
(1) 1.1101 (ii)111.001
4 An eight-bit register is used to hold a floating-point
number. The number is stored as follows:
1 bit for the sign
3 bits for the exponent
4 bits for the mantissa
The exponent is stored using two's complement.
(a) State the bit pattern of the largest and smallest
numbers that can be represented.
(b) State the equivalent decimal value of the
smallest and largest numbers that can be
represented.
5 (a) What is the decimal equivalent of 101011?
(b) The SX computer uses nine bits for storing a
floating point number, one bit is used for the
sign, three bits for the exponent (a power of 2,
stored using two's complement) and five bits
for the mantissa.
(i) Give the range of exponents (in decimal)
which can be stored.
(ii) What is the largest decimal number that
can be represented?
(iii) What decimal number is represented by
the following bit patterns?
011011100

101110101

(iv) Give the nine-bit representation of 2.75.

65 ^0

oftware is the general name given to all the programs (set of
instructions) that computers use to perform different tasks. Software
S can be classified into two major types: application software and
system software.

Application software
These are programs developed to carry out specific tasks or solve particular
problems. For example, if you want to type a letter, you would need to use a
word processor.Ib create a highly decorated birthday card would require
some type of graphics package. Word processors and graphics packages are
examples of application software.

There are man y different types of application software available these days.
Each is designed for a particular type of activity. Selecting the right
application software to perform a task makes it easier to accomplish the
task, and will greatly improve the final outcome. When you purchase a new
computer it is usually sold with systems software and some application
software. However, depending on your needs, you may have to purchase
additional application software. Application software includes
entertainment software such as games, home or personal software such as
CD-ROM encyclopaedias, productivity software such as word processing and
spreadsheet packages, and specialist software such as desktop publishing
and graphics packages. Application software can also be categorised as
follows: general-purpose software, integrated software, customised software
and custom-written (tailor-made) software packages.

General-purpose software
This is software that is not written for any specific business or organisation
but can be used or adapted to suit their specific needs. For example, a
teacher can use a spreadsheet package to prepare students' end-of-term
grades reports, and a word processing package to write letters to the parents.
These same packages could also be used in a business to perform different
tasks, such as accounting or memo-writing. General-purpose software
packages, also called 'off the shelf software, are usually well tested and
relatively cheap.

Integrated software
An integrated software package is a set of related programs combined in a
unified package that allows data to be transferred easily between the
programs. Examples include Microsoft Office, Microsoft Works, Lotus
Smartsuite and the IWorks package used by Apple Macintosh computers.
A basic integrated package may contain word processor, spreadsheet,
database, communications and graphics presentation programs. A major

advantage of these packages is the ease with which data can be transferred
66 •

In
from one component to another. For example, if you are working
on a word processing document you can quickly incorporate a
graph created in the package's spreadsheet component via a simple
cut/copy-and-paste operation.

Some additional advantages of integrated software are:

• It takes up less disk space than individual applications.


• You can move much faster from one application to the next.
• It is usually easier to learn as the user interface for choosing
commands is the same.
• It tends to be more powerful and versatile than individual
applications.
• It is less likely to crash and contains fewer errors, since it has been
widely tried and tested.
• The producers' after-sales service is often good (e.g. online help
facilities); users can also get support from user groups and
magazines.
• It is usually cheaper than purchasing the packages individually.

Some disadvantages of integrated software are:


• Not all the features of single applications are included.
• Some integrated packages do not contain all the applications that
maybe required to complete a task.

Specialised software
Specialised software is software that is written for
a specific task rather than for a broad application area. These prograrr
provide facilities specifically for the purpose for which they were
designed. For example, a payroll program will usually only be able to
deal with all aspects of a company's payroll, i.e. for one very specific
purpose. Other examples of specialised software are expert systems
(software that operates like an expert in a particular field, e.g.
medical expert systems), accounting programs such as ACCPAC,
and theatre or airline booking systems.

Customised software
This refers to general-purpose software which has been
modified to meet the needs of an individual or organisation
better. These packages are customised through the writing of
code or macros. Macros are short programs written to
automate several steps in software such as databases,
spreadsheets and word processors. An instruction (usually a
keystroke or keystroke combination) signals the computer to
perform a predefined sequence of instructions. Macros are
usually written by experienced end-users of the program once
the program is complete. The core code of the program allows
for these macros to be added.

Custom-written (tailor-made) software


This is software written to meet the specific needs of a company. Evej
company is unique and may have unique needs, which is why a solut
tailored to achieve a company's goals, based on their specialised
requirements, offers many advantages when compared with general-
purpose pre-packaged applications. Custom-written software maybe
written by programmers within the company, or it may be contracted
ff

to a software house (a company that specialises in writing software). This


maybe necessary because there are no commercial applications or 'off the
shelf" packages available.
The main advantage of custom-written software is that the solutions it offers
give the greatest depth, breadth and flexibility possible in meeting the needs
of the organisation, since the software product is tailored to the
organisation's specifications. Also, the software developer delivers and
installs the software and trains the end-users in the use of the new product.

Some additional advantages of custom written software are:

It performs tasks that general-purpose software can't perform.


The software can be quickly changed when the needs of the business
change, since the source code belongs to the company.

Among the disadvantages are:


• Cost. The costs of developing the software, on-site installation, support
and training are often high.
• Lengthy development time. It takes time to acquire the information
necessary and write the code for the new software.
• Increased probability of undetected error. The probability of undetected
error decreases not only with the length of time a product is in service,
but also with the number and variety of users. Hence there are likely to
be fewer errors in a long-established general-purpose package (possibly
used all over the world) than in a custom-written package.

System software
System software is software that manages and supports the resources and
operations of a computer system. It enables the running of application
software and the management of the system resources. Three major
categories of system resources are the operating system, utility programs
and language translators. System software acts as a buffer between the
hardware and application software. Figure 2 shows a conceptual
arrangement of hardware, system software, application software and the
user.

Operating system
User
An operating system is a set of programs that governs the operation of a
computer. Without operating system software, the computer cannot
Application Software function. In some hand-held computers such as PDAs and Palm pilots, the
operating system is embedded on a ROM chip. However, for most PCs and
larger computers the operating system is switched on as soon as you turn
System Software
on, or 'boot', the computer. The term hooting refers to the process of
Utilities Operating r Language loading operating system software into a computer's main memory from
System Translators disk. The operating system remains in main memory until you turn the
computer off.

Hardware
Types of operating system
Some older operating systems that were used in PC computers include:
Figure 6.2 MS-DOS, Windows 3.X, Windows 95. Some operating systems that are still in
Conceptual arrangement of use today include: Windows 98, Windows ME (Millennium Edition),
hardware, system software, Windows 2000, Windows XP, Windows NT, Apple operating systems (e.g.
application software and the user OS9 and OSX), OS/2, Linux and Unix. There are Unix operating systems for
PCs, mini and mainframe computers.
68 %
Functions of the operating system
Did you know?
The functions of an operating system depend on the size and complexity of Did you know that the
the computer system. It may also depend on whether the system is a single Linux operating system
user system such as a PC or a multi-access system such as a mainframe or was initially developed
network. A multi-access system is one which allows a number of users with by a young University of
online terminals to interact with the same computer at the same time. An Helsinki student by the name of
online system is one where the terminals and the computer are linked Linus Torvalds? Linux was
interactively. Although the operating systems of mainframes and networks released with a General Public
are much more complex and perform a wider range of functions than those Licence and is example of 'open
of PCs, the functions of most operating systems can be grouped under the source' software. This means
headings discussed below. that anyone can copy, distribute
and modify the software's code,
Managing computer resources thereby building on the source
Managing all the resources of the computer system is a large part of the code written by MrTorvalds.
operating system's function. The operating system allows application This source code is often used
software or user programs such as word processing, spreadsheet and by other individuals to develop
database packages to communicate with the computer's hardware. For new, free programs. These
example, if you are working in a document in Excel and you want to print individuals often share the same
the document, you simply access the 'Print' command or press the 'Print' philosophy of cooperation and
button on the standard toolbar. Excel directs the operating system to select a openness as the code's original
printer (if there is more than one) to print the document. The operating inventor.
system then notifies the computer to begin sending data and instructions to
the appropriate program to get the document printed. Figure 6.3 shows how
the operating system acts as an interface between application programs and
the hardware.

Application
Hardware software
1. Command to 'Print'
2. O/S selects printer
Operating 3. Instruction from O/5 to
Excel
Lnnte9 System start sending Document
5. Document sent to
printer 4. Document sent to
programs in O/S

Figure 6.3
The operating system also manages the use of input and output devices. The operating system is at the
This is accomplished by the use of buffers. A buffer is an area of memory centre of operations, interfacing
that temporarily holds data being transferred to be processed or output. between software and hardware
Input buffers take data from a device (for example a keyboard) and hold the
data, releasing it to the CPU at a rate the CPU can cope with. This function is
especially important when a number of processes are running and taking up
processor time. The operating system will instruct a buffer to continue
taking input from the device, but to stop sending data to the CPU while the
process using the input is suspended. Then, when the process which needs
input is made active once again, the operating system will command the
buffer to send data.

The operating system functions in much the same way with output buffers.
An output buffer is used to store data waiting to be printed. For example, a
program that has to use the printer will transfer whatever needs to be
printed to the print buffer and continue processing. In this way the CPU
does not have to be idle while the printer, which operates at a much slower •
69 • •

JlW

speed, prints the document. The operating system also provides error
messages to indicate devices that may not be working properly or not
functioning at all.

Managing files and memory


The operating system manages all the files on a computer. It keeps track of
the locations where programs and data are stored in the computer's
memory. For example, when you open a file that has been saved to your
hard drive, you are first instructing the computer to find that file, and then
open it. The operating system also allows you to easily find files stored in
other secondary storage devices. Other file management functions include
copying, erasing, renaming and backing-up files. In the case of mainframe
computers, the operating system has to share storage between the many
programs that may be running at the same time.

Maintaining security
In networks and larger computers each user is given a username or ID and
password to gain access to the computer system. The operating system
keeps a register of all these names so that only persons with valid
usernames or IDs and passwords can access the system. This prevents
access by hackers and unauthorised persons. The operating system also
keeps a log which records which users logged in, the length of time each
user stayed on the system and what they did. Administrators can check the
log for breaches and abuse of resources.

Managing tasks
Early computers ran one process at a time. However, because of the fast
speed of the CPU and the much slower speeds of input/output devices the
CPU remained idle much of the time. 1b reduce the idle time of the CPU
multitasking or multiprogramming operating systems were developed.
Multitasking is the ability of the computer to appear to run more than one
program at the same time, although at a specific instant in time the CPU is
dealing with only one instruction for one of the active programs. The
operating system manages which instruction to send to the CPU.
For example, many students like to listen to music on their computer while
at the same time typing a document or playing a computer game. Another
example of multitasking is a user typing an e-mail while another e-mail is
being sent. These tasks appear to be happening simultaneously. Because
computers are so fast, the operating system can switch the program
executed in the CPU so quickly that the user cannot tell that, in reality, the
music-playing and typing functions are performed at individual moments in
time. Multitasking therefore accelerates the throughput of the system by
using the CPU time efficiently. Processes running in a multitasked
environment are called concurrent processes. In actuality, the CPU
processes one instruction at a time, but can execute instructions from any
active process.

Multiprocessing
This refers to a computer system's ability to support more than one process
(program) at the same time. Multiprocessing operating systems enable
several programs to run concurrently. This is accomplished by linking two
or more computers or processors which can then work on different
programs or different parts of the same program simultaneously. This
• generally increases processing times.
70••

Multiprocessing is much faster than multitasking/multiprogramming as
more than one program is processed at the same time. This type of
processing is used in real-time systems where fast processing speeds are
very important.
Processing modes
• Time-sharing: Time-sharing is one method that can be used in multi-
access systems. It makes many users believe they have the undivided
attention of the CPU. Tb accomplish this, the CPU allows each terminal
in turn a small amount of processing time (time slice) before it goes on to
the others. Each terminal is checked by polling to see if the CPU is
required. The process happens so quickly that every user on the system
thinks he/she has the continuous use of the CPU. The Unix operating
system is used for multi-access time-sharing systems, for example in
universities, where many students and professors may be connected to
the central CPU at one time from different terminals.
• Batch processing: A batch processing system is one where programs and
data are collected together in a batch queue before processing starts.
Batch processing is normally done on large mainframe computers. Each
piece of work the computer will do is called, simply, a job. Often a job
consists of a program to be run and the data that will be manipulated by
it. Batch jobs can be stored up during working hours and then executed
whenever the computer is least in use (usually at night). Once a batch
job starts, it continues until it is done or until an error occurs. There is no
interaction with the user while the program is being run. Batch
processing can be used for fairly automatic tasks, for example, weekly or
monthly payroll processing, processing utility bills (water, electricity,
etc) and credit card billing.
Real-rime processing: Real-time operating systems are designed to respond
to an event within a predetermined time. As soon as the data is input it is
processed and output immediately. In some applications the output is
used to influence the input. These types of operating systems are found
in environments where computers are responsible for controlling
systems continuously; for example, robotics, manufacturing, interactive
games, airline and theatre booking systems. In all these applications the
computer is often a dedicated computer and runs the same program all
the time.

Providing a user interface


Many operating system functions are never apparent on the computer's
display screen. What you do see, though, is the user interface. The user
interface is the user-controllable part of the operating system which allows
you to communicate, or interact, with it.

User interfaces
There are three types of user interfaces, both for operating systems and
applications software: command-driven, menu-driven and graphical.

Command-driven interface
The command-driven interface is used in PCs that either operate exclusively
with the MS-DOS operating system, or in PCs that are currently in MS-DOS
mode rather than Windows mode. This interface requires you to enter a
command by typing in codes or words. You have to type in the command at Figure 6.4
A computer screen in MS-DOS mode •
ii .

the prompt on the display screen. For example, at the C:\ > prompt, where
C:\ generally refers to the hard disk, you can type the following command:

C:A>delete *.*

This command tells the operating system to erase all the files on the hard
disk. Figure 6.4 shows an example of a command user interface.

Menu -driven interface


This type of interface allows you to
use either a mouse or cursor-
movement (arrow keys) to make a
selection from a menu. Menus
contain commands to Print, Save,
Format and so on. Menus are easier
to use than command-driven
interfaces because you do not have to
remember commands. You simply
select from the lists provided. Figure
6.5 shows the options in the
Microsoft Word File menu.

Graphical user interface


The graphical user interface (GUI)
(pronounced as 'goo-ee'), also called
WIMP (windows, icons, menus and
pointing devices), is the easiest device to use when interacting with the
Figure 6.5
File pull-down menu in Word CPU. It allows you to use graphics (images), menus and keystrokes, to
choose commands, start programs, see lists of files and other options. Some
of these images take the form of icons. Icons are small pictorial figures that
represent programs, folders, files, tasks, procedures and so on.
Another feature of the GUI is the use of windows. A window is a
rectangular boxed area on a computer screen. (This is not to be confused
with Windows, e.g. Windows XP, with a capital W, which is the Microsoft
operating system.) The screen can show different windows at the same
time, within which individual application programs may be running. Each
window may show a different program, such as a word processing document
in one window and a spreadsheet in another window. Or two windows may
show two different documents being run by the same program. A window
can also show other things, such as a directory of files on your hard drive.
The windows appear over a common visual background known as the
desktop. Figure 6.6 shows a Windows XP graphical user interface desktop,
without any windows open.

The Windows desktop


The Windows desktop is almost certain to be the starting place for your use
of computers. From here you will perform tasks and functions such as:
• Interacting with the CPU and the hard drive
• Opening software programs
• Managing files, folders and directories
• Creating documents
• Printing photos
• Listening to music.

72 %
0
In this section of the chapter we will take
you through some of the most basic and
i mportant features of this graphical user
interface:
First you will look at some of the
icons you need to be most familiar
with.
2 You will then learn how to manage all
your computer files.
Finally, you will learn about some of
the key system utilities that will help
you maintain your computer in good
working order.

After booting up a modern PC running


Windows XP, the desktop appears as
shown in Figure 6.6. If you are using
Windows 98, ME, 2000 or NT, the desktop
is likely to look very similar. You can
think of the Windows desktop as being
Figure 6.6
like the traditional office desk. Just as you can move things around on a real
Components of a GUI desktop
desk, putting away items in drawers, and adding and removing objects, you
can do the same on your Windows desktop. The Windows desktop contains
a number of shortcuts that allow you to access various processes available to
you in the XP operating system. Some of the default icons contained on the
Windows 98 desktop are described below.

My Computer
U. La iTem PRvotm Led o
7eb
When this icon is opened Windows 98
JBack - ©. JJ Sea A: OFolds ®s-.
displays the icons which represent __.._:._
__
0.lbess; S My DmPM vI OG.
devices such as the hard drive (C:), 3.5- M
qe Rued m llb EampRer
System Tasks
inch floppy drive (A:), CD drive (D:)
v system gdwmation 9 & ed DOU,nents
and DVD drive (E:), as well as Add aranove VVWams I.^
applications, folders, files and other Q' Owgeasetteg
items. In Windows XP, the 'My
Dthe, Places
Computer' window shown in Figure 6.7 ^Lmal psk(C:) My D..n ,(D:)
4, Mi Nelwnk%a[es
displays the different drives and MV DOOene, 65
5hatedDmmmtz Devices wft Removable Storage
folders, as well as other windows. One co,tol P3,51
is a menu to select System Tasks such 3½Flopp
Floppy (A:) DVD -RW D m e (E:)
as adding and removing programs, Detzi
viewing system information and Rolmd's Docvttnts
Laal Cek
changing a setting. Another titled Fie System: NIPS
Fee 5,3,e: 23.5
Other Places gives the following rocs Ese: 66 .5
options: 'My Network Places', 'My
Documents', 'Shared Documents' and
'Control Panel'.

Figure 6.7
Recycle bin
The Windows XP
This is where deleted objects (files, programs, etc.) are placed by the 'My Computer' window
computer until you empty the bin. Items in the bin can be retrieved if you
realise that you don't want to delete the item after all. However, once the bin
is emptied items can no longer be retrieved. This icon functions the same
for all versions of Windows (e.g. 98 and XP).


73 ^•

In

subjects could be placed in the one folder called 'Assignments', which is also
shown in the figure. The name chosen by the user - 'Assignments' - is an
'umbrella' term for the all the sub-folders that would be found in that folder.

If this method is used, an English assignment document will therefore be


stored in drive C, in the 'My Documents' folder, in the 'Assignments' folder
and in the 'English' folder. This can be written as
C:\My Documents\Assignments \English\DocumentName.doc. This
hierarchical structure for storing files makes retrieval of files very easy: you
simply click through the hierarchy of folders to find the file you want.

Creating a folder
'Ib create a folder on the desktop (e.g. Windows 98
(ED Folder or XP):
© Shortcut
1 Right-click on any clear area on the desktop.
Briefcase 2 When the pop-up menu appears select New.
Bitmap Imag 3 Select Folder from the menu that appears as
,_;;j Microsoft Word Document shown in Figure° 6.10.
Microsoft Office Access Application
4 A folder icon appears on the desktop and you can
Microsoft PowerPoint Presentation
Arrange Icons By give it a name.
Adobe Photoshop Image
Refresh
-J Microsoft Office Publisher Document Folders can be created in a diskette or hard drive by
Psr: Text Document selecting it, opening it and following the procedure
Paste Shortcut
I CJ WAV Audio outlined above, or by clicking the File menu and
Undo Delete Ctrl+Z selecting New and Folder. Folders can also be
Microsoft Excel Worksheet
L] Compressed (zipped) Folder created and stored within other folders.

Properties
Windows Explorer
Windows Explorer is the utility used for file
Figure 6.10
management functions in Windows operating
Creating a folder on the desktop
systems. It can be used to move, copy, rename,
duplicate and delete files, and to browse through
the directory. Explorer displays the file structure in
a hierarchical 'tree'.

If you want to find out more Back =.. Up Cut - Copy Paste U ti e(
about this topic you could Ideas L J C:IB ITWARE
look up the related
der"
animations and activities Desktop d Cap File Folder 05/23/006:29...
on your companion
J Fax File Folder 05/23/00 6:29 ...
My Computer
CD-ROM. +^ 4 31 Floppy (A:) C3 Voice File Folder 05/23/00 6:29 ...
O-, IC:I C3 Xfer File Folder 05/23/00 6:29 ...
! 0+-Q Acroread lO.wav 4KB Wave Sound 05/23/00 6:31 _.
^C7^ ® 41.wav 4KB Wave Sound 05/23/006:31...
.:--I Cap 410.wav 4KB Wave Sound 05/23/006:31 ..
{ Fax f s1 o0,,,av 5KB Wave Sound 05/231006:31 ..
--{_] Voice e1000.wav 6KB Wave Sound 05/23/00 6:31 ...
-- e 11 wav 5KB Wave Sound 05/23/006:31 ...
B--{ BookPack 05/23/006:31...
e12wav 5KB Wave Sound
cameol
s 1 6KB Wave Sound 05/23/006:31...
- ^] cameo2
--- applications e j 14.wav
^n.q 5KB Wave Sound 05/23/006:31...
-.. Computer applications 2 4015.wav 6KB Wave Sound 05/23/00 6:31 ...
{ L3-C] Corel Q]16.wav 7KB Wave Sound 05/23/00 6:31

9— Cwonders 4Q17.wav 7KB Wave Sound 05/23/006:31...


p{Kinder 4J 18.wav 6KB Wave Sound 05/23/006:31...
Q Preschl C19.wav 6KB Wave Sound 05/23/006:31...
-Q Toddlers l2.wav 11KB Wave Sound 05/23/006:31...
0 db2000 4J 20.wav 5KB Wave Sound 05/23/006:31...
f-- ] Downloads 3.wav 4KB Wave Sound 05/23/006:31...
0
Figure 6.11 O-^ Eai 4 30.wav 4KB Wave Sound 05/23/00 6:31 ...

0
76 Windows 98 Explorer window 3101,emu 2KB EM U File 05/23/006:30,..
To launch Windows Explorer using ELI Vaw Pmb[ TO 1* iP

Windows 98:
1 Click the Start menu. 1
MiY tlLL j >sms
®® J LJ
2 Click on Programs. a MC I"
d ,^3Nf1a0Y^R:) —Rf6° Cv50LC Orte Savrm
i i lvl Pd(C:)
3 Select Windows Explorer. a Somawome^E:l :0. ^ ®v ° ^" 9 "°""° oweese

0 fi.eeo.
m^e ^.
The Windows 98 Explorer window as LI
04Yn adrbu . IXUK.umm[ hv[- m .m
C.
£yS ONCE kitm
shown in Figure 6.11 is displayed. LI
ReA
A a P j ,,,.w...

To launch Windows Explorer using


A jCN,e
c
Windows XP: a
b
Ertl
Pia

1 Click the Start menu. 5005

s OtoswTon
2 Click on All Programs. adorn
aalemu
LI OHS. WI
3 Click Accessories.
4 Select Windows Explorer. ab

The Windows XP Explorer window as


shown in Figure 6.12 is displayed.
The Windows Explorer window consists of two panes. The left-hand pane Figure 6.12
displays the location (e.g. desktop), device (e.g. 3.5-inch floppy (A:)), or Windows XP Explorer window
folder where the data files are stored. The right-hand pane displays files or
further folders within that location. As shown in Figure 6.12, devices or
folders are displayed with a ' +' sign or '-' sign in front of them. The + sign
indicates that the folder or device contains other files or folders which are
not displayed. The -' sign indicates that all the files and folders are
displayed. Clicking on a folder on the left-hand pane displays the contents in
the right-hand pane.

Utilities
Utility programs are system software programs which provide useful
services, such as performing common tasks and housekeeping' routines.
Some are included with the operating system (for example, disk repairing
programs) while others are purchased separately by the user (for example,
Norton Disk Doctor). Some of the functions performed by utility programs
include:
• Backup: This utility allows you to make a duplicate copy of every file on
your hard disk, which can be stored on CDs or diskettes.
• File defragmentation: When files are stored in a new computer or hard
disk they are stored next to one another (contiguously). After using your
computer for a while you will probably have deleted old files and added
new ones. The computer fills free gaps with new files, including parts of
files. After a while, the constituent parts of a typical file are scattered all
over your hard disk - they are fragmented. This can considerably slow
down your computer, as the operating system must first find all the parts
of a file before they can be put back together and loaded. A defragmenter
utility finds these fragmented files and organises them back in a
contiguous manner.
• Disk repair: A disk repair utility scans a hard disk or floppy disk for bad
sectors (defective areas) and either makes repairs to these sectors, or
marks the defective area so that the operating system will not store any
data in that location.
• Virus protection: Antivirus software programs are also utility
programs. These are covered in Chapter 9.
• Language translators: Language translators (assemblers, compilers and
interpreters) translate a program written by a programmer into machine 77
language (the language the computer can understand). •

Summary 13 Real-time operating systems are designed to
respond to an event within a predetermined time.
1 Software is the general name given to all the The response may in turn create a response in the
programs (sets of instructions) that computers use user, e.g. in computer games, which are always in
to perform different tasks; it can be classified into real-time mode.
application software and system software.
14 The user interface is the user-controllable part of
2 Application software programs carry out specific the operating system which allows you to
tasks or solve particular problems and can be communicate, or interact, with it. The three types
categorised as general-purpose software, are command-driven, menu-driven and graphical.
integrated software, specialised software,
15 The command-driven interface requires you to
customised software and custom-written (tailor-
enter a command by typing in codes or words. An
made) software packages.
example is MS-DOS.
General-purpose software is software that is not
16 Menu-driven interfaces allow you to use either a
written for any specific business or organisation
mouse or cursor-movement (arrow keys) to make
but can be used or adapted to suit anyone's
a selection from a menu. An example is the pull-
specific needs, e.g. a word processing package.
down menus in Microsoft Word.
4 An integrated software package is a set of related,
17 The graphical user interface, also called WIMP
specialised programs combined in a unified
(windows, icons, menus and pointing devices),
package that allows data to be transferred easily
allows the use of graphics (icons), menus and
between each of the programs, e.g. Microsoft
simple keystrokes to choose commands, start
Office.
programs, see lists of files and many other
5 Specialised software is software that is written for options. The most popular example in use today is
a specific task rather than for a broad application Windows.
area, e.g. accounting software.
18 Utility programs are system software programs
6 Customised software is general-purpose software which provide useful services by performing
which has been modified to better meet the needs common tasks and 'housekeeping' routines, such
of an individual or organisation, for example, as backup, disk defragmentation, disk repair, virus
using macros. protection and language translation.
7 Macros are short programs written to automate
several steps in software, such as in database,
spreadsheet and word processing programs. They
are often written by end-users.
Questions
8 Custom-written (tailor-made) software is software
written to meet the specific needs of a specific Fill in the blanks
company or organisation; it is therefore expensive 1 software is written for a
and highly specialised. specific task rather than for a broad application
9 System software is software that manages and area.
supports the resources and operations of a 2 Software written to meet the specific needs of a
computer system; it includes the operating company is known as
system, the user interface and utility programs. 3 Software that manages and supports the resources
10 An operating system is a set of programs that and operations of a computer system is known as
governs the operation of a computer. It manages
computer resources, files, memory, tasks and 4 Programs developed to carry out specific tasks or
maintains security. solve particular problems are called
11 A time-sharing processing system makes users in
a multi-access environment believe they have the 5 refers to a computer's
undivided attention of the CPU. It does this by ability to support more than one process at the
giving each terminal in turn a small amount of same time.
processing time (a time slice) before going on to
6 A system where programs and data are collected
the others, then quickly returning to the first
together in a batch queue before processing starts
terminal again.
is knownasa
12 A batch-processing system is one where data is
7 The is a set of programs that
collected together in a sequenced batch queue
governs the operations of a computer.
• before processing starts. The program is then run
without interaction from the user.
78 %
0•

8 Software can be classified into two major 10 Maintaining system security is a


types: and function of an operating system. Tq Fq

9 The is the user-controllable


part of the operating system which allows a user to
11 Multitasking means the computer
is actually running more than one
program at the same time. Tq Fq
5161
communicate or interact with it. 12 Multiprogramming and multiprocessing
10 The processing of loading operating system mean the same thing. Tq Fq
software into a computer's main memory from 13 Real-time systems are designed to
YN,
r
ll1 iS 1bWt1 d3 respond to an event withinYa
11 The ability of a computer to appear to run more predetermined time. Tq Fq
than one program at the same time, although at an 14 Batch processing can be used in
instant the CPU is dealing with only one airline booking systems. Tq Fq
instruction for one of the active programs, is 15 A command-driven interface is easier
known as to use than a graphical user interface. Tq Fq
12 Command-driven, menu-driven and 16 Antivirus software is not an example
interface are the three types of a utility program. Tq Fq
of user interface.
17 Assemblers, compilers an&interpreters
13 is the utility used for file are all language translators. Tq Fq
management functions in Windows operating
systems.
14 operating systems are Multiple choice
designed to respond to an event within a 1 Which of the following is not a utility program?
predetermined time. (a) Disk repair program
15 A set of related, specialised programs combined in (b) Backup program
a unified package that allows data to be (c) Spreadsheet program
transferred easily between the programs is known
as (d) File defragmentation program
16 programs are system software 2 Application software consists of:
which provide useful services by performing (a) Entertainment software
common tasks and 'housekeeping' routines. (b) Productivity software
(c) Speciality software
True or False? (d) All of the above
1 Computer games are an example of 3 An integrated software package:
application software. Tq Fq (a) Can transfer data from one component to
2 A word processor is an example of another very easily
general-purpose software. Tq Fq (b) Costs less than individual applications
3 Integrated software packages take up (c) Takes up less disk space than individual
more storage space than individual applications
applications. Tq Fq
(d) All of the above
4 Specialised software is written for a 4
broad application area. Tq Fq Which of the following is not considered to be
system software?
5 A payroll program is an example of
specialised software. Tq Fq (a) Graphics presentation software
6 Customised software and custom- (b) Operating system
written software are the same. Tq Fq (c) Utility program
7 Custom-written software has an (d) Language translators
increased probability of undetected 5 Which of the following is not a function of the
error. TUF U operating system?
8 The operating system is one (a) Managing files and memory
category of system software. Tq Fq (b) Managing tasks
9 The operating systems of palmtops and
PDAs are embedded in a RAM chip. Tq Fq
(c) Creating a document
(d) Managing input and output devices

79••

6 Batch processing can be used for: 8 Explain the difference between
(a) Payroll processing multiprogramming and multiprocessing.
9 (a) List THREE types of user interface.
(b) Processing utility bills
(c1 Credit card billing (b) Explain how each type of user interface
operates.
(d) All of the above
10 (a) Define the term utility program.
7 Real-time processing is used for:
(b) Give the functions of any THREE utility
(a) Interactive games programs.
(b) Processing utility bills
(c) Credit card billing
Crossword
(d) All of the above
8 Which of the following is not an operating system?
(a) Linux

(b) Unix
(c) Windows ME
(d) Language translator
9 A folder or directory can contain:
(a) Files
(b) Folders
(c) Programs
(d) All of the above
10 Operating system software that allows more than
one user to access the same data is called:
(a) Multitasking operating system
(b) Multi-user operating system
(c) Single user operating system
(d) File managing operating system

Short answer questions Across


1 (a) Define the term software. 2 Short programs written to automate several steps
(b) Define the term application software. Give in software such as databases, spreadsheet and
THREE examples of application software. word processors. (6)
(c) Explain the terms general-purpose software, 3 A processing system where programs and data are
integrated software, specialised software and collected together in a queue before processing (5)
customised software. 7 A pictorial representation of a file, folder or
2 (a) Explain the term custom-written software. program (4)
(b) List the advantages and disadvantages of 8 Processes running in a multitasked environment
custom-written software. (10)
3 Explain the difference between application
software and system software. Down
4 Draw a diagram to represent the relationship 1 The process of loading operating system software
between the operating system, the application into a computer's main memory from disk (7)
software and the hardware. 4 System software programs which provide useful
5 what are the advantages and disadvantages of service by performing common tasks and
integrated software? 'housekeeping' routines (7)
6 (a) Define the term operating system. 5 A rectangular area that displays information on a
(b) List THREE types of operating systems. computer screen (6)
(c) List FOUR functions of the operating system. 6 An area of memory that temporarily holds data
7 Explain the terms: time-sharing, batch processing being transferred to be processed or output. (6)
80 > and real-time processing.
Data communications
Rapid advances in communications systems, computer use and multimedia
technologies are changing the way people communicate and transmit data.
Data communication can be broadly described as the transmission of data
from one location to another for direct use or for further processing. A data
communication system is made up of hardware, software and
communications facilities. Communications systems may be set up to serve
a small area; or they may be set up on a global scale. Data in any
communications system is moved from one location to another via data
communication channels or links. These channels are classified according
to bandwidth. Bandwidth determines the volume of data that can be
transmitted in a given time. The wider the bandwidth, the more data it can
transmit. Bandwidths can be grouped into three classes of channels:
1 A narrow-band channel, which is almost obsolete, for example a
telegraph system, can transmit data at slow speeds of between 10 and 30
characters per second (cps).
2 A voice-band channel can transmit data at the rate of 1000 to 8000 cps.
A telephone line is voice-band, and is one of the most widely used
methods of transferring data.
A broadband channel can transmit large volumes of data at speeds of
over 100 000 cps. Coaxial cables, fibre optic cables, microwave links and
communication satellites are commonly used to provide these channels.
Microwave signals are very high frequency radio signals that can be
transmitted through space. A communications satellite accepts signals
beamed to it from a point on earth and then reflects the signals to
another point as shown in Figure 7.1. Communication satellites can
transmit data that includes text, voice, pictures and video.

Figure?.! •
81
:•

The lines that transmit data can also be classified according to the direction
Did you know? in which data flows through them.
Did you know that there • A simplex line permits data to flow in only one direction. You can send
are currently over 2000 data or receive data, but not both.
• A half-duplex line can alternately send and receive data. This means
satellites orbiting the
that at any particular time you can either send data but not receive it, or
earth, many of which
are used for communication? receive data but not send it.
• A full-duplex line can simultaneously send and receive data.

Wireless communication
Wireless communications offer organisations and users many benefits, such
as portability, flexibility, increased productivity and lower installation costs.
Wireless technologies, in the simplest sense, enable one or more devices to
communicate with each other without physical connections - without
cabling. They use radio frequency transmissions as the means of
transmitting data. Wireless communications range from complex systems,
such as Wireless Local Area Networks (WLAN) and cell phones, to simple
devices such as wireless headphones, microphones and other devices that
do not process or store information. These devices include infra-red (IR)
devices such as remote controls, some cordless computer keyboards and
mouse, and wireless hi-fi stereo headsets, all of which require a direct line of
sight between the transmitter and the receiver to close the link.

Networks •;•
Many businesses, organisations, universities and schools have networked
computers. A network is a group of two or more computers linked together
so that they can share resources (hardware, software and data) and can
communicate with one another. Each computer network falls into one of the
following groups:
• Local area networks (LANs)
• Wide area networks (WANs)
• The Internet
• Intranets
• Extranets

Local area networks (LANs)


A LAN consists of a collection of microcomputers, such as in an office
building, department or school that can share peripherals, files and
programs and communicate with each other on the network. Each
microcomputer that forms part of the network is connected either by cables
or by a wireless link. Each computer can function both as an independent
personal computer running its own software and as a workstation on the
network accessing information from the network server. The server runs
the networking software that allows resources to be shared with the other
computers (called clients) on the network. The devices shared by a LAN
may include printers, hard drives, disk drives, optical drives (CD-ROM, CD-
RW, DVD-ROM, DVD-RW), modems and fax machines.

A LAN's ability to share information and communicate with the devices and
computers on the network has many benefits for its users:
• Hardware such as printers can be shared.
Storage facilities can be shared.
• • Software and data files can be shared by many users.
82 ^•

It is usually cheaper to buy one copy of a software application and pay
the licence fee for several machines, than to buy individual packages for
each computer.
• Users can work together on a single document.
• Users can communicate using e-mail.

There are disadvantages, too:


• The initial set-up costs are high.
• There is an increased risk of data corruption. Since many users will be
using the system, there is a greater chance of data being corrupted or
tampered with.
• There is a greater risk from viruses, because they are easily spread
between the computers that are part of the LAN.
• If the file server fails, all the workstations are affected and work stored on
shared hard disk drives will not be accessible; nor will it be possible to
use network printers, etc.
• Networks can be complicated to maintain and may require a network
manager. Additional costs may therefore be incurred.

Before a PC can become part of a network it must be fitted with a network


interface card (\T IC). This card fits into an expansion slot in the
motherboard and enables the computers on the network to send and receive
messages. The card has an external outlet into which one end of the
network cable is plugged. The other end of the cable plugs into a connection
based on the configuration of the network.

LANs can be divided into two categories based on how the computers
communicate with one another: client/server networks and peer-to-peer
networks.
1 A client/server networl+: is one in which any computer on the network
can be designated as the server, although most such networks will have a
specially designed computer that operates as a dedicated server and
has a faster processor, more RAM and a lot more storage space. A large
LAN may have several servers to perform different tasks. For instance, a
file server may look after the organisation of the files on the network,
while a print server co-ordinates printing on the network and looks after
the sending and receiving of faxes and e-mail. The server or servers
contain the software that manages:
• A shared hard disk
• Requests from users
• The protection of data
• The security of the system.
2 A peer-to-peer network allows every computer to communicate with
every other computer in the network. No computer is designated as a
server. Instead, each computer can be considered as both a client and a
server. This is because a user can access data from any computer on the
network and vice versa. Peer-to-peer networks are limited to about ten
machines, after which the performance drops and the system becomes
cumbersome. They are used mainly in small businesses and
departments.

Cabled LAN
In a cabled LAN, all the computers and other peripheral devices on the
network are attached to transmission cables. These cables fall into three
types:
Twisted pair: This is a convenient and cheap method of connecting •
computers and peripherals in a network. It is normally used for home
networking or on small sites where the distances between devices are 83.0
small and there is no great need for speed. 0
• Coaxial cable: Coaxial cable is more expensive than twisted pair
because its transmission capabilities are higher; it is used to transmit
voice, video and data. It is ideal for a medium-sized network.
• Fibre optic: Fibre optic cables are relatively expensive. They enable
large volumes of digital data to be transmitted extremely fast and
virtually error-free. A single strand of a fibre optic cable is a hair-thin
piece of glass tubing. The inside of the tube acts as a mirror, allowing
pulses of light to travel along it which carry data. A cable consists of
thousands of these hair-thin strands.

LAN topologies
How computers on a network are connected together determines its
topology (or configuration). The most common topologies for a LAN are
star, line or bus, and ri ng.

=fly. PC
Star topology
All the computers on the network are connected to one
another through a central hub as shown in Figure 7.2. A hub
is a hardware device to which a number of computers can be
connected. Data is transmitted from one computer to the
next by packets. A packet containing the addresses of the
=J^ sender and receiver is first sent to the central hub, which
then sends the packet to the designated computer.
Central
server Advantages of a star topology
• Adding new devices to the network is easy.
• If a computer stops working, the network is not affected.
• If one piece of cable is damaged, only one computer is
affected.
Disadvantages
PC * It requires more cabling.
• If the central computer or server malfunctions, the entire
network will fail.
• Only one computer on the network can send data at any
Figure 7.2 particular time.
A star network

Line or bus topology


This is a single line or cable (also called the backbone) with nodes at
Figure 7.3 different points. Servers, computers and other devices can be connected to
A line or bus network any of the nodes on the line, as shown in Figure 7.3. Data is sent down the
line in any direction in packets. Each
packet has the address of its sender and
PC PC Serve
the address of the intended receiver. Each
computer on the line examines each
packet to determine for whom the packet
is intended. If the packet is intended for
this computer, it is retained for processing;
Coaxial cable otherwise it is sent on its way.
Advantages of a bus topology
PC • Extending the network is very easy.
New equipment can be connected to it
simply by tapping into the main cable.
• It requires less hardware to set up.
• It is easy to configure.
84 %
••
Disadvantages
• Any problems with the main cable may cause the whole network to
malfunction.
• Packets of data may collide, resulting in loss of information.

Ring topology
PC
Here the cable is connected to all the computers on
the network. The ends of the cable are then
connected together to form a loop or ring as shown in
Figure 4. Data is passed from one computer to the
next by means of a token (electronic signal), which is
N
passed around the ring, giving each computer an
opportunity to send data. A computer can send data E=li ,w

only when it is in possession of the token.


Advantages of a ring topology
• If a computer stops working, the other computers
can continue to communicate.
• Communication is usually faster than with a line
network.
Disadvantages
• If the main cable is damaged, the entire network
goes down.
• The entire network has to be shut down for any
maintenance to be carried out.
• The network becomes very difficult to maintain if
it gets very large.

Wireless LAN (WLAN) Figure 7.4


A ring network
There are different ways of setting up a WLAN. One of the most common
methods depends on two main sets of components: access points and NICs
(network interface cards) with radio transmitters/receivers.
An access point is a device attached to a LAN network and contains a radio
transmitter/receiver, encryption facility and communications software. It
translates computer signals into wireless signals, which it broadcasts to
wireless NICs on the network. NICs equipped for wireless communications
receive these signals, and can transmit back. They have a fixed or
detachable radio antenna in place of the usual coaxial cable.
The access point and the NIC communicate with one another using a 2.4
gigahertz (GHz) radio band. The access point performs its role in reverse
when transferring signals from a wireless NIC to the conventional network:
it translates wireless signals received from NICs into wired signals.

In 1999 the it-Mbps 802.1lb became the standard for access points on which ' Mbps' is short for 'mega bits per
products like the Cisco Aironet 350 series, Ericsson LAN 11 Mbps, and many second', a megabit being just
others, are based. over a million bits.

A WLAN can be used where it maybe difficult or impractical to use a cabled


LAN - e.g. in homes, large offices, warehouses and lecture halls. A device
can be as far as 300 feet from an access point and still be able to access the
Internet. In a building with many rooms or large halls, a few access points
may be needed. A user may take a laptop and walk from one room or from
one end of a building to the next without losing network connectivity. This
is because the laptop will lock on to the strongest signal from an access point
and will transfer its link to another access point if the signal there is •
stronger.
85 .•
W

A wireless LAN has the same features that are available in a wired LAN. It
also provides more flexibility in acquiring information, as we have just seen.
Less wiring also means greater flexibility, increased efficiency and reduced
wiring costs. But, there are disadvantages. Besides the relatively slow speed
at which a wireless LAN operates, there is also the problem of interference
from other users or devices using the same 2.4 GHz band and the risk of
illegal access to information. Interference can corrupt data and is therefore a
major concern when installing a wireless LAN. Illegal access is also a big
problem, since anyone with a compatible NIC can have access to the
network. The need for encryption is therefore of the utmost importance.

Bluetooth
The other emerging technology used to set up a WLAN is Bluetooth
technology. Bluetooth is a standard developed by a group of electronics
manufacturers that allows any sort of electronic equipment (computers,
digital video cameras, cell phones, PDAs, keyboards, etc.) to automatically
make their own connections without wires, cables or any direct action from
a user. The manufacturers program a Bluetooth radio transmitter into each
unit with an address that falls into a range of standard addresses established
for a particular type of device. When a device is turned on, it sends radio
signals asking for a response from any unit with an address within a
particular range. For example, if a computer and a printer are turned on and
their addresses are within the established range, they will respond to each
other and a tiny network (piconet) is formed. Once the networks are
established, the systems begin communicating amongst themselves. Note
that this is different from a standard LAN: Bluetooth networks are formed,
broken up and reformed all the time, simply by switching on Bluetooth-
enabled devices when they are in close proximity to each other.
These 'ad hoc' networks, as they are called, allow data synchronisation with
network systems and sharing of applications between devices. Bluetooth
functionality also eliminates cables from scanners and other peripheral
devices. Handheld devices such as personal digital assistants (FDA) and cell
phones allow remote users to update personal databases, and provide them
with access to network services such as wireless e-mail and Internet access.
The Bluetooth method of wireless networking is already being used by
many companies with great success. However, like any network, there are
inherent risks. Some of these risks are similar to those of wired networks;
some are the same as for other types of WLAN.

Figure 7.5 WAN


Wide area networks (WANs)
Communication links
LAN A WAN can connect mainframes, LANs and PCs across a
large geographical area such as a city, a state or a country.
LANs are often connected to WANs using a special interface
( ..LAN
T LAN 7
device called a gateway. A gateway is an interface that
enables communication between two different networks.
t .,
^N_1 Information can be transmitted using special high-speed
United States Carribbean telephone lines, microwave links, satellite links or a
combination of all three. WANs are used mainly by
universities and research centres so that information can be
LAN
shared, and by large organisations, companies and banks
LAN LAN with branches in different countries, to share information
and processing loads between the various branches. WANs
can also be used to publish documents and distribute
LAN software. Figure 7.5 shows LANs in different countries
86 United Kingdom connected together to form a WAN, using
telecommunications links.
Fill in the blanks Multiple choice
1 The three classes of bandwidth channels are 1 A simplex line permits data to flow:
broadband, voice-band and (a) In one direction only
2A line can simultaneously send (b) Simultaneously in two directions
and receive data.
(c) In two directions but one at a time
3 Computers on a network can share software,
(d) None of the above
data and
2 The device that allows computers on a LAN to
4 LANs can be divided into two categories:
send and receive messages is known as a:
client/server and
(a) Modem
5 LAN cables fall into three types: twisted pair,
fibre optic and (b) Network receiver
6A topology is a single line or cable (c) Network interface card
with nodes at different points. (d) Network adapter
7 A LAN is able to connect to a WAN using an 3 In a ring topology of a LAN all the computers
interface device known as a are:
8 One of the most common methods of setting up (a) Connected at different points in a cable
a WLAN uses two main sets of components: (b) Connected to one another through a central
access points and hub
9 Users can communicate in a LAN using (c) Connected to a central cable and the ends
of the cable are connected together
10 WANs are used by large organisations, (d) None of the above
companies and banks to share and
loads between the various
branches. Short answer questions
1 A reliable data communication system is an
important asset to any business organisation.
True or False?
(a) What is data communication?
1 A broadband channel can transmit
between 1000 and 8000 cps. Tq Fq (b) What is meant by the term 'bandwidth' as it
relates to data communication?
2 A half-duplex line can alternately
send and receive data. Tq Fq (c) Identify and explain the different types of
bandwidth.
3 Wireless communications use
cables to transmit data. T q F lU 2 List and explain the three types of data
transmission channels.
4 A LAN connects computers in a
small geographical area like an 3 Define the following:
office building or school. Tq Fq (a) Simplex
5 There is an increased risk of data (b) Half-duplex
corruption if computers are part (c) Full-duplex
of a LAN. Tq Fq
4 Many university campuses have established
6 The incidence of viruses is reduced LANs.
if a computer is part of a LAN. Tq Fq
(a) What is a LAN?
7 A peer-to-peer network only has
(b) What are the main reasons for establishing
one computer designated as a server. T q F q
a LAN?
8 In a star topology all the computers
(c) State two methods used by computers to
on the network are connected to
communicate using a LAN.
one another through a central hub. Tq Fq
(d) State one difference between using a ring
9 Bluetooth technology can be used to
and a star LAN network.
create a wireless computer network. T LI F q
10 A WAN connects mainframes, LANs
and PCs across a large geographical •
area such as a city or country. Tq Fq 87 •

Computer r _J L Modem n f Modem ML Computer

Telephone line
Figure 7.6
Transmission of data An internal modem performs the same function and is now a standard
over a telephone line feature in most PCs. It is an interface card that fits into an expansion slot in
the computer's motherboard. The modem has an external outlet for a
telephone jack to be plugged into. Besides converting data signals, modern
modems can also perform:
• Automatic dialling - a modem can dial a phone number.
• Automatic answering of remote computers - a modem can answer an
incoming call.

Integrated services digital network (ISDN)


An ISDN modem is a digital device which allows voice, video and data to be
sent as digital signals over ordinary copper wire telephone lines or fibre
optic lines. Since the device does not convert signals from analogue to
digital and vice versa, it is not a modem in the true sense, but the name
modem is still used. These devices are capable of transmitting data at 64
kbps for a single line and 128 kbps for a bonded dual line. This is twice the
speed of the conventional 56 kbs modems. The relatively high speed and the
ability to transmit voice, video and data over one line allow users to surf the
Internet, make phone calls and receive faxes - all at the same time. With a
standard modem, you can only perform one of these operations at a time.
But despite these benefits ISDN systems are fast becoming obsolete due to
the development of faster systems.

Asymmetric digital subscriber line (ADSL)


The ADSL modem system uses a single regular telephone line to transmit
digital data and make phone calls at the same time. ADSL is a type of digital
subscriber line (DSL) where the downstream rate (the rate at which
information is downloaded from the Internet) is much faster than the
upstream rate (the rate at which information is uploaded). Data can be
transmitted at speeds of between 384 kbps and 8 Mbps downstream,
depending on the type of service, and 16 kbps to 640 kbps upstream.
An ADSL system requires both the user and the telephone company to have
a special ADSL modem or adapter. It does not require a separate phone line
and you are connected to the Internet all the time. This system has been
available in many Caribbean islands on a limited scale since 2003. However,
because of its higher cost and limited availability in some islands it is still
mainly used by businesses and large organisations. Symmetric DSL (SDSL)
is another type of DSL which does not allow you to use the phone at the
same time, but the speed of receiving and sending data is the same. This
kind of service might typically have a two-way transfer rate of 768 kbps.

Cable modems
A cable modem is a modem that connects a cable-TV line to a PC. In some
countries, such as the USA, TV cable companies install a single cable to
provide both cable TV and Internet services to customers. A special cable
box is needed to split the signal for the television and the PC. These cables
are two-way, an improvement over the one-way cables used solely for cable
TV. The new two-way cable enables the cable company to use a 6 MHz
channel slot within the cable signal to deliver Internet service. The
S download speeds are phenomenal, reaching a maximum of 5 Mbps, with
90 0 slower upload speeds of a little less than 1 Mbps. The actual transfer rate
••
II

depends on the number of people in the area accessing the service at the
same time. Data transfer rates drop drastically when the number of users
increases. This type of connection provides continuous Internet service. It
is not widely used.

Internet connections/links
Tb get connected to the Internet with your modem, ISDN, cable or ADSL
you need a connection between your computer and a host computer. The
computers communicate with each other through these connections using
protocols, which are like a recognised language for talking to each other.
Some of the basic types of connections are:
• SLIP/PPP: Serial Line Internet Protocol/Point-to-Point Protocol. These
are also referred to as a dial-in direct connection. It is the most common
method used by individual users to access the Internet. You dial up an
Internet service provider which gives you access to the Internet. A
SLIP/PPP link enables you to import and export files directly between
your computer and another.
• Dedicated connection: This means that you have a permanent
connection and are part of the Internet at all times.
• Remote network access: Two-way satellite access is one of the most
recent methods of providing remote access to the Internet. For this, you
must have a satellite dish. You send data requests at speeds that vary
from 300 kbps to 900 kbps, depending on the number of users on the
system. These requests are transmitted to a satellite that reflects the
signals to a satellite dish located at the satellite network operations
centre. After the requests are processed, they are returned along the
same route. The returned signals picked up by your dish are sent along a
cable to a transceiver and then to your PC.

Internet service provider (ISP)


An Internet service provider (ISP) is a company that has a direct
connection to the Internet and gives users access to it, usually for a fee. The
company usually has a small network that is linked via a high-speed
communications link to a high-speed link that forms part of the Internet's
backbone (supercomputers and other large networks that make up the
Internet world wide).

Software requirements for the Internet


You need the following software to connect to and access information or
other services on the Internet:
• An implementation of TCP/IP (Transmission Control Protocol/
Inte rn et P ro tocol)
A b ro wser.

TCP/IP
All forms of communication, either electronic or other means, are based on
some form of protocol. Computers connected to the Internet use a protocol
called TCP/IP. This is a set of protocols used to transfer data from one
computer to another over the Internet. A protocol is a set of rules that
defines how computers interact or communicate with each other. TCP/IP is
a non-proprietary protocol suite (it is not designed for any specific type of
computer) that enables hardware and operating systems software from
different computers to communicate. For example, an IBM (PC) compatible ^.
computer can communicate with an Apple or other computer. 91
••

TCP/IP is actually two protocols: the TCP portion divides the data that is to
be transmitted into smaller pieces called packets. This allows data to travel
more easily, and therefore quickly, along phone lines. Each packet is
numbered so that the data can be reassembled when it arrives at the
destination computer. The IP protocol sends each packet by specifying the
address of both the sending and the receiving computers.

Each packet may take a different route depending on the amount of network

traffic or on the location of the destination computer. The packets are sent
along by routers. A router can be a specialised computer or a piece of
electronic hardware designed specifically for routing. It chooses the best
route to send data to its destination. Data arriving at the destination
computer is reassembled. If a packet does not arrive or is corrupted, the
entire file does not have to be re-sent - just the packet that was lost or
corrupted.

Browser
In order to navigate the World Wide Web (www), you need a web browser. A
web browser is a program that resides in your computer and enables you to
find, retrieve, view and send hypertext and h y permedia documents over
the web. Popular browsers include Microsoft Internet Explorer, Netscape
Navigator and Mozilla Firefox.
All web browsers operate in a very similar manner and have similar
features. If you are using Microsoft Internet Explorer, the following are
some of the things you can do or can control with associated software
accessible through its 'toolbar':
• View hundreds of millions of web pages from all over the world.
• Send and receive e-mail: Outlook Express enables you to create and
exchange e-mail globally.
• Participate in 'conferences': e.g. NetMeeting conferencing software in
conjunction with a sound card, speakers and a microphone enables you
to talk to and listen to other users in real time.
• Chat: the Chat program gives you the opportunity to join discussion
groups and converse online.
• Develop web pages: you can build your own web pages by using the
ActiveX controls software.
• View channels: a channel is a web site that automatically transmits
information to your computer at the time you specify.
• Shop online: for books, CDs, clothes ... almost anything.
• See and hear recorded broadcasts: you can see and hear information as it
is downloading; you do not have to wait until all of it has arrived.

Internet Protocol (IP) addresses


Each computer on the Internet has a unique address that identifies it as a
node so that information can be sent to it. This unique address is really a
number called the IP address (Internet Protocol address). It is a 32-bit
address consisting of four sets of up to three digits each, separated by full
stops, for example 196.361.232.4. The first part of the address specifies the
network and the last two digits specify the host.
The IP address might be constant - that is, remain the same every time you
connect to the Internet - or it could be a temporary address that changes
each time you connect to the Internet. The IP address used by software is
difficult to remember for humans, who prefer to use names.

• 'ib allow users to refer to hosts by names, the Domain Name System
(DNS) was developed. This divides the Internet into a series of domains.
92 5

It uses a hierarchical naming system or tree structure to represent a host. A
domain is divided into second-level domains, which further subdivide into
third-level domains and so on. A host is therefore named for the largest
domain to which it belongs, then for any sub-domains within the largest
domain, and then finally for the unique host name. The DNS system allows
an Internet host to find another Internet host, by translating the host name
to the IP address of the computer.
At the top level there are domains corresponding to educational institutions
(edu), commercial entities (com), public organisations (org), governmental
bodies (gov) and the military (mil). Individual organisations each get their
name at the second level of the naming hierarchy. For example, Microsoft
has 'Microsoft.com' and the Association of Curriculum Developers has
ASCD.org'. Departments within an organisation will be at the third level of
the hierarchy, for example, 'shop.ASCD.org'. Sometimes a fourth level,
which includes the unique host name, is included. For example, if your
domain is'fun.com' which points to your web site, you can create
'holiday.fun.com', which points to the holiday section of your web site. You
may also have a 'Caribbean.holiday.fun.com' which now gives the name of
the computer in the holiday section of the web site. The complete name of a
host therefore includes: the unique host name, all sub-organisation units,
the organisational name and the top level domain. Table 1 shows a list of the
current top-level domains in the United States.

Domain name Purpose

.com Commercial

.edu Educational institutions

.gov Government bodies


. mil US military institutions
.net Computer networks

.org Other types of organisations, e.g. non-profit


organisations

.rec Recreational organisations


.store Retailers on the Internet

.info Distributors of information


.int International bodies Did you know?
Did you know that many
Table 1 Current top-level domains in the United States individuals in the
Caribbean have pursued
Internet applications and are pursuing online
degrees via the Internet from top
There are four main types of services available on the Internet: universities in the UK and USA?
Terminal emulation services This is called 'distance
File access and transfer services education' or 'distance
Communication services learning'. It usually involves
The World Wide Web (www). learning via web sites and e-
mail contact between tutors and
Terminal emulation services (TES) students, rather than face-to-
face interaction. What do you
These services enable you to connect your computer to a remote host and think the advantages and
use the services available as if your computer were a terminal of the remote disadvantages of this type of
host. This can give you access to specialist offerings like online databases, learning might be?
library catalogues and chat services.
An important TES is TFlnet, a special program that allows you to access data
and programs from a Telnet server. When connected to a Telnet site, your
computer becomes a 'dumb' terminal that can be used only to send text-
based messages to the Telnet site and to view the results. The Rlnet
program provides a window into which you can type commands and access
information from the host computer. Some browsers, such as CompuServe's,
have built-in Telnet software, while others such as America Online (AOL)
allow users to access the Telnet software but do not run it themselves.

File access and transfer services

These services enable you to locate and use electronic Iles stored on
computers across the Internet.

File transfer protocol (FTP)


File transfer protocol (FTP) is a set of rules for communicating over the
Internet. It enables you, through an FTP program, to find an electronic file
stored on a computer somewhere else and download it (take a file from one
computer on the Internet and copy it to a storage device on your computer).
It also enables you to upload files (send files to other computers on the
Internet). The electronic files are stored on what are termed FTP sites,
which may be maintained by universities, government agencies and large
organisations. Some of the sites are private, and you may have to pay to
retrieve or store information on those sites.

The files in an FTP site are stored in directories. Each file has a name and an
extension, the name labelling the contents of the file and the extension
indicating the type of file - text, sound, program, image, video, etc.

Communication services
Electronic mail (e-mail)
E-mail is the most popular and widely used service on the Internet today. It
If you want to find out more enables users locally and world wide to send electronic messages (text,
about this topic you could sound, video and graphics) to one individual or to a group of individuals, and
look up the related to receive messages from others. A powerful feature of e-mails is the option
animations and activities to send attachments. For example, a document created in Microsoft Word
on your companion can be attached to an e-mail message and received by the recipient with an
CD-ROM. e-mail program.
E-mail is much faster than mail delivered by the traditional postal system.
An e-mail can be sent to an e-mail subscriber in any part of the world in a
matter of seconds or minutes (depending on the 'traffic' on the Internet).
Also, a subscriber can access his/her e-mail from any part of the world as
long as Internet access is available. Apart from the fee that a subscriber has
to pay to an ISP for Internet access, sending e-mail is free. You can send as
many e-mails as you like at no additional charge and at your own
convenience, any time of the day or night. This does not cause any
problems for the person receiving it, who does not have to be present to
receive the e-mail. They collect the e-mail (e.g. from their ISP) at a time
convenient to them.

E-mail addresses
• 'lb be able to send and/or receive e-mail, each user must have an e-mail
94 •• address and an e-mail program such as Outlook Express. The address is


unique to the user and consists of two parts separated by the @ ('at') symbol.
The first part is the user name, which can be a real name, a shortened form
of a real name or some made-up name. The second part is the domain name
- the location of the e-mail account on the Internet, e.g. with your ISP. The
general form of an e-mail address is as follows:

Username@Domainname
For example, an individual in Trinidad and Ibbago who has an Internet
account with the Telecommunications Service of T inidad and Tbbago
(TSTT) may have an e-mail address like this:

[email protected] or [email protected]

Internet users can also use the free e-mail services offered by web sites such
as Yahoo!, MSN and Excite. You simply fill out an online form to open an
account and get an e-mail address. You access e-mail directly through the
web site, rather than through an e-mail program resident on your computer.
Examples of these addresses are:

[email protected]

[email protected]

E- mail hardware and software requirements


Fk Edt View Insert Format Tools Message Help ]f
For an e-mail message to be sent and received, the
following must be in place: jG h i J ti -
Send _.. _. _ tend. Check Spehng Attach priority

• Mail server: This is a computer on the Internet that Ta: Cr6Ltt

operates like the traditional post office. The mail server Cc: a9.com

receives incoming messages and delivers outgoing 56ject: LOrt ON ro Ir FCR C%C

messages. It allocates a certain amount of storage to = B i u A, ._ _ - PIE = 2 --


hold mail for registered users. The area of storage Hello Michele
allocated to you is your mailbox. You can retrieve your I have attached a copy afthe chapter I am currently working on I have left o ut two of
the figures. Please read and send me your comments.
mail by supplying your username and password. This
Regards
is necessary to protect your e-mail from unauthorised Roland)

access.
• Mail client: This is a program that enables you to read
and compose e-mail messages, send e-mail and access
e-mail from the server. If you are using Microsoft Office
software, you may use the popular Outlook Express
program as your mail client.
Figure 7.7 shows the Microsoft Outlook Express e-mail Figure 7.7
screen for creating a new message; the format for other An e -mail message
e-mail software is quite similar.

Components of an e-mail
lb send an e-mail, in the 'Tb: field fill in the e-mail address of the person to
whom you want to send it. If you want to carbon-copy the e-mail (send the
same e-mail for information to a number of other users), fill in the other
addresses in the 'Cc' field. Tb give the receiver an idea of the contents of an
e-mail before opening it, type a descriptive phrase in the 'Subject' field. Now
move to the blank area and type the message.
You can also send attachments along with the original e-mail. An
attachment can be a word processing file, a spreadsheet file, a database file
or any other file that your computer can access. When a file is attached, a
new field showing the name and size of the file is displayed below the
'Subject' field.

95 ^•

Electronic discussion forums
Electronic discussion forums such as mailing lists, newsgroups, chats and
bulletin boards are another very popular feature of the Internet.

Mailing lists
An electronic mailing list is a group of people using e-mail to communicate
their views on common issues or interests. You subscribe to become part of
the group. Not all groups are open to everyone. Some might only allow
professionals in a certain field. For example, a group discussing early
childhood education may only want to include researchers in that field. A
mailing list may therefore involve only a few people or thousands of people.

When you become a member of a group, you can send messages with your
comments or views on some matter that is being discussed or to which you
want an answer. A copy of your message is then sent to all subscribers on
the mailing list. You can also simply read the contents of messages and not
make a contribution. Some mailing lists only let subscribers receive
messages but not send them. For example, there is a mailing list that sends a
joke a day to its members, but the members cannot reply.

Newsgroups
D14 you kn ° -nv? A newsgroup enables a group of people with common interests to
Did you know that posting communicate with each other. There are thousands of newsgroups on the
messages to newsgroups Internet, dealing with almost every imaginable topic. A subscriber to a
is very easy using newsgroup posts a message, which can vary from a few lines to whole
Outlook Express and articles. The other subscribers read the message and may or may not choose
other similar e-mail clients? to reply.
To set up a newsgroup account,
The main difference between newsgroups and mailing lists is the method of
click on 'Set up a newsgroups
communication. Mailing lists use e-mail to communicate with subscribers.
account...', displayed in the main
Messages are sent to a subscriber's e-mail address. Newsgroups post
Outlook Express window under
messages on the Internet for all the users to access. For you to be able to
the heading 'Newsgroups'. The
read and post messages to newsgroups, your computer must have
Internet connection wizard will
newsreader software. For example, Microsoft's Outlook Express has a built-
take you through the necessary
in newsreader.
steps. After setting up your
account, answer these
Bulletin board system
questions: How many
newsgroups did you find? What A bulletin board system (BBS) is an Internet facility much like a newsgroup.
topics were covered? It is dedicated to the exchange of messages. Most bulletin boards serve
specific interest groups and are often free, although some may charge a
membership or user fee. Everyone with access to the bulletin board can post
and view messages on the topics covered by the board.

Chats
Chatting on the Internet has become a favourite pastime for many users. A
user can enter any one of the thousands of chat rooms that are present on
the net. A chat room is a group of people with common interests
communicating with one another interactively, in real time. There are chat
rooms for specific topics, but many chat rooms discuss a range of subjects.
For example, a chat room for unemployed Internet users at home might
discuss things like their children's education or possible opportunities for
work. Some of the different ways of chatting include:
• Text-based chat: This is the oldest and most common method of
chatting. You enter a chat room and look at the comments posted about a
96 % topic. Everyone currently in the room is notified that a new person has
entered the discussion. You are identified by a name, but many users
prefer to use a handle or sobriquet (a name that they want to
characterise their personality). You can see the comments made by other
participants and can type out a reply on any of the comments to
everyone connected, or, if you wish, only to selected people in the group.
You may wish to start a topic of your own. Users can enter and leave a
chat room as they wish. One popular chat program is ICQ.
• Internet Relay Chat (IRC): This is a real-time conference system that
lets you talk with as many people as you like, grouped together on
channels by topics, using text messages. Once you have accessed IRC,
you can find out what topics are being discussed and how many users are
involved. You can then search for a channel that suits your interest.
IRC can be considered as a variety of text-based chat where each chat
room (channel) is dedicated to a specific topic, and where users are not
allowed to discuss topics unrelated to the channel's purpose.
• Instant messaging: This is a variation of IRC. With instant messaging, a
user on the web can contact another user currently logged on and type a
conversation. Chatting is therefore usually 'one-to-one'. Instant
messaging is available from ICQ MSN and Yahoo!; a very popular
program to this end is MSN Messenger. The service is free as long as you
have Internet service. You simply need to fill out an electronic form with
some basic information and you can get started.
• Multimedia chat: Multimedia has created a new form in which users
can communicate. With multimedia software, you can use the
microphone in a computer to talk to another user anywhere in the world,
as if you are on the phone. If you each have a small video camera
(webcam) connected to your computer, you will also be able to see each
other. However, in most countries at present the quality of video output
is not very good, due to bandwidth issues, and users may have to wait
many seconds for each video clip. For live video communication to
function properly, the bandwidth of the present transmission channels
will have to be increased.
- Pee is & tea I-S tlN

Short message service (sms)


There are currently a number of
services that allow Internet users to
send text messages from a computer
to a mobile phone. For example, in "IO rs G ..r- ni, acne nd.,FJ n a.m al.a m&.m.:

Trinidad and Tobago there is an sms {jq„ f 1 - e ISle


Send NOW
messaging service on the Internet TO CBY ye..Y.ew
.
SlI.eCC L
a
tie
t ann.n
Y . VY when TOtlb y 07 AU

which uses a gateway to allow text


m..n nm.mb..u.e a.u..ry
messages to be sent to mobile mY er m., nM b. lunalen.I .t M.
.a,.am.a a.n..ry am..
phones. You simply fill out the ^•
n 96 MbwSY . aennUe' elfllO S 5 - . ei
.. • w ••n b. a.u..na.e un am.. o.as.^ib• .. ii., u u u•
on^cenn.am..N..0. amirt em..
appropriate information in the boxes e. nva,..M to a,n .
uasm s.na: rausm PPOe ^I --eg .a.0 ^e..aa
provided on the web page (as shown
—S
in Figure 7.8) and click'Send'. Oil 19: AlUaupE pE®e to Atone .eaaeymq is a tn[m , '19 T! Rill his e-mebtea
.
u <l. muueo-^ a• u as. Ibis .10,. 000 0510,0 iii. i., p t e, t .®
.15105 0 .c.
'el 15: 151T W ]n000i010 1, FOrymaba ALL tat 5 e 505 pl00. mttll tail zMm m .Le
Point-to-Point Protocol *13Y1.0 e.unrt 1. et.to[M.

(PPP)
Point-to-point p rotocol (PPP)
Figure 7.8
enables users to dial into a local Internet service provider to connect
The sms message box
securely to their corporate network through the Internet. This is
particularly useful for people who work from home or people who travel
and need to access their corporate networks remotely, for example, to check
e-mail. 97••

Broadcasting
Broadcasting refers to the distribution of information, programming or
advertising content to everyone on a network. The sending of junk mail
randomly to as many people as possible on the Internet is therefore an
example of broadcasting.

Narrowcasting
This is the opposite of broadcasting. It refers to the targeted distribution of
information, programming or advertising content to specific individuals or
venues. Narrowcasting ensures that its content is timely and relevant to its
intended audience. It can therefore be used to select specific target groups
and market products to them.

World Wide Web


The web is a service offered on the Interriet. It was originally developed to
help physicists in Geneva, Switzerland, exchange data and research
materials quickly with other scientists.
Many people believe the Internet and the World Wide Web (also called the
Web, WWW or sometimes W3) to be one and the same, but this is not so. In
fact the Web can be thought of as a large subset of the Internet. The Web
consists of millions of web pages (hypertext and hypermedia) documents. A
hypertext document is a document that contains a hyperlink to another
document located on the same computer or on another computer in any
part of the world. Hypertext allows you to move easily from one document
to the next.
For example, if you have used the Help files in any of Microsoft Office's
application programs, you have already encountered hypertext. You may
have asked for help with a certain topic and been shown a displayed
explanation, in which you saw certain words highlighted in blue and
underlined. If you clicked on such a word, you would get an additional help
screen. The word is associated with a hyperlink to somewhere else in the
computer (either in the same file or in a different file).

Hypermedia is a general name for documents that contain links to text,


graphic, sound or video files. A computer that stores and makes available
hypertext and hypermedia documents is called a server (or web server),
and a computer that requests such a document is called a client. Hyper'Ibxt
Transfer Protocol (HTTP) is a set of rules that controls how data travels
between server and client. In order to find, retrieve, display and send
hypertext and hypermedia, you need a browser. In the examples in this
chapter, we shall use Microsoft Internet Explorer.

Finding information on the Web


You can retrieve information by clicking on a direct link using your browser,
or by using one of the many search engines. A search engine, also
sometimes called a web portal, is a web site that allow users to find
information quickly and easily. Each search engine has its own database of
web documents. Items are continually added to the site by a program called
a spider, which searches the web looking for new pages to add to the
database. In addition to giving access to information in its database, a search-
• engine site may also provide features such as a free e-mail service, chat
rooms, news and facilities for online shopping. Some of the best-known
98 •
•40 search engines are Yahoo!, Excite, MSN, Hotbot and Google.
Access to web pages may be
accomplished by: ©° e ° © AAGP^fir

` E9 G3-4A-G]9 3
• Searching through subject directories ,amaax W :)ar.mnM
... __ . ® min

wM,an..m,.v as ^. .m..aL.,M
linked to organised collections of web
pages.
• Entering an Internet address or URL I
06 xurnoan. seaeon
20
a 1.q b.,mo r
aeM
ls, n
Aym ro h
.11 b as ale
ae
r
aln ha
a - a 1 eI
gene Ir n --
a
a
Rn wn
. e, . la l
- ea+ i [
s _p
nn
.e apl a n t n anaa ^^N'
sWM aryl. Ides a pe ban ng.Nat,gh n matoelb LMaeie
and retrieving a page directly. • -
• ^o
d
de, Z Nd em JNeby cane, as re mamberee 1,05A m .,mo
N,snaw a v, by M awM -endln eon g .in g ll,1Wu3
v W: u ai,
r ys:
he,e d^p; jy i dh Malrm
men g - hundeh e,uptologenda q e
• Humaan. IC. v us. EM+ and b l am n eel. heady legend s . but umimely deMne made them lmmunal. $o lilt, beg,
• Entering a key word or a search IM queer tlbe
Mw as nl%y
ns Dee,, Wets also Inda, M Ife age 00 74. uvula he be as much side icon to xollynooe as -j

statement at a search engine to k


^,f • Jame+peanoN— SE, - 4MUrta photos. soeefaana. aneotnergonaie, ^^^• \
retrieve pages on the topic of your Resume, Eanne,m to
• Irnns ienee Dee, -enep,.q,y and hI, m.ny rvman..n hn.a n.:e.
eddh os e =.<.... vn Lene naa same nean - ma,,aa.rsl....r+ and amn...nom me acre,. aswn ae unuana pnao+mteat and
choice. ca.n a ^an°' p
. me Lme+ e,ncae.,r
.
m,a.ume.mba mteased m .l.m..ti am and rmalrening place In Eanmoom,Indiana
E^,^pa w: x:neeia JO a+D oan -bioo^ny lnr theaor,a.In mlcandean, about
Mutuch his uptinnemg and elm career.
• Browsing through pages and itUiiluV. J.IW^s1L=
• n

VItflaUntts CvY/vrYe J pend Data. Dead telAh „ c aako:_


selecting links to move from one ^ •^sN^u-
^ Y-P'% ' b
page to another. =ire.• . s
+ ^-
L
- m.1amarnno.ann ..vrvinel., p .e.. a• eumn...,..,.
,KM1:aum.venA, anm - Mged Dans.m tone. oenral
a re
xWa a Maaa Roth- dam pout AA.ch onyaapU.ypy
ss-
mass- _
Finding information Rftn^enb BAOrb "Yahoel

using a directory service


Some search engines, for example Figure 7.9 Yahoo!'s home page, showing broad categories
Yahoo! and MSN, provide users with a
directory on their home page a ^a.
Us., Fa,.. >
containing a list of broad categories © ^r^s^^-® ak a J 4
such as Education, Recreation and Y1v11kLvIY Y ^
had

PWOWIw. M4
Sports, A rt s and Humanities and many SEARCH
m
flatten ueWeb O l MOO eawy 1 0lniecamgory

more, as shown in Figure 7.9. When


colrouE•r•.wlrlla,n.E —a

you select a category, a list of sub- Oat - ce, e..,S —

categories is displayed, and selecting a CAOE60WES SPINSVn ccsnLT


—eY Oaa_a*W Bueapa Com nun
sub-category can result in further sub- • ewe.. he ew,
Bnraun pa Dell.
• cniam. p,.enm and s.Neevt E^ Dell F m,
categories. You keep selecting deeper Bm: nn(IM) IIV
.V • Cal Cwv9srl^ anus
w'.v ael4me. eom
and deeper until you see a description • ommunun •an d Nn,tine
w ,
(1 ^M • ) — as(3)
• Lem • w aee.ra. I . - • Ms,uLVoe h (a®) save din en Del sman
of a web site that you want to visit. This • Cosmic, Sen++ree. Nu. '
• Component suee
a Negryoe l
• yeah, Cem u
9Y,ded,PC
shop DidSmall
e e.g. clmea[epbvnel
makes it easy to find information and is cemmnenane Teana gWebemiT u hlm eala bin Aa e ppneMl..
. <. 00.a Oil a ma
a cmnis EEea ia (lei) ..een
w com
a Be . nseem s
one of the features that have made •
.5e
C
04 TIodo
.,(A

P...(Oa.ea fill)
pe , nn cmmon nom a
Duo
• IC* d. (® • )1221£('® ) C % NA nvAAINb
Yahoo! a popular search engine. Figure Bma£am )a P e ekek,00
n dsLPfUe dRomm,vl651•ea. It, Rut bw ,,
padS a.0 • P e Inle, arlananecaNeen (151) ies , at -m
7.10 shows the results when the • Decided Dim i,e (FI • Roua nh ansm oevenu . (I D@ " vwx cencem
oitliun - M seen and mm^ubue pan
category 'computers is selected, and . Em env y s+a amen+ n Patl
enrro.^na com
o:e Rosa

Figure 7.11 displays the sites available


when the topic 'Digital subscriber line
(DSL)' is selected. Figure 7.10
Yahoo!'s listing of sub - categories of 'Computers and Internet'

Finding information
a PIe _. e0000 n ,
* * Q
using a Uniform gDr a
©^ e^ i9 A &, ° ^ str •! ®- $ a - LJ • 4
la t ---------... --_ _J
sandd xm:n..,.m.rerc_ a.e.es..:.Jc .:•,.ae.+_.:a _ ar.nwronseAnn_I.. _ % ®m ° --
Resource Locator (URL) e,-la.I) time. gel Me p,o..
wrv. cwaa cem
• OSLSertmee DSL Prodders - Swedes ielmm&iun and lads an OSL+ervnce and makes, key queninn+ to ask DSL
You can also find information by typing • !
.
i g Nh ,n,sn uAbe3ng
inn, 1191+,10 SOMpneelvi6 and 1111eut b ne Is com
$oeakeasr BUS:nes+
p Ue ,nev
No
.
010 ,
o phone ed nquirea
. npn+L,
in a web site's direct address or . QS^prr^ + ompum
sons.. prowls, cnmpn:.a
y 11,01210
Mn pl.rar+co,anng l.l.[omnrumm^gno,+. .gaWm. compNme. nMV.vNine and OSQE.ae.
rin
.ea.aaa. na.
DR-sneeenm -paY weed l fl, and raeaxaMart. line un mcnaainq ep..a, and made
Uniform Resource Locator (URL) . p -omrs DSL vdam:aim h,cnn+ume2 and prdheeientl+. 9,a,,ed DR thin
into the 'Address' field, located at the • Q$Lld¢- IM cmwnnMo gd, IA AOSL, and dD3lechnomgie.. lam+'*. nnexavwl:v
• rwuthoo xmr DSL dendi comm me tecMnio Ay..qupipmem..ne einenm ryp.e at ee l..ev.ESlnL;ru:
9
top of the browser window, just below •
^'
\NO i _ An$L ^ Mose a k mvn+vga MvNe ApSL, vnM1Vbae on l Spa in Ihe UK
s .....
as e.

J SLTn ee oo es - p zlatlany synopsis br lhac :zness.SL


the menu bar. A uniform resource a ad need. pneal
m .eenni
nnn.
M ,ne u mvr ,M Ola thinking of using apSL technology for nAlrmn:ng
searen L„ mess DSL
pposedead hl Mnrg
DRHgdd Ta mLmiixs y s@ms - pmeMe at, p:IrWUnion In ADSL. and Menndion on hew b m+lau, eosgwalon and
locator is the address of an Internet file, :nn up Ae ... n,1unInk ma
m`
If H l N
and usually is in this format, made up ;.memoP o iCesL 3+nmle sonde
e^+^^aa+B nannane
g oume+
y
g51c _ -Hers tuner. guide, c p e vns m osLd ine v ee.rz ate:nb Mlon on pS UCk oaer heww free
M uNee limo
of four parts: A(2tIP1- narepmup TAO VUpeni,g us. AtSrO OSS nose I ucn ana nnimM men
zpne somedcne _.

: C bees. pVu see-Trtrc


r,nt es=Fnn _ouaa . compe re modem$, ISDN,+ MMMq a able, and OSL+e mn m auyermn+ehim
AMsh
wl: n M at tot reu
emau=eom Fa: heads. OS -andnaaA sanrdems+vna+ompv:i+nnv m.vnnn+..Rands rimes e.=hie oDR
Figure 7.11 f 99 PSL
Pncne
ri nd Ba0A Vma an
o
l Yabrom $LQ- allows Dan m added Di p—time ad orderInto stead inti met tot,,, p reen ueui,:cwan Read is DSL me,
The list of sites in Yahoo!'s schmamer omnax, coneuche cps. and mrvmz. .̀.1' "ens. eltlores.
..HIE . r..^ .

sub-category for 'Digital
Caboe Nr 0$Lr-comoaneun nl the se,melnaneealnldm at connection+eticea M1Ommaanee+ PC
99 0
subscriber line (DSL)'

Protocol://Server/Path/Filename
• Pro tocol: The name of the Internet protocol, usually'http', giving access
to the site.
• Server (host name, e.g. www): The computer on which the document is
located.
• Path (directo ry hierarchy): The top-level directo ry and any lower-level
sub-directories (separated by '/' characters) in which the required file is to
be found.
• Filename: The actual file name of the document.
An example is http://www.ascd.org/studyguides
http:// is the transfer protocol to be used
www is the name of the server computer
.ascd is the sub-domain name
.org is the top-level domain name (see page 93)
/ is a separator to indicate a change of directo ry in the servers' storage
medium
studyguides is the name of the document
URLs are translated into numeric addresses using the Domain Name System
(DNS).
[do LR v,w do WHU+b rodo ^6 c. Finding a web page with a known
WI ^ ,:> ^LA ` .1 J Im IM.. w.r.m1 -_ __-. • 0 ra G - ___^
address (URL)
1 Type the URL ,http://www.funnies.com'
Ion ow 5e. 5ny1^b".
F
dray
Pma. dfisp .aipited ncve avner.ertfiepye.l into the 'Address' field near the top of
YVf^*. md.dd^en Em. ---- -^
your browser window.
Top Flash Aoint* s r.p pP. e
mm N.40004, Nl py
a.n-n sm e6e>n PO '
wWrmsu Toed
. m wlawmo. 2 Click on Go.
Bar el^.utlu Tuwtlos,e e
Tv Pnhnteml. mse&W m M,,d,
Mu. Yau5a8.E IIH w_ Q ^ ^JC O(TNn Pmn
Figure 7.12 shows the home page of the
r a.w..
, np F.r M. web site http://www.funnies.com .
P. WCk 911C t.. ^.`
BbnJ.& „
W M.clw. S F

n,
^ Zwe4n0.cW..
Finding information
Pease select. caegory below or c4Y oa ane Nthe feavea cna. using key words or
^Ihd—. IVeddm¢..^.mi•:rsu.. Join,
U(- - H40001; Jokes, Pious Rrmres. 0
V eud F.,,,. said Mmd Touts
...
ih.ot You. Crxdo.do, Good Lurk.
Pnru,u,¢.menc Sm ,th...h.
phrases
Hi H.pa, Thmlva ofl'o¢
Loin, R. e.. ddfvim.lsaC* You can also find information by typing
Email l.le. CaY DIe. Good Mer®a.
J.r H..o.: COlt
into a search-field one or more keywords or
phrases that indicate the topic you would
like to search for. The easiest way to start is
Figure 7.12 by clicking the Search button on your browser toolbar. What happens after
Finding a web page with a known that will depend on which search engine is set as the default one for your
address — www.funnies.com browser to use. Typically, your browser window will split to include a new
pane that enables you to type your search terms into a particular search
engine. Of course, there are many search engines available, and you can use
as many as you like until you find a site that you want to visit.

Searching for a web site using keywords


1 Type one or more keywords or a phrase (e.g. 'Jamaica map') into the
search box.
2 Click on the associated Go or Search button.
A list of sites that are related to the search terms will be displayed. Figure
100 •0 7.13 shows part of a web page showing some of the web sites found by Google
• when the words 'Jamaica map' were typed in and the Search button clicked.
Advanced search syntax

All search engines give you the


option of an advanced syntax (rules
of constructing searches) to narrow
down searches, so that you can find
specific information more quickly.
The syntax used may differ between
search engines, but here is some of
Me PP 055 0 .,> ,ta Lrs b H,^

Google ^^^map
Web

Map of Jamaica, NY

Jamaica Map
w
Goods Maps- Yahoo! Maps -Ma
f
® ® ©HP.IIm'm.pafy a.g >rdlldeth lm'ae

Web Imaase Gmuns Nws mare a

Tour Jamaica on the map. Mup aid rmrbmme daennklbn arid eaplom the
rlpv

B.ani

dasgnmion of your choicer The armed my to gm Cl of the mbrmstion you ...


9 noWtiNSXlS%YdIWJtliwlaa'1mY[aMw ^Yf+f+

m
^—I
Coo 111 .

Results 1 . 10 orator 9.000.0% ArJarnalca map. (11.00 seconds)


Th
the syntax used by Yahoo!: _ fanlasy,sle ccm/map him - t Ck - C.,chcd - S, c/ur oa

LoneN Planet - Jamaica Map


• Required and specific search words: home.
moors Ionelyplanet. comM1napshells/:onbb=aMamai wamaica Mm-1k - Cached - Similar panes
Placing a plus sign (+) in front of
Jamaica Map - Map of Jamaica from Conboeao-O On
a word tells Yahoo! that the word Map o!Jamal u.... Jamaica Map fo r sale Jamalce Yap by ITMB Atreml map of
Jamaica el a scale off: .Nth good topopnphic St This is a bided....
must be included in all search onbtear.or.11ne com§m,rdmr y. shtml-35k-:ached . Similar fares

Maps of Jamaica. N 7 Kingston and Momaao Say ffom Caribbean


results. Detailed ma ps ofJema ca, IGngmon, Dcho Rm. Marietta Bay and Port Mtoniu.
wow caribbearvorhne co rmIi Mmm shorn! -3 k - Czchrd-Similar paves
• Conversely, placing a minus sign
Jamaica map and informaion page by World Atlas
(-) in front of a word specifies that dot. Maps and mom_. a mm rJem al ca O ut line Nap hare .- emmv WeN InSas Yep
hem anmaJamal ca (Complete) info rmation an the (GDP) overa ll economy, ..
the word must not be included in r.uddallas comlwebimage/counlrysmamenca/canbbi]m roo m. 26k . Cached . Similar ae=

any of the search results. CIA -The Wodtl Factbook - Jamaica


ove
• Phrase-matching: Placing double
quotes ("...") around a string of
words tells Yahoo! that all search Figure 7.13
results must contain the string in Search using keywords
that exact sequence.

HyperText Markup Language (HTML)


HTML is a programming language that you can use to create web pages. It
contains standard codes that are used to specify how a web page is
structured and formatted. They determine the appearance of the web page
when it is displayed by your browser. HTML also contains tags that are used
to create hyperlinks to access related information on the web.

New services offered using the World Wide Web

Webcasts
The delivery of live or delayed sound or video broadcasts over the world
wide web is called webcasting. The sound or video is captured by
conventional video or audio systems. It is then digitised and 'streamed' on a
web server. Live webcasting is commonly used to transmit radio. For
example, if you are a student from St Lucia studying a long way from home
in the United States, it might still be possible for you to listen live to your
favourite radio station in Castries, using your computer's speakers and
Internet connection. With delayed webcasting, individual web users can
usually connect to the server via a web site to view/listen to the webcast at a
time of their choosing. In both cases, the transmission is one-way, without
any interaction between the presenter and the audience.

Web mars
The term webinar is short for web-based seminar and refers to conducting
a seminar or lecture via the World Wide Web, using graphics (often slides),
text, even live voice. Unlike webcasting, the audience is able to interact with
the presenter, for example by 'asking' questions by sending an instant
message. This interactive element allows the presenter and the audience to
give, receive and discuss information. •
101 IS•

Intranets
An intranet can be considered as a micro-version of the Internet within a
company or organisation. It offers the same features as the global Internet,
but in a localised environment such as a factory site or an office. Many
companies handle large volumes of information such as:
• Training manuals
• Company reports
• Job openings and descriptions
• Newsletters.
Authorised users within a company can use the company's intranet to find
information easily and quickly. The documents in an intranet contain tags
that provide links to other documents found in the company's network (or
n outside on the wider Internet). This is handled using the same browsers,
other software and TCP/IP as used for the Internet.

Extranet
If a company has an intranet and allows limited access to it by people
outside the company, the intranet is referred to as an extranet. A company
may set up an extranet, for example, to provide technical support
information to its customers based on products it sells or services it
provides.

102 ^0
12 The four main types of service available on the
Summary Internet are:
1 'Data communication' refers to the transmission of
data from one location to another for direct use or
• Communication services, including e-mail and
electronic discussion forums (mailing lists,
7
for further processing. newsgroups, chat rooms and bulletin boards)
2 The data communication channels used to carry • File Transfer Protocol (FTP) services which
data can be classified into narrow-band, voice- enable you to locate and use electronic files
band and broadband, depending on the volume of stored on computers across the Internet
data that can be transmitted. • Tbrminal emulation services such as Tdlnet
The transmission lines that carry the data are which enable you to use your computer to
classified according to the direction of data flow: connect to a remote host, as if your computer
simplex, half-duplex or full-duplex. were a terminal of the host computer
• The World Wide Web (WWW).
A local area network (LAN) is a collection of
13 A bulletin board system (BBS) is an Internet
microcomputers connected within a small
facility dedicated to the exchange of messages.
geographical area so that they can share
14 Broadcasting refers to the distribution of
information and peripherals, and also
information, programming or advertising content
communicate with each other.
to everyone on a network.
LANs can be divided into two categories: 15 Narrowcasting refers to the targeted distribution of
client/server networks and peer-to-peer networks. information, programming or advertising content
The connection in a LAN can be through cables or to specific individuals or venues.
wireless. Some typical configuration topologies of 16 Point-to-point protocol (PPP) enables systems to
LANs are bus, star and ring. dial into a local Internet service provider to
A wide area network (WAN) can connect connect securely to their corporate network
computers and peripherals across a large through the Internet.
geographical area such as a city, a state or 17 Webcast is the delivery of live or delayed sound or
countries. Information is transmitted using special video broadcasts conducted over the World Wide
high-speed telephone lines, microwave links, Web.
satellite links or a combination of all three. 18 Webinar is the conducting of a seminar or lecture
via the World Wide Web.
The Internet is a network of networks that
connects computers across the globe. Tb connect 19 The World Wide Web consists of hypertext and
hypermedia documents. A hypertext document
to the Internet you need a personal computer or
workstation, a modem, a communications link enables you to use hyperlinks to move from one
document in a computer to another related
such as a telephone line, cable or satellite, and
document, either in the same computer or in
access to an Internet service provider (ISP).
another computer elsewhere.
9 A standard phone modem is a hardware device
20 HyperText'Iansfer Protocol (HTTP) is a set of
that converts analogue signals to digital signals
rules governing how data travels between server
and vice versa. Other types of modems that do not
and client computers on the Internet.
convert analogue to digital signals are ISDN 21 A web site consists of web pages built using
modems and ADSL modems. specialised programming languages such as
10 An ISP is a company that has a direct connection HyperText Markup Language (HTML). Each web
to the Internet and gives users access to it, usually page has a unique address called its Uniform
for a fee. Resource Locator CURL).
11 lb transfer data from one computer to the next, 22 lb find, retrieve, view and send hypertext and
computers must follow a set of rules called hypermedia documents over the web, you need a
protocols. The protocol used over the Internet is browser. Browsers also give you access to search
TCP/IP ' ansfer Control Protocol/Internet engines such as Yahoo!, Google and MSN, enabling
Protocol), which allows operating systems you to find information quickly by typing in
software from different computers to keywords, a phrase or a web site address.
communicate. Each computer on the Internet has 23 An intranet provides many of the features of the
a unique address called the IP address. Internet within a company or organisation.
24 An extranet is similar to an intranet except that it
allows limited access to individuals outside the


103 %

Questions True or False?


1 The Internet is owned by the
American government. Tq Fq
Fill in the blanks
2 The Internet is a world wide network
1 The Internet is a that connects
of networks. Tq Fq
computers world wide via a huge set of
telecommunications links. 3 All modems convert digital signals
to analogue signals and vice versa. Tq Fq
2A converts analogue signals to
digital signals for transmission over telephone 4 Some Internet connections allow users
lines. to have continuous Internet service. Tq Fq
3 A(n) modem is a digital device 5 TCP/IP is a hardware device found
which allows voice, video and data to be sent as on the motherboard of the computer. Tq Fq
digital signals over ordinary copper wire 6 A browser is used to navigate the WWW. T q F q
telephone lines or fibre optic cables. 7 Yahoo! is a browser. Tq Fq
4 Computers connected to the Internet use a 8 Each computer has a unique IP
protocol called address that identifies it on the
5A is needed to navigate the WWW. Internet. Tq Fq
6 The address identifies a computer as 9 The Internet and the WWW are the
a node on the Internet. same. Tq Fq
7 The system was developed to 10 A document such as a Word file or
allow users to refer to hosts by names. Excel file can be attached to an e-mail
8 enable users to send electronic to be sent to some one on the WWW Tq Fq
messages (text, sound, video and graphics) to one 11 Thrminal emulation is a service
W.
individual or to a gtqup of individuals on the WWW. available on the Internet. Tq Fq
9 The is a computer on the Internet that 12 HTTP is a set of rules that controls
operates like the traditional post office. how data travels between a server and
10 A is a program that enables you to read a client. Tq Fq
and compose e-mail messages, send e-mail, and 13 Microsoft Internet Explorer is a
access e-mail from a server. search engine. Tq Fq
11 A(n) is a group of people using 14 A web site's URL can be typed into
e-mail to communicate their views on common the search box of a search engine to
issues or interests. access the information on the site. Tq Fq
12 With a user on the web can 15 An extranet is a network that gives
contact another user currently logged on and type access to every one on the Internet. Tq Fq
a conversation.
13 means to take a file from one
computer on the Internet and copy it to a storage
device on your computer. Multiple choice
1 The Internet was started by:
14 is a set of rules for
communicating over the Internet. (a) Universities around the world
15 is a general name for documents (b) Large organisations in the USA
that contain links to texts, graphics, sound or video (c) The United States Department of Defence
files. (d) All of the above
16 A allows users to find information 2 The Internet is owned by:
quickly and easily on the web.
(a) A world-wide governing body
17 A web site's direct address is also known as
(b) The United States government
(c) Large organisations
18 A can be considered as a micro-
version of the Internet within a company or (d) No single organisation
organisation.


104 .•

The following statement is true about the Short answer questions
Internet:
1 Many individuals and organisations are connected
(a) Viruses can be easily downloaded to the Internet.
(b) It contains a lot of inaccurate information (a) What is the Internet?
(c) There are many sites that promote (b) List the hardware requirements needed to
pornography and religious and racial connect to the Internet.
propaganda
2 Explain the term 'Internet Service Provider'.
(d) All of the above
3 List and explain THREE types of communication
4 TCP/IP is a protocol suite that was designed to be links that maybe used to get an Internet
used with: connection.
(a) Apple computers 4 What is an IP address and why is it necessary?
(b) All computers 5 Define the terms:
(c) IBM-compatible computers (i.e. PCs) (a) Protocol
(d) None of the above (b) TCP/IP
The following is not a browser: (c) Router
(a) Google 6 List the four main types of'services available on
(b) Microsoft Internet Explorer the Internet.
(c) Netscape Navigator 7 List the different types of modems and explain
(d) Mozilla Firefox how they differ.
6 You can do the following with browsers: 8 Many people now use e-mail for sending letters.
(a) View hundreds of millions of web pages all (a) What is e-mail?
over the world (b) List THREE advantage' and TWO
(b) Send and receive e-mail disadvantages of e-mail over normal mail.
(c) Participate in on-line conferences (c) Why does a user need to have a password to
(d) All of the above access and send e-mail?
7 The IP address of a computer on the Internet (d) Give TWO advantages of using e-mail as
consists of: opposed to using a phone.
(a) 4 bits 9 Define the following:
(b) 8 bits (a) Mail server
(c) 16 bits (b) Mail client
10 What is the difference between a mailing list and a
(d) 32 bits
newsgroup?
8 'Ib upload a file means to:
11 List and explain THREE different methods of
(a) Move your file from your diskette to the hard chatting.
1 drive
12 Explain the following:
(b) Copy information from a web site to your hard
drive (a) FTP
(c) Send files from your computer to other (b) Thrminal emulation services
computers on the Internet 13 What is the difference between the Internet and
(d) None of the above the World Wide Web?
14 Explain the following:
9 Which of the following would you use to create
web pages? (a) Hypertext
(a) HTML (b) Hypermedia
(b) FTP (c) Hyperlink
(c) HTTP (d) HTTP
(d) TCP/IP (e) HTML


105 S0

15 (a) What is a search engine? Crossword
(b) Give the names of THREE popular search
engines.
(c) Explain how information can be found using a
search engine of your choice.
16 (a) What is a browser?
(b) Give the names of TWO browsers.
(c) List the main features of a browser.
17 Give TWO examples of how a browser may be
used for:
(a) Business purposes
(b) Personal use
18 Explain the difference between uploading and
downloading.
19 With the aid of examples, explain what URLs are.
20 How does an intranet differ from the Internet?
21 What are some of the benefits that can be gained
by a company that has set up an intranet?
22 Explain the term extranet.
23 Using an example, briefly explain how the Domain
Name System operates. Across
1 An area of storage allocated to you by a mailserver
(7)
3 A set of rules that defines how computers interact
or communicate with each other (8)
6 This topology connects the computers on the
network through a central hub (4)
7 It runs the networking software that allow
resources to be shared with other computers on
the network (6)
8 The term used to describe the copying of a file
from one computer on the Internet to a storage
device on your computer (8)

Down
2 Used to navigate the WWW (7)
4 A device or computer designed specifically for
sending packets of data to their correct destination
(6)
5 An interface that enables communication between
two different networks (7)
e are faced with problems every day, from the time we get out of
bed in the morning until the time we fall asleep at night. A problem
is any task that requires a solution. The problem may be simple or
complex. In order to come up with a solution we must:
1 Have a clear understanding of the problem.
2 Determine what we need to help solve the problem.
3 Decide what results we want to achieve.
4 Consider different ways to achieve our result and select the best one.

Let's look at a picture that depicts a neighbourhood in which a house and a


school are located (Figure 8.1).
We can come up with a step-by-step sequence of instructions to get from the
house to the school. For example:
1 Enter the car
2 'urn right into the road when safe to do so
3 Drive forward to the stop sign
4 Stop the car
5 lbrn left onto the main street when safe to do so
6 Drive forward to the traffic light
7 Thrn left on the signal of the traffic light
8 Drive forward to the school
9 Turn right into the car park when safe to do so
10 Park the car
11 Exit the car
This problem, and its solution, is from the real world; computers can also
solve problems using a similar logic.
A computer program is a series of coded instructions for the computer to
obey in order to solve a problem. The computer executes these instructions
(obeys the instructions) when told to do so by the user. The number of these
instructions varies, depending on the complexity of the problem.
An algorithm is a sequence of instructions which, if followed, produces a
solution to the given problem. At the end of each instruction, there is no
question as to what needs to be done next, and the instructions eventually
come to an end. An algorithm is written using special rules and statements.

A pseudocode is an algorithm that models or resembles the real


programming language of the computer. It cannot be executed by the
computer.
Algorithms, pseudocode and computer programs are written using the
specific rules and statements of the particular computer language being
used, much like grammar rules in the English language. The specific rules
for writing in the particular computer language is known as syntax.

Figure 8.1

107 •

Generations of
computer languages
Computer languages can be classified according to whether they are low
level or high level.

Low level languages are machine dependent. Different brands of computer


use different program codes.
The program code written for one brand of CPU will not run on another
brand of CPU as codes are written with the internal operations and
architecture of a pa rt icular CPU in mind.

High level languages are independent of the machine. They are not
specifically designed for any one brand of computer.

Many computer languages have been developed and evolved over the years.
They can be classified according to the following generations.

First generation (1GL) - low level language


Machine language is w ri tten using is and Os, i.e. binary code. This is the
inte rn al language of computers as you have seen in Chapter 5. It is the only
instruction that the CPU understands and can obey or execute directly
without having to translate it. The physical workings of computers rely on
this system. An example of machine code is:

1101 1101 1011 1011

1110 0001 1100 0111

0010 1110 1011 0011

Characteristics of 1GL
• Fastest to execute because it is already in the language that
the computer can understand
• Difficult to decipher (requires the aid of a reference manual
to decipher the meaning of each code)
• Easy to make mistakes in the sequence of 1 s and Os; replacing a 1 for
a 0 can result in the wrong command/instruction being executed
• Time consuming/tedious to w ri te
• Machine dependent
• Programming becomes more difficult as the complexity of the
program increases

Second generation language (2GL) - low


level language
Assembly language is written using mnemonic codes, short codes that
suggest their meaning and are therefore easier to remember. These codes
represent operations, addresses that relate to main memory, and storage
registers of the computer. Typical codes might be: LDA, STO, ADD, NOP, etc.
An example of a program code to add and store two numbers would be:

LDA A, 20 load accumulator A with the value 20


ADD A, 10 add the value 10 to accumulator A
STO B, A store contents of accumulator A into storage register B
108 ^0 NOP no operation (stop here)

Characteristics of 2GL
• Easier to write than machine language
• As with machine language, assembly language is machine
dependent

Third generation (3GL) - high level language


This generation of languages was designed so that it is even easier for
humans to understand.

Characteristics of 3GL
• It uses English words and symbols, and is therefore even
easier to write
• It is machine independent Table 1
Some examples of third
generation languages

Language Example

Pascal PROGRAM Addition (Input, Output);


Designed to be used in teaching VAR
programming, and in business programs. Numl, Num2, Sum: Integer;
BEGIN
Pascal was developed by Niklaus Wirth, READLN (Numl, Num2);
a Swiss computer scientist in 1970, and Sum : = Numl + Num2
is named after Blaise Pascal, the 17th- END
century mathematician who invented
the mechanical calculator.
L _
BASIC - Beginner's All-purpose 10 INPUT Num1
Symbolic Instruction Code 20 INPUT Num2
Designed for beginners to use 30 Sum 3 Numl&Num2
40 PRINT Sum
C - developed by Bell Laboratories #INCLUDE <STDIO.H> MAIN O
in the USA (now AT£ff)
Used for both high and low INT Numl, Num2, Sum;
level programming. Read (Numl, Num2);
Sum = Numl +Num2;
Printf (Sum);
}

FORTRAN - FORmulator c Program to find the sum of 2 numbers


TRANslator INTEGER Numl, Num2, Sum
Designed for use by engineers and READ (10, 20) Numl, Num2
scientists for complex mathematical 10 Format (14, 14)
calculations Sum = Numl +Num2
Print, Sum
Stop
End


109 %

COBOL - COmmon IDENTIFICATION DIVISION.
Business Oriented PROGRAM-ID. SUM OF TWO NUMBERS.

3 Language

In business, finance and administrative


ENVIRONMENT DIVISION.

DATA DIVISION.
systems, used to manipulate large WORKING-STORAGE SECTION.
databases,files and business applications. 01 Numl PIC 99 VALUE ZEROS.
Can be a tedious language to w ri te. 01 Num2 PIC 99 VALUE ZEROS.
01 Sum PIC 999 VALUE ZEROS.

PROCEDURE DIVISION.
DISPLAY "Enter First Number:" WITH NO
ADVANCING
ACCEPT Numl
DISPLAY "Enter Second Number:" WITH NO
ADVANCING
ACCEPT Num2
ADD Numl, Num2 GIVING Sum
DISPLAY "Sum l's = ", Sum
END-PERFORM.
STOP RUN.

Fourth generation (4GL) — high level language


Did you know? 9
The standard
international unit
Characteristics of 4GL
• Designed for the development of commercial business software
of pressure in physics
• Uses English-like statements that are very user friendly, hence
- Pa, or pascal -
programs are easier to write
was also named after
• This reduces the time taken to write programs
Blaise Pascal.
• It also reduces the cost of software development
• Fourth generation languages contain a built in 'function wizard' to
assist the user in solving problems

4GL languages fall into the following categories:


• Database query languages, e.g. SQL (Structured Query Language)
• Report generators, e.g. Oracle Repo rt , RPG-H, RPG-III, RPG-IV (Repo rt
Program Generator)
• Data manipulation, analysis and repor ti ng languages, e.g. Focus
• Data stream languages, e.g. Iris Explo re r
• Screen painters and generators, e.g.
Oracle Forms
• GUI (graphical user interface) t USE STOCKLIST
creators, e.g. Visual Basic ` SELECT ALL Items WHERE
Here is an example of SQL programming Price > $10.00
code:

Fifth generation Languages (5GL)


— high level language
5GLs are designed to build specific programs that help the computer solve
specific problems. They are essentially 4GLs with a knowledge base. The
programmer only needs to be conce rn ed with the problem and the
constraints or conditions to be met for that par ti cular problem. The main
S difference between 4GLs and 5GLs is that 4GLs are designed to build
specific programs while 5GLs are designed to make the computer solve the
110 ^0
problem for you: all codes for the 5GLs are automatically generated.

A 5GL program is written by specifying certain parameters and constraints.
It uses a visual or graphical development interface to create a program that
is usually compiled with a 3GL or 4GL programming language compiler (a whatis
7
program used to convert the program language to machine code). 5GLs are 1 Z
used mainly in artificial intelligence.
2 Explain the \ •
Examples of 5GLs are OPS5 (Official Production System), Prolog (Logical
Programming) and Mercury. difference between
fourth generation
Here is an example of Prolog programming language: languages and fifth
dog(sparkie). (The program code "Sparkie is a dog") generation languages.
3 List THREE
?- dog(sparkie). (Question asked "Is Sparkie a dog?") characteristics of first
yes. (The program returns yes) generation languages.
?- dog(spot). (Question asked "Is Spot a dog?") 4 What is the difference
between assembly
no. (The program returns no.) language and machine
You must remember that, in reality, the computer does not understand language?
Pascal or any of the high level languages. Computers work in machine code 5 A programmer wishes
or machine language, as we saw earlier. A compiler or interpreter to write a program in a
converts the programs into the machine language of the computer you are low level language
using, the language that that computer understands. Only then can the rather than a high level
program be executed. language. Explain why
she would want to do
this. List TWO
advantages of using
Program development - low level languages
steps in algorithm development,! and two disadvantages.
As we saw at the start of the chapter, we can approach a problem by going
through a set of steps. In computing, we do the following:
1 Define the problem
2 Analyse the problem
3 Develop an algorithm/method of solving the problem
4 Write a computer program corresponding to the algorithm
5 Test and debug the program
6 Document the program (a written explanation of how the program
works and how to use it).

Step 1 - defining the problem •
In defining the problem there must be no ambiguity. The problem should be
clear and concise and have only one meaning.
Examples of unambiguous problems are:
• Calculating the price of an item after a 10% discount
• Converting a temperature from ° C to ° F
• Computing the average rainfall for the month of May in a certain place.

Step 2- analysing the problem`


In order to write a program to accomplish a certain task you must analyse
the task as a sequence of instructions that can be performed by the
computer.
These instructions can be divided into three main parts: Input and Storage
instructions, Processing instructions and Output instructions. 11•.•

Input and Storage instructions
These instructions allow information or data to be accepted by the
computer. The input is information that is needed by the computer to solve
the problem. Words such as 'Enter', 'Input' and 'Read' within problem
statements usually indicate what data the computer requires.

Example 1
What are the input and storage instuctions here?
1 Read the price of an item and calculate the discount of 10%.
2 Enter the name and year of birth of a person and calculate the person's age.
3 Input the length of a side of a square tile and find the area.
Let's analyse these instructions to determine the inputs and what we need
to store.
1 read and store the price of an item
2 enter the name and year of birth of a person
3 input the length of the side of a square tile

Processing instructions
These instructions manipulate the input data. They involve calculations,
that is, mathematical operations (e.g. addition, subtraction, multiplication
and division), repeating instructions, selecting instructions and comparison
instructions. They also include commands and constructs.
A command is a word that instructs
the computer what must be done to
accomplish a specific task. Commands I F a < 10 THEN
are specific to a particular READ Nun

programming language: for example, ENDI F

WRITE, PRINT, READ, INPUT, etc.


A construct is a group of instructions that work together with commands to
accomplish a specific task. An example is the 'IF-THEN' construct:
Problem statements that contain the words 'calculate', 'compute', 'convert',
'add', 'sum', 'subtract', 'minus', 'multiply', 'divide', 'percentage', 'average',
indicate what needs to be done. Problem statements can also imply what
needs to be processed by looking at what results are required for output; for
example: 'Print the area of the room'.

Example 2
What are the processing instructions here?
1 Read the price of an item and calculate the new price after a 10% discount.
2 Enter a temperature in degrees Celsius and convert it to degrees Fahrenheit.
3 Input the name and year of birth and compute and print the age of a person.
Let's arrlyse these instructions to determine what we need to process.
calculate the new price after a 10% discount
2 convert it to degrees Fahrenheit
3 compute the age of a person

Repeat statements and comparison statements


• These are the repeating instructions and comparison instructions
112 mentioned above.
•••
• Compa ri son/selec ti on/decision statements involve determining whether a
condition is true or false in order to perform a set of instructions. •
For example:
Read the weekly hours worked by an employee. If the hours worked are
greater than 40, then calculate overtime salary at 1.5 times the standard
hourly rate of $8.50, for those hours over 40.
The condition that is checked is the number of hours worked to
determine if it is more than 40.
• Repeat statements/loopings/iterations are used when a problem has to be
done a number of times.
For example:
Read the marks for three subjects, English, Maths and Spanish, for each
student; find the average mark of each student in a class of 15, over the three
subjects.
The process of finding the average for the three subjects has to be
repeated 15 times.

Output instructions.
These instructions allow information to be displayed on the screen. Problem
statements that include key words like 'print', 'output', 'display', 'return' and
' write' indicate what data should be output to the screen.

Example 3
What are the output statements here?
I Enter the name and year of birth of a person and compute and display the
age of the person.
2 Write an algorithm to print a conversion table of degrees Celsius to degrees
Fahrenheit, 10 °C to 20 °C inclusive.
Let's analyse these instructions to determine what we need to output.
1 display the age of the person
2 print a conversion table
Let's analyse a few problems.

Example 4
Write a program to enter the base and height of a triangle and find and print
the area.

Input & Storage P ro cessing Output


Base Calculate Area Area
Height Area = (Base * Height)/2

Example 5
Write a program to read the temperature in degrees Celsius (°C) and convert
it to degrees Fahrenheit (F) where F = 32 + (9C/5). Output the temperature
in degrees Celsius and Fahrenheit.

Input & Storage P ro cessing Output

C Calculate Fahrenheit C
F = 32+(9C/5) F •
113 ^•

Variables
In the memory of a computer are storage cells (or bytes), each of which has
a unique address. Data occupy these storage locations rather like the way
• people occupy houses. A person living in a particular house can be located
by their surname or house number; similarly, memory locations are given
names that allow the computer to locate the relevant data easily. It is easier
to refer to the data by name.

During the execution of the program, instructions may cause the contents in
these memory locations to change or vary, hence the term variable.
Variable names should always be meaningful: they should convey the
meaning of what is being stored.

There are two types of variables numeric and string variables.


Numeric variables are used to Storage Locations
store numbers only. String
Jack 160 13 78
variables are used to store a set,
or string, of characters. Look at Firstname Height Age Marks
this example:
Variable Names
Notice that you cannot store the
name 'Jack' in the storage location for age.

Writing instructions
Data input and storage instructions
These instructions accept data that is entered into the computer and store
the value in the location with the given variable names.

Commands used to input data are READ or INPUT.


Syntax: READ < Variable name > , < Variable name >

Example: READ Name, Score

Prompting instructions
Prompting statements are used along with input statements to request or
notify the user to enter data into the computer. These statements are usually
displayed on the screen. Prompting instructions usually precede input
instructions.
Commands used to prompt the user are PRINT or WRITE.

Syntax: PRINT < String >


Example: PRINT "Enter student name"

Example 9
(a) Let's look at the question from Example 4:
Wri te a program to enter the base and height of a triangle and find and print the
area.
The inputs were base and height.

PRINT "Enter the Base"


PRINT "Enter the Base, Or READ Base
Height of the triangle" PRINT "Enter the Height"
• READ Base, Height READ Height

116 ^•

(b) Look at the question from Example 5:
Write a program to read the temperature in degrees
Celsius (°C) and convert it to degrees Fahrenheit (F) PRINT "Enter temperature in Celsius (C)" •
where F = 32 + (9C/5). Output the temperature in READ C
degrees Celsius and Fahrenheit.
(c)Look at the question from Example 6:
Write a program to read the answer to the sum 10
PRINT "Enter the answer for the problem 10 * 12 ="
* 12. (The answer is 120.) Retu rn the comment READ Answer
'Co rrect" if the answer is right and "Incorrect" if
the answer is wrong.
(d) Look at the question from Example 7:
Write a program that reads the result of 10 games played by a
team and find the percentage of games won by the team.Output PRINT "Enter game results (Results)"
the percentage of games won. READ Results

The fo tng questi ons will 2 Write an instruction to enter 6


+ b—c(c+d)
0•
0•
allow you to practise w riting the length and width of a write an instruction •
prompting, input and storage pool. to enter values for a, b, c
instructions. The first question 3 Write an instruction to read and d.
has been answered for you. the height and weight of an 7 Write an instruction to input
1 Write an instruction to read individual, the price of a textbook and
N. 4 Write an instruction to read the percentage discount
Answer: the names of students, their given.
school houses and the places 8 Write an instruction to enter
PRINT "Enter a value for N"
they came in a spo rting the size (length and width) of
READ N event, a wall and the size of tile
5 Write an instruction to read a (length and width) used to
time. cover the wall.

Output instructions
These instructions display/output data that is in the computer's memory.
Commands used to output data are PRINT or WRITE. You can output string
variables and numeric variables as follows.
Syntax: PRINT < Variable name > , < Variable name >
Example:

PRINT Name, Score Jane Doe, 78


PRINT Percentage 15

Value of variables
Jane Doe 78

Name Score Variable names

The value of a variable is printed, for example, 'Jane Doe' and '78' are •
p ri nted.
117 ^•

Outputting a string constant
Whgn a string constant is P rinted the exact characters within the quotation
marks are p rinted.
Syntax: PRINT
"String" PRINT "Carlos is my name." Carlos is my name.
PRINT "Time" Time
Example: PRINT "Sum = 3 + 4" Sum = 3 + 4

Outputting a string constant and a variable


It may become necessary to output a label for a variable to identify what is
being printed.
For example, if $4.35 is printed by itself, you may not know what it means
unless a descriptor or label goes along with it, such as:
The total cost is: $4.35
Syntax: PRINT "String", < Variable >
Example: Print "The total cost is:", Cost

Wri te output instructions for the 5 Write an algorithm to read a R Write an algorithm ^•
following problems. time and output the message: to read the name and
1 Write an algo ri thm to display 'At a time like this', time, 'who amount on a cheque
'My name is Carla'. needs enemies'. and display this
2 Write an algorithm to output 6 Write an instruction to print information.
the number of adults and the average score of 25 9 Input and output the
children on a flight, students, and the name and following information: the
approp ri ately labelled. mark of the person receiving name, age and sex of a
3 Write an algo rithm to output the highest mark. person, appropriately
'Warning: Read all labels 7 Print the name of an item, labelled.
before washing'. cost of the item, the price 10 Print the principal, rate, time
4 Write an algorithm to output inclusive of the VAT, the and interest for a loan.
the message 'At times like discount, and the fi nal price
this, who needs enemies'. of the item.

Calculations
The mathematical operators for addition (+), subtraction (-), multiplication
(*) and division (/) are used in writing calculation statements. The equal
sign in a calculation statement is known as the assignment symbol.
Variables are assigned the results of the calcula tion.
For example: Memory locations storing the
A=B+C 6 2 4 values of variables A, B& C
ABC Variable names

In this statement the variable A is assigned the result of the calculation of


B + C, so that the memory location A will hold the result of the calculation
• performed on the variables B and C.
Syntax: < Va ri able > = < actual calculation >
118 0
••
Examples:
Area = (Base * Height)/2
F = 32 + (9C/5)
PercentageWins = TbtalWins/10
Calculation statements are always written with a variable being assigned the
value of a calculation, rather than a calculation being assigned a va ri able.
Incorrect syntax: < actual calculation > = < Variable >
Incorrect example: (Base * Height)/2 = Area

Write calculation instructions for 5 Read the cost of a meal at a needed to cover ^•
the following problems. restaurant. If a 10% service the wall, adding 10% ^•
1 Enter the length and width of charge were added to the bill, more tiles to cover for
a pool and calculate and print write an algorithm to breakage. Print the size of
the length of rope needed to calculate and return the total the wall, the size of tiles
cord off the pool. amount on the bill. used and the total number of
2 Input the price of a textbook. 6 Write a program to read the blocks needed, inclusive of
Calculate and print the total temperature in degrees number of tiles added to
cost of the book after 15% Celsius (°C) and convert it to cover breakage.
VAT is added. degrees Fahrenheit (F) where 9 Read the height in inches and
3 Pipes are laid by an oil F = 32 + (9C/5). Output the weight in pounds of an
company. If the company has temperature in degrees individual and compute and
to lay down 3 km of pipes and Celsius and Fahrenheit. print their BMI (body mass
each pipe is 25 metres long, 7 + b — c(c + d) Write an index). BMI =
calculate and print the a instruction to ((weight/height)/height)
enter values for a, b, c and d 703.
number of pipes needed to
cover the distance. and compute and print the 10 A carpenter is paid a contract
4 Enter the size of a wall in result of the equation. fee of $2000.00 for 3 days
square metres, to be laid 8 Write an instruction to enter work. He hires 3 workers who
between two columns. If the the size (length and width) of work for the 3 days at $75.00
area of one brick is 0.6 m2, a wall and the size of tile a day. Calculate and print the
calculate and print the (length and width) in square amount of money paid to
number of bricks required to metres used to cover the wall. each worker, the total paid to
build the wall. Estimate the number of tiles all workers and the amount
the carpenter is left with.

Comparison/selection/decision statements Table 8.2


It sometimes becomes necessary when processing data to
compare the value of a variable to the value of another variable, Relational Meaning
or to compare the value of a variable to that of a constant. operator
The following relational operators are used to make such = Equal to
compa ri sons.
<>,# + Not equal to
A condition is an expression that when evaluated gives either a
> Greater than
TRUE or a FALSE. This expression is called a Boolean expression.
These conditions use the relational operators between two < Less than
va riables, or between a variable and a constant. >_ Greater than or equal to
Examples: <= Less than or equal to
Boys in Class > = 35
Number of Boys < > Number of Girls 119 %
The IF-THEN construct
The IF-THEN construct contains a condition which is tested before an action
can be undertaken. If the condition holds true, then the action is taken.
Otherwise, the instruction statements between IF-THEN and ENDIF are not
taken but are ignored.

Syntax:

IF < condition > THEN

<Action to be taken if condition is true >

(that is, instruction statements that would be performed if the conditions are
met)
ENDIF

Example 10
A company gives out bonuses based on the amount of income generated by their
sales representatives per month. Once the income is greater than $5000. 00, a
bonus of 10% of the generated income is given to the employees. Read the income
generated and print the bonus.
The decision to give a bonus is based on the amount of income the sales
representative generates.

Input/read the Income Generated.

The action to be taken is the calculation and printing of the bonus.


Only if the Income Generated is greater than $5000.00 is the bonus
calculated.

Case 1

We must be aware of
where the PRINT PRINT "Enter the Income-Generated"
READ Income-Generated
statement is placed. If it
IF Income-Generated > $5000.00 THEN
is placed within the IF-
Bonus = Income-Generated * 10%
THEN-ENDIF construct, PRINT "Bonus", Bonus
only if the income ENDIF
generated is greater than
$5000.00 is the bonus
printed.

Case 2

In this case, the PRINT


statement is placed PRINT "Enter the Income-Generated"
READ Income-Generated
outside the IF-THEN-
IF Income-Generated > $5000.00 THEN
ENDIF construct. So the
Bonus = Income-Generated * 10%
word Bonus is printed ENDIF
regardless of whether PRINT "Bonus", Bonus
the bonus is actually
calculated or not.


120:.
Initialising a variable
It may sometimes be necessa ry or wise to initialise a va ri able, that is, to
give the variable a starting or initial value.

A variable is assigned to a position in memory that is not used. That position


may nevertheless have data stored there (from some previous operation);
this data therefore needs to be erased by setting an initial value for the
variable.

In Case 2 in Example 10, since the bonus is printed regardless of whether


the employee generates an income > $5000.00, it is necessary to void the
memory location where the variable is assigned, and initialise it to $0.00. In
this way, a figure will be printed along with the word Bonus, and not the
data that was stored from a previous operation.

Data is erased by initialising


Variable Bonus is assigned a
the variable to $0.00 which
position in memory that is not I 98474 $0.00 erases the previous value
used, but contains data 98474
from a previous operation Bonus Bonus

Case 3

In Case 3, if the income


Bonus = $0.00
generated is less than or
PRINT "Enter the Income-Generated"
equal to $5000.00 and no
READ Income-Generated
bonus is calculated then
IF Income-Generated > $5000.00 THEN
the bonus printed will be Bonus = Income-Generated * 10%
$0.00. This is because the ENDIF
figure has previously been PRINT "Bonus", Bonus
stored in memory.

Example 11
A car rental firm leases its cars for $250.00 per day. The manager give a
discount based on the number of days that the car is rented. If the rental period is
greater than or equal to 7 days then a 25% discount is given. Read the rental
period and print the discount given.
Input the rental period
The decision is based on —
the length of time the car PRINT "Enter car Rental Period"
is rented. READ Rental Period
IF Rental Period >= 7 THEN
The action is to calculate Discount = ($250.00 * Rental Period) * 25%
the discount to be given ENDI F
for the rental period. PRINT "Discount", Discount
Only if the car is rented
for 7 days or more is the
discount calculated.


121 ^•

The IF-THEN-ELSE construct
The IF-THEN-ELSE construct contains two parts: the THEN part and an
ELSE part. The condition is tested before an action can be unde rt aken. If the
condition holds TRUE, the THEN action is taken, otherwise the ELSE action
is taken if the condition is FALSE.

Indentation is used for readability, so that you can see at a glance the
structure of the construct - especially which statements belong to the THEN
pa rt , and which belong to the ELSE part.

Syntax:

IF <Condition> THEN
<THEN part: Action to be taken if condition is TRUE >

ELSE
< ELSE pa rt : Action to be taken if condition is FALSE >

ENDIF

Example 12
A company gives out bonuses based on the amount of income generated by their
sales representatives per month. Once the income is greater than $5000.00 then a
bonus of 10% of the generated income is payable; otherwise the bonus is 3% of
the generated income. Read the income generated and print the bonus.

PRINT "Enter Income-Generated"


READ Income-Generated
IF Income-Generated > $5000.00 THEN
Bonus = Income-Generated * 10%
ELSE
Bonus = Income-Generated * 3 9..
ENDIF
PRINT "Bonus", Bonus

Boolean operators
When selection is based upon one or more expressions/decisions being
TRUE or FALSE, it is possible to combine the expressions/decisions together
using the Boolean operators AND or OR.
• If the AND operator is used both conditions must be met, in order for the
total expression to be true or false.
• If the OR operator is used, either condition must be met, in order for the
total expression to be true or false.

Example 13
A club plays cricket only on Sundays, and only if it is not raining. Read the day
and the weather and print 'Game on' if it is a suitable day for playing.
What happens with each of the two operators? Let's try some algorithms.


122 ^•

With the AND operator
PRINT "Enter the Day and the Weather"
Both conditions must be met for the expression to READ Day, Weather
be true and 'Game on' is printed. If either IF Day = "Sunday" AND Weather = "No Rain" THEN
condition is not met, such as the day is not PRINT "Game on"
'Sunday' or the weather is 'Rain', then the action ENDIF
(printing 'Game on') is not taken.

With the OR operator


PRINT "Enter the Day and the Weather"
In this case, if either condition is true then the
READ Day, Weather
action is taken. So, if the day is 'Sunday', regardless IF Day = "Sunday" OR Weather = "No Rain" THEN
of the weather, the game is on. If the weather is PRINT "Game on"
'No Rain', regardless of the day, the game is on. ENDIF
In this case the game would always takes place on
a Sunday regardless of the weather; the game would
also be played any other day of the week, as long as there is no rain. The
only time the game is not played is if it is any of the days Monday to
Saturday, and it is raining on that particular day. But, note that this is not
exactly what the club wants. So, only the AND operator works to meet the
conditions set out by the club.
The AND operator is also used to limit values within a particular range.

Example 14
A company gives out bonuses based on the amount of income generated by their
sales representatives per month. Once the income is greater than $5000.00 and
less than or equal to $8000.00 then a bonus of 10% of the generated income is
given to the employee. Read the generated income and p ri nt the bonus.

PRINT "Enter Income-Generated"


READ Income-Generated
IF (Income-Generated >= $5000.00) AND (Income-Generated <= $8000.00) THEN
Bonus = Income-Generated * 10%
ENDIF
PRINT "Bonus", Bonus

q Nested selections

IF statements embedded one within another are said to be nested. For every
IF-THEN statement there must be an ENDIE
Syntax:
IF < Condition 1> THEN
<Action to be taken if condition 1 is true >
ELSE
IF <Condition2> THEN
<Action to be taken if condition 2 is met>
ELSE
IF <Condition3> THEN
<Action to be taken if condition 3 is met>
ELSE
<Action to be taken if conditions 1 to 3 are not met>
ENDIF
ENDIF 2••
:
ENDIF 1 ^
If the first condition is not met the second condition is checked, if the first
and second conditions are not met then the third condition is checked, and
so on.
Example 15
PRINT "Enter Income-Generated"
READ Income-Generated A company gives out bonuses based
IF (Income-Generated >= $10,000.00) THEN on the amount of income generated by
Bonus = Income-Generated * 20% their sales representatives per month.
ELSE Once the income generated is greater
IF (Income-Generated >= $8000.00) AND (Income-Generated than or equal to $10, 000.00 a bonus of
< $10,000.00) THEN 20 % is given. If the income generated
Bonus = Income-Generated * 15%
is greater than or equal to $8000.00
ELSE
but less than $10, 000.00 a bonus of
IF (Income-Generated >= $5000.00) AND (Income-Generated
< $8000.00) THEN
15% is given. If the income generated
Bonus = Income-Generated * 10% is greater than or equal to $5000.00
ELSE but less than $8000.00 a bonus of 10%
Bonus = Income-Generated * 3% is given. If the income generated is less
ENDIF than $5000.00 then a 3% bonus is
ENDIF given. Read the income generated and
ENDIF print the bonus.
PRINT "Bonus", Bonus

-b- b z -4ac ^•
Using the IF-THEN and IF-THEN- 6 A club plays cricket only on and 2a 0
ELSE construct write instructions Sundays and only if it is not provided that b - 4ac .
for the following problems. raining. Read the day and the <0 and a<>0.
1 Write an algorithm to read the weather and output 'Game on' 9 Write an algorithm to read
number of days a person has if the weather is good and the the withdrawal amount from a
been using a demo and display day is Sunday, or 'Play savings account. Determine if
the message "Time Up" if the suspended' if it is Sunday and there are sufficient funds in
number of days exceeds 12. it is raining. the account, and whether the
2 A video club rents videos for 7 Write an algorithm to read the daily withdrawal limit has
three days. Write an algorithm name of the student and the been exceeded. Output,
to read the date borrowed and value of the student's mark. appropriately labelled, 'Not
the present date; calculate the Print the name of the student enough funds' and 'daily
number of days borrowed. If and the appropriate grade withdrawal limit exceeded'.
the number of days borrowed based on the following grading 10 Read the height in inches and
exceeds three days compute scheme. weight in pounds of an
the number of days overdue 80 or more A individual, and compute and
and the overdue charge. Use a Less than 80 but more than or print their BMI (body mass
rate of $1.50 for every day equal to 65 B index). BMI =
overdue or part thereof. ((weight/height)/height)
Less than 65 but more than or
3 Read the weather; if the 703. If the BMI is less than
equal to 50 C
weather is sunny output 'Good 18.5, output'You are
Less than 50 but more than or underweight'; if the BMI is
day for the beach'.
equal to 35 D between 18.6 and 24.9, output
4 Read the present date,
Less than 35 F 'Your weight is normal'; if the
appointment date, time, place
Write an algorithm which BMI is between 25 and 29.9,
and contact name. If the 8
reads three values, for a, b and output'You are overweight'; if
appointment date is equal to
c, and prints the roots of the the BMI is greater than 30,
the present date, display the
e
quadratic equation ax + bx + output 'Your health is at risk,
appointment information
c = 0. The roots are you are in the obese category'.
appropriately labelled.


124 I•
I Read N; if N is greater than 100
then subtract 50 from N,
given by - b + b z
2a
4ac

otherwise multiply N by 3.

Repeat statements/looping/
counting/iterations
It is often necessary to repeat certain parts of a program a number of times.
One way of doing this would be to write that part of the program as many
times as needed. This is impractical, however, as it would make the program
lengthy. In addition, in some cases the number of times the section of code
needs to be repeated is not known beforehand.

Two of the methods used to repeat sections of instructions/codes are the


FOR construct and the WHILE construct.

You need to keep track of how many times the instructions are repeated.
Counting or iteration involves increasing the value of a counter variable by
a fixed number (this can be any value, such as 1, 2, 5, etc.) every time the
instructions are repeated. This counter can be part of a condition for
stopping the instructions from repeating when the value of the counter
becomes equal to a certain value.

Counting
Syntax:

< Counter variable > = < Counter variable > +1

' Add 1 to the counter variable: 5 + 1= 6


Before Place the value 6 back into the counter variable After
5 6
Count Count

This example simply states that 1 is added to the value of the counter
variable and the result is placed back into the counter variable. The counter
variable must be initialised before the instructions are carried out. It is x
usually set to 0; this is often, but not always, the case. The choice of name
for the counter variable can reflect what is being counted: in the case below,
NumofCars for the number of cars.

Example 16
A car rental firm leases its cars; read a car registration number and count the car.
Print the number of cars. t
S.
a i
O
PRINT "Enter a car number" PRINT "Enter a car number"
Counter = 0 NumofCars = 0
READ Car number READ Car number
Counter = Counter + 1 NumofCars = NumofCars + 1
PRINT Counter PRINT NumofCars

In these two examples the variable name 'Counter' and the variable name
'NumofCars' are used to keep track of the number of cars where 'Car Note: You can use any
Number' is the car's registration number. abbreviation or word as
a variable name to
It may become necessary to keep track of more than one item. In this case
two counter variables are needed. convey the meaning of
what is being stored. •
125 %

Example 17
A car rental firm leases its cars; read the car registration number and count the
car. If the car is a station wagon also count the number of station wagons. Print
the number of cars and the number of sta tion wagons.

PRINT "Enter a Car Registration Number and Car Type"


NumofCars = 0
NumStationWagon = 0
READ Car Number, Car Type
IF Car Type = "Station Wagon" THEN
NumStationWagon = NumStationWagon + 1
ENDIF
NumofCars = NumofCars + 1
PRINT "Number of Cars", NumofCars
PRINT "Number of Station Wagons", NumStationWagon

Cumulative totals
It often becomes necessary to keep adding values to a current total to get a
new total. For example, you may want to keep track of the total runs made
by various batsmen on a cricket team:

batsman 1:23; batsman 2: 67; batsman 3: 90, and so on.

Syntax:
< Cumulative Total > = < Cumulative Total > + < Variable >
It is important to initialise the Cumulative'Ibtal variable to 0 before the
values are added.

Example 18
A car rental firm leases its cars; read the number of cars leased in one day and
;QJ add it to the numbers of cars leased. Print the total number of cars leased.

PRINT "Enter the number of cars leased in one day"


.7 Ph TotalCars = 0
9 READ CarsLeased

^ = f TotalCars = TotalCars + CarsLeased


PRINT "Total Number of Cars Leased:", TotalCars

Loops
When a group of statements/instructions are repeated it is called a loop.
There are two types of loops.
• A finite loop is where the number of times a repetition is to be made is
known.
• An indefinite loop is where the ins tructions are repeated an
unspecified number of times.
Iteration is repeating a set of instructions over and over. One execution
of a set of statements in a loop is called an iterate.
A sentinel or terminal value is required to cause the program to exit the
loop. A sentinel value is a lookout value such that if the data being
entered ever becomes equal to the sentinel value, the computer exits the
loop. The sentinel value must not be one of the values in the list of data
• to be processed. Either the user can input this value, or the computer can
126 ^• be programmed so that a certain condition can be met, triggering the end
• of the loop.
For example, if a number of student ages in a class is to be read and the
number of students is not known, a particular value can be entered to

indicate the end of the list. This value could be 0 or 199 since none of the •
students in the class would have an age of 0 or 199. These values are
sentinel/terminal values since they indicate the end of the list.

The FOR construct


In this construct the loop is controlled by a counter which increases each
time the set of instructions is executed. This construct is used when the
number of times a set of instructions has to be repeated is known.

Syntax:

FOR < Variable > = < Beginning value > TO < Ending value > DO
<Action to be repeated >
ENDFOR

or

FOR < Variable > = < Beginning value > TO < Ending value > STEP
<incremental value> DO

<Action to be repeated > Note: the variable in


ENDFOR
the FOR construct is a
counter variable which
Example:
keeps track of the
FOR Counter = 1 TO 4 DO number of times the
<Action to be repeated > loop is executed.
ENDFOR

When this statement is executed, the counter variable is initially set to the
beginning value, in this case, 1. After the execution of the instructions
between the FOR and the ENDFOR, the counter variable is increased by 1.
The instructions are repeated and the counter variable increases until it
becomes equal to the Ending value, in this case, 4. So the instructions are
repeated four times.

Example 19
A car rental firm leases 4 cars in one day. Read the Total Rent = 0
number of days for lease of each car and calculate the FOR Counter = 1 TO 4 DO
total rent paid to the firm if a car is leased for $250.00. PRINT "Enter the number for days for
Print the total rent paid to the rental firm. lease"
READ NoofDays
The STEP clause allows you to increase the counter
Rent = NoofDays * $250.00
by the increment value every time the instructions
Total Rent = Total Rent + Rent
are repeated, until it becomes equal to or exceeds ENDFOR
the ending value. It is often used when we want to PRINT "Total rent paid to firm", Total Rent
print tables.

Example 20
Print a table to find the square and cube of numbers 1 to 10.
• In this case Number becomes set to the initial value 1. Print "Number", "Square", "Cube"
• The first time through the loop, Square becomes equal to FOR Number = 1 TO 10 DO
Square = Number * Number
Number * Number which is 1 * 1 and Cube becomes
Cube = Number * Number * Number
equal to Number * Number * Number which is 1 * 1 * 1.
Print Number, Square, Cube
• Then the Number, Square and Cube are printed. ENDFOR 127 %
r

• The second time through the loop, Number becomes set to 2 and the
Square and Cube are calculated and printed.
• This continues until Number becomes equal to the ending value, which
is 10.

Example 21
Print a table to find the
square and cube of all Print "Number", "Square", "Cube"
FOR Number = 2 TO 20 STEP 2 DO
even numbers between 2
Square = Number * Number
and 20 inclusive.
Cube = Number * Number * Number
• In this case Number Print Number, Square, Cube
becomes set to the ENDFOR
initial value 2.
• The first time
through the loop Square becomes equal to Number * Number which is 2
* 2 and Cube becomes equal to Number * Number * Number which is 2
2 * 2.
• Then the Number, Square and Cube are printed.
• The second time through the loop Number becomes set to 4 as the STEP
clause increases the value of the Number by 2 every time it goes through
the loop. The Square and Cube are calculated and printed.
• This continues until Number becomes equal to the ending value, which
is 20.

Example 22
Calculate the sum of all the odd numbers between 1 and 20. Print the total.
The statements that make up
the body of the FOR loop can Sum = 0
consist of other constructs FOR Oddnumber = 1 TO 20 STEP 2 DO
such as the IF-THEN, and IF- Sum = Sum + Oddnumber
THEN-ELSE constructs. ENDFOR
PRINT Sum

Example 23

A company gives out bonuses based on the


Print "EMPLOYEE NUMBER", "INCOME GENERATED", "BONUS" amount of income generated by their sales
FOR NumEmployees = 1 TO 10 DO
representatives per month. Once the
PRINT "Enter Employee Number, Income- Generated"
READ Employee Number, Income-Generated
income generated is greater than or equal
IF (Income-Generated >= $10,000.00) THEN to $10, 000.00 a bonus of 20 % is given. If
Bonus = Income-Generated * 20% the income generated is greater than or
ELSE equal to $8000.00 but less than $10, 000.00
IF (Income-Generated >= $8000.00) AND (Income- a bonus of 15% is given. If the income
Generated < $10,000.00) THEN generated is greater than or equal to
Bonus = Income-Generated * 15% $5000.00 but less than $8000.00 a bonus of
ELSE 10% is given. If the income generated is less
IF (Income-Generated >= $5000.00) AND (Income- than $5000.00 then a 3% bonus is given to
Generated < $8000.00) THEN the employee. Write an algorithm to read
Bonus = Income-Generated * 10%
10 employees' numbers, their income
ELSE
Bonus = Income-Generated * 3%
generated, and determine the bonuses of 10
ENDIF employees. Print the employee number,
a ENDIF income generated and the bonus earned by
ENDIF the employee.
PRINT Employee Number, Income-Generated, Bonus
The FOR loop can be used to find the
ENDFOR
maximum and minimum values in a set
128 10 of numbers.
0
Example 24
Lowest = 999999
Write an algorithm to read 25 numbers and p ri nt the FOR Count = 1 TO 25 DO •
lowest. PRINT "Enter a number" •
READ Number
You need to choose an initial value for Lowest so IF Number < Lowest THEN
that any number entered would be lower than that Lowest = Number
value. You cannot choose 0 (zero) as an initial ENDIF
value for Lowest as of the 25 numbers entered it ENDFOR
may not be the lowest value. The variable 'Count' PRINT "The lowest number entered is:", Lowest
is chosen as the va ri able counter to keep track of
the number of times the instructions are executed.

Using the FOR construct write 5 An airline does not charge for 8 Write an algorithm •
instructions for each of the babies 2 years and under; it to input an integer N. •
following problems. charges half price for children Find and output the
Write a program that reads the 2 to 12 years and the full price value generated when 2 is
result of 10 games played by a for persons above 12 years. raised to the power N, where
team and finds the percentage Read the airfare and the age of N is between 0 and 10.
of games won by the team. the person; calculate and 9 Write an algorithm to input a
Output the percentage games print the total amount paid by country and exchange rate of
won. a family of five. the country's currency against
Write an algorithm to enter 10 6 A school has a house system the US dollar. Output a table
numbers and output the implemented. Points are showing the amount of US
highest and lowest numbers awarded to a house based on dollars and the equivalent
appropriately labelled. the performance of its amount of the country's
Write an algorithm which members: 1st place - 4 points, currency, for 1 to 20 US
finds the total of the numbers 2nd place - 3 points, 3rd place dollars.
10 to 25 and print the total. - 2 points, 4th place - 1 point 10 Write an algorithm to output
and last place - no points the sum of all the even
Write an algorithm to awarded. For 10 members of
compute the following numbers in the range 2 to 40.
the A ripo house read the 11 Write a program that accepts a
expression:
place they came in the events; positive integer and prints all
2
Yl = 2(2—x )andY2 = calculate and print the total
2
2— (2 — x ) using values -4 to
numbers from the given
awarded to the house. number down to 1 inclusive.
+ 4 for the value of x. Print x, 7 Print a five-times
Yl and Y2. multiplication table for
numbers 1 through 20.

The WHILE construct


In the WHILE construct the computer executes a set of
statements/instructions repeatedly for as long as a given condition is true.
When you do not know beforehand how many times statements within a
loop are to be repeated, use the WHILE construct.
• In the WHILE construct the condition is tested; if it is true the
instructions within the WHILE and ENDWHILE are executed until the
condition becomes false and the loop is then exited.
Statements/instructions before the WHILE construct are carried out
once. The while loop is executed until the condition becomes false,
which forces the loop to stop. Then the statements after the ENDWHILE
are carried out once.
• If, after car rying out the instructions before the loop, the condition in the
WHILE loop is tested and is false, the computer skips the instructions 0
within the WHILE loop and continues with the statements after the 129 ^0
ENDWHILE. 0
• The trigger that causes the loop to stop is a value that is entered for the
input data. This value is read in within the loop and it is called a dummy
value, a terminating value or sentinel value. It must not be one of the
values in the list of data to be processed. For example, when calculating
the average age of students in a class, a dummy value could be 999, since
no one in the class will be 999 years old. This value signals the end of the
data to be entered.
Syntax:
WHILE <Condition> DO
<Action to be taken if condition is true >
ENDWHILE

Example 25
Write an algorithm PRINT "Enter the student's age"
to enter the age and READ Age
count the number Count = 0
of students in a WHILE Age <> 999 DO
class. Calculate the Iota]. = Total + Age
Count = Count + 1
average age of the PRINT "Enter the student's age"
group of students if READ Age
the data is ENDWHILE
terminated by the Average = Total/Count
value 999. Print the PRINT "Number of students:", Count
PRINT "Average ages of students:", Average
number of students
in the class and the
average age of the students.
The statements that make up the body of the WHILE loop can consist of
other constructs such as the IF-THEN, and IF-THEN-ELSE constructs.

Example 26
Note: the highest Negative = 0
Write an algorithm to Positive = 0
number is initialised to read a set of numbers PRINT "Enter a number"
0 so that any number terminated by 0; print READ Number
entered is higher than the numberofpositive WHILE Number <> 0 DO
that value. Each and the number of IF Number > 0 THEN
negative numbers. Positive = Positive + 1
number entered must ELSE
be checked against the The WHILE loop can Negative = Negative + 1
previous one. be used to find the ENDIF
maximum and PRINT °Enter a number"
minimum values in a READ Nunber
series of numbers. ENDWHILE
PRINT "Number of Negative Numbers", Negative
PRINT "Number of Positive Numbers", Positive

Example 27
Highest = 0
Write an algorithm
PRINT "Enter a number"
to read a set of
READ Number
numbers terminated WHILE Number <> 0 DO
by 0 and print the IF Number > Highest THEN
highest number. Highest = Number
ENDIF
PRINT "Enter a number"
• READ Number
ENDWHILE
130 .0 PRINT "The highest number entered is:", Highest

Using the WHILE construct write generated income is added to each purchase;
instructions for each of the the sales representative's calculate the total ^•
following problems. salary of $4000.00. Write an amount sold and the
Persons working for an algorithm to input the sales quantity remaining, if the
income between $20,000 and representative's number and number of sales and
$30,000 dollars per annum income generated; calculate quantity purchased is not
pay an income tax of $12,000 the bonus, and salary plus known in advance. Terminate
per annum. Persons working bonus. Data is terminated by the data by entering 0 for
for an income of between entering the value 000 for the quantity.
$30,000 and $40,000 per sales representative number. 8 Write an algorithm to accept
annum pay an income tax of 5 Write an algorithm to fi nd a list of positive integers.
$15,000 per annum. Read the and print the mean of a list of Each sub-list of non-zero
employee number and positive integers. The integers is terminated by a
income, and calculate the number of integers is not zero. Each time a zero is read,
total tax paid by employees. known in advance. The output the sum of the non-
Data is terminated by procedure is terminated by zero integers. The data is
employee number 000. the value 0. terminated by -1. Indicate
2 Enter the marks of students 6 A car rental firm leases its the number of non-zero
terminated by 999. Find and cars for $250.00 per day. The integers and the number of
p ri nt the average and the manager gives a discount sub-lists.
highest mark. based on the number of days 9 Write an algorithm to input
3 A resident person leaving that the car is rented. If the integers until a sentinel value
their count ry is required to rental period is greater than of 0 is entered; print the sum
pay a departure tax of or equal to 7 days then a 25% of all the positive numbers
$100.00. However, if the discount is given. Read a car entered and the sum of all
person is a visitor to the number and the rental negative numbers entered.
count ry , an additional $20.00 period, and calculate the total The number of positives and
must be paid. Read in the amount earned by the car negatives must also be
passenger number, rental firm after discounts, if printed.
terminated by 0, and whether the number of cars rented is 10 Write an algorithm to accept
the passenger is a visitor or not known in advance. The a number of integers until a
resident. Write an algorithm process is terminated by car sentinel value of 0 is reached.
to calculate the total amount number 0. The algorithm must print
of tax collected for the day. 7 A supermarket is keeping each pair of consecutive
A company gives out bonuses track of the amount in stock numbers where the first
based on the amount of of an item. Write an number is larger than the
income generated by their algorithm to keep track of second. For example: if the
sales representatives per how many of the items inputs are 1, 3, 2, 4, 5, 2, -1, 0
month. Once the income is remain at the end of the day and 0, the output would be "3,
greater than $5000.00, a if the initial quantity was 210. 2" and "5, 2" and "2, -1".
bonus of 10% of the Input the quantity bought at

Step 4- writing a
computer program ®
corresponding to the algorithm.
After developing an algorithm or method of solving the problem, the next
step is to write a computer program corresponding to the algorithm, using
programming language. Converting the algorithm to the programming
language requires the use of the specific syntax of that programming
language. •
After the program is written it must be tested and debugged. Algorithms can 131 ^•
also be tested and debugged.

Step 5- Testing and
debugging the program ,
Once an algorithm or a program is developed or written, the next stage is to
check that the algorithm or program is doing what it was designed to do, and
is doing so correctly.

There are two types of testing:


• Manual testing/dry running
• Computer testing.

Manual testing/dry running


Tracing is a technique that allows the user to detect any logic errors in the
program or algorithm. Also called dry- running or desk-checking, tracing
involves executing the program manually by using input values for variables
and recording what takes place after each instruction is executed.
A trace table is a table completed upon manual execution of an algorithm
or program to determine what the program is doing. The first action when
creating a trace table is to write down all the variables found in the
algorithm as headings, as well as the heading'OUTPUT' to represent what is
printed.

Example 28
What is printed by the following algorithms?

(a)
Count = 0
WHILE Count < = 10 DO
Count = Count + 2
PRINT Count
ENDWHILE

Count OUTPUT
0 Count is set as 0; Count < 10

2 € 2 2 is added to Count and 2 is printed; Count < 10


4 4 2 is added to Count and 4 is printed; Count < 10

6 6 2 is added to Count and 6 is printed; Count < 10

8 8 2 is added to Count and 8 is printed; Count < 10

10 10 2 is added to Count and 10 is printed; Count not


less than 10 so the loop is exited.

(b)
FOR Kg = 1 TO 5 DO Kg Lb OUTPUT
Lb=Kg*2.2
PRINT Kg, Lb 1 2.2 1, 2.2
END FOR
2 4.4 2, 4.4

3 6.6 3, 6.6

4 8.8 4, 8.8

5 11 5,11
132 •

(o)
A=3 A B C D E OUTPUT
B = 5
C=6 3 5 6 15 11
D = B * A
15 15, 5, 6, 15, 11
E = C + B
L
IF E > D THEN
A = E
ELSE At the end of the program the values for
=
A D
B, C, D and Edo not change.
ENDIF
PRINT A, B, C, D, E

1 What is printed by the 4 What is printed by the 7 What is printed by ^•


following y following algorithm if N = 4? the following
algorithm if B = 5 and
R = 5 READ N C=4?
S=6 IFN<3THEN
IF S > 5 THEN G = 1 READ B, C
T = S * R F = 2 A=B
ELSE ELSE B = C
T = S/R F = 1 C=A
ENDIF G=2 D= B+ C
PRINT T ENDIF E = E * C
FOR J = 1 TONDO F=D—B
H= F+ G A=D
F = G B = E
2 What is printed by the G
following? = H C = F
PRINT H PRINT A, B, C, D, E, F
ENDFOR
S=25
N = 1
WHILE N < 12 DO 8 What is printed by the
S = S — N 5 What is printed by the following algorithm?
PRINT S algorithm?
N = N + 2
X = 1
ENDWHILE For X = 1 to 6 DO WHILE X <= 8 DO
R = X Y = 2X + ( X *
WHILE R >= 1 DO X) — 4
PRINT R PRINT Y
3 Using numbers 5, 20, 25, 30, R = R — 1 X = X + 2
—1 for Num and 2, 4, 4, 3 for ENDWHILE ENDWHILE
Rate respectively, what is ENDFOR
printed by the following
algorithm? 9 What is printed by the
following algorithm?
READ Num 6 What is printed by the
WHILE Num >= 0 DO following algorithm if Num
Sum = 0
READ Rate is 10?
N = 25
Value = Num
Rate/100 WHILE N < 40 DO
READ Num Sum = Sum + N
PRINT Rate, FOR Count = Num to 1
Num, Value PRINT N, Sum
STEP —2 DO N = N + 4
READ Num
Sum = Count + ENDWHILE
ENDWHILE Num
PRINT Sum
ENDFOR •
133 ^•

Computer testing
Computer testing involves running the program using test data to discover
10 What is printed •• any errors in the program. There are three types of errors: syntax, logic and
by the following ^•
runtime errors.
algorithm?
• Syntax error is an error in the grammar of the programming language.
• Logic er ro r is an error in reasoning, such as the incorrect sequencing of
FOR X = 1 TO 2 DO instructions, and flawed comparisons and selection statements.
FOR Y = 1 to One of these errors within a program is known as a bug. The process of
10 DO fi nding and correcting these errors is called debugging. Tracing is an
PRINT Y
invaluable tool used in debugging a program or algorithm.
ENDFOR
In the process of debugging a program or algorithm, test data is used to
verify that the program is doing what it is supposed to. The program
should be tested using suitable test data. If you test using only
11 What is printed by the meaningful data within a well-defined range, you would be assuming
following algorithm? that only valid data will be used in the program. The data used must be
chosen to deal with all eventualities and should include extreme data -
R = 1 data outside the range as well as data within the range.
S=4 For example:
WHILE R <> S DO
READ Num1, Num2 Highest = 0
IF Numl > Num2 THEN PRINT "Enter a number"
Print Num2, Numl READ Number
ELSE WHILE Number <> 0 DO
Print Numi , Num2 IF Number > Highest THEN
ENDIF Highest = Number
READ Numl, Num2 ENDIF
R = R + 1 PRINT "Enter a number"
ENDWHILE READ Number
ENDWHILE
PRINT "The highest number entered is:", Highest

Thsting this program with data 2, 3, 0, 8, 1 would cause 3 to be printed as


the highest number: once 0 is entered, the program would stop and you
would not be able to enter any numbers after entering 0.
However, testing this program with -2, -8, -14, -1, 0 would cause -1 to be
printed.
• Runtime errors are errors that occur after the program has been tested
and debugged; they occur during the execution or running of the
program. One of the reasons these errors can occur is if the program is
stuck in an infinite loop. Since some computers set limits for how long
your program is allowed to run, a runtime error may occur if the loop
continues up to the time limit allowed.
During the computer testing process the program is executed or run. This
involves conve rt ing from the programming language to the language the
computer understands, namely machine language or machine code.
The program written in the specific programming language is known as the
source code. This source code is translated into object code by a compiler
or an interpreter. Object code can be the same as or similar to machine or
executable code.
The execution of a program occurs in two distinct steps, as follows.

134S•

LJ

In the case of an interpreter


The interpreter translates the Interpreter •
Source code Machine code •
source code to machine code; Translates one instruction at a time
the machine code is executed
(Figure 8.2).
Figure 8.2
An interpreter translates and executes one instruction at a time as it is An interpreter
encountered. The machine codes are not saved after execution.
Advantages
• It translates one instruction at a time, therefore it uses a minimum
amount of the computer's memory.
• It is also helpful in the debugging process, as the interpreter can relate
error messages to the instruction being executed.
Disadvantage
The interpreter takes longer to run a program as time is spent interpreting
the source code every time the program needs to be run.

In the case of a compiler


A compiler translates the entire program (source code) to machine code,
then the code is executed. The translated codes are known as object codes
and are saved as a file on disk. The object code (machine code) stored on
disk has an EXE file name extension. It is then loaded or linked (stored in
memory) and executed (Figure 8.3). The code to be executed by the
computer (the one stored in the computer's memory) is called executable
code and is still also known as machine code. Unlike the translator, the
compiler flags all the errors in the program by creating a list of errors, hence
the programmer must return to the source code and fix the errors.
Advantages Figure 8.3
• It can be executed faster than A compiler
when using an interpreter, as
the object codes are saved and
Compiler
can be run at any time. Source code Object code
Translates the entire program
• Object codes are harder for a
user to change than the source
code. The object code is
machine language and therefore a user will have difficulty reading and LinMoader
interpreting the code in order to make changes. (stores code
in memory)
Disadvantage
As the entire program is translated to object code, it uses much more of the
computer's memory.
Executable
code


135 %

Step 6 - f
Documenting the program
Documentation is a wri tt en explanation of how the program works and how
to use it. There are two types of documentation; user documentation and
technical documentation.

User documentation/user guides


This documentation is w ritten to explain to the user how to use the
program. It is written in plain English and not in the technical programming
language of technical documentation. It includes:
• Hardware requirements
• How to install the program
• How to run the program
• How to enter data
• What the output looks like
• How to use any menus
• Special features of the program
A programmer ^• • Error messages and advice on how to correct them (troubleshoot any
is asked to • errors).
modify a program
that has been in use
by a company for a few Technical documentation
years. However, there is This documentation is for use by the programmer. It includes information
no technical on the program itself, i.e. technical aspects of how it works. Some of the
documentation for the reasons for technical documentation include:
program. List some of • The programmer needs to understand what was w ri tten a few weeks or
the problems that might even months before, when writing a long program.
result from this. • Extremely large programs are written in teams, where certain teams
2 List FOUR of the write pa rt icular sections of the program code. Each team needs to
requirements of a good understand what the other teams have written so that the whole thing
user guide for a can fi t together.
program. • A program may need modification in time to come. It may need to be
3 Explain the difference revised to fit a new situation, or corrected for a logic error that may have
between technical shown up after using extreme data. On many occasions these
documentation and modi fi cations are not done by the original programmer; the new
user documentation. programmer will need to be able to read and understand the written
program.
4 Explain the difference
between an interpreter 'Ihchnical documentation includes:
and a compiler. Discuss • The problem that the program is intended to solve (purpose of the
why a programmer program)
might choose to use an • The algorithm
interpreter rather than • The program code/listing with its internal documentation (see below)
a compiler. • Thst data and results produced by the program
5 What does it mean to • Data and file structures
debug a program? • Structure and flow diagrams which show the relationships between the
program modules.
6 List the THREE types of
programming errors Internal documentation within the program code/listing includes:
and explain what they • Indentation and spacing (these assist in the readability of the program, so
are. that sections of code can be easily identified)
• Explanato ry remarks (comments)
• Suitable variable names (which can be associated with what is being
stored so that further explanation is not needed).

136 ^•

Summary 12 Data that does not change but remains the same
during the execution of the program is called a
1 An algo rithm is a sequence of instructions which constant; if it changes during the execution of the
if followed produces a solution to a given problem program it is called variable.
2 A pseudocode is an algorithm that models or 13 When you know how many times statements
resembles real programming language syntax. within a loop are to be repeated, the FOR
3 A computer program is a se ri es of coded construct is used.
instructions for the computer to obey in order to 14 In the WHILE construct, the computer executes a
solve a problem. set of statements/instructions repeatedly for as j'I
4 Computer programs are written using specific long as a given condition is true. When you do not
rules and statements of the particular computer know beforehand how many times statements
language of the program, known as syntax. within a loop are to be repeated, the WHILE
5 There are two levels of programming languages, construct is used.
low level and high level. High level languages are 15 TYacing is a technique that allows the user to
machine independent; they are not specifically detect any logic errors in the program or
designed for any one brand of computer. Low level algorithm.
languages are machine dependent and are 16 A syntax error is an error in the grammar of the
designed for only one type of computer. programming language.
6 Programs written in high level languages must be 17 A logic error is an error in reasoning, such as the
compiled or translated before they are executed by incorrect sequencing of instructions and flawed
the computer. comparisons and selection statements.
7 There are fi ve generations of computer 18 Runtime errors occur during the execution or
programming languages. running of a program, after the program has been
Program development is made up of six basic tested and debugged.
steps: defining the problem; analysing the 19 A program written in a specific programming
problem; developing an algorithm/method of language is known as source code. This source
solving the problem; writing a computer program code is translated into machine language with the
corresponding to the algorithm; testing and use of a compiler or an interpreter.
debugging the program; documenting the
program. 20 Documentation written to explain to the user how
to use a program is known as user
9 Programming instructions can be divided into documentation/user guide.
three main types: Input and Storage instructions,
Processing instructions and Output instructions. 21 Documentation for use by a programmer is known
as technical documentation.
10 A command is a word that instructs the computer
what must be done to accomplish a specific task.
11 A construct is a group of instructions that work
together with commands to accomplish a specific
task.


137 ^•

You might also like