You are on page 1of 199

Computer Science 2210 (Notes)

Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems

Theory of Computer Science


The expansion of the computer systems has been witnessed by all ages today from the large room-sized
systems seen in old sci-fi movies to the recent versions of tablets and Laptop computers. It must be
understood that a long pathway has been established in reaching this age of technology and discreteness
in size and memory.

1.1 DATA REPRESENTATION

Data Representation is basically the methods used within the computer systems to represent information
to be stored. Computers store different types of information:

Numbers
Text
Graphics (including photo stills, videos, animations)
Audio

They may seem very different to us. On the contrary, all types of information stored in a computer are
stored internally in the same simple format: a sequence of 0's and 1's. You may be confused at this point
as to how can a sequence of 0's and 1's represent things as distinct as your selfie on the webcam, your
favorite track, your favorite movie, and your boring exam paper?

It all comes back to how we interpret the information. Computers use numeric codes to correspond to all
U U

the information they store. These codes are related to those you may have used as a child to encrypt
secret notes: like a single finger represents a 1 and 7 fingers held together represent a 7 in decimal
numbering. Any written message can be represented numerically with this code. The codes used by
computers are a tad more complicated, and they are based on the binary number system (base two)
instead of the more recognizable decimal system (base ten). Computers use a variety of different codes
used for numbers, text, and still others for sound and graphics.

Page 1 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


1.1.1 BINARY SYSTEMS
RECOGNISE THE USE OF BINARY NUMBERS IN COMPUTER SYSTEMS

FUN FACT: The base 10 (decimal) systems are sometimes called denary, which is more related with the
U U

name binary for the base 2 system. The word “denary” also refers to the Roman denarius coin, which was
worth ten asses (an “ass” was a copper or bronze coin).

WHAT IS BINARY NUMBER SYSTEM?


U

Normally we write numbers using digits 0 to 9. This is called base 10. However, any positive integer
(whole number) can be easily represented in binary by a sequence of 0's and 1's. Numbers in this form are
said to be in base 2 and they are called “binary numbers”. Base 10 numbers use a positional system
based on powers of 10 to indicate their value. The number 123 is really 1 hundred + 2 tens + 3 ones. The
value of each position is determined by ever-higher powers of 10, read from left to right. Base 2 works the
same way, but instead of base ten, binary uses base two.

Example:
U

The number 101 in base 2 is really:

1 four + 0 twos + 1 one = (5) 10


R

This representation was created so as to help the computers in identifying 1 as the state of ‘on’ and 0 as
state of ‘off’.

WHY USE BINARY NUMBER SYSTEMS:


U

The microprocessor makes use of transistors that basically identify voltage levels rather than any
affirmative value in decimal number system. Therefore a voltage level ‘high’ or ‘on’ will be identified as ‘1’
and a voltage level of ‘low’ or ‘off’ will be identified as ‘0’. Normally high voltage is classified as 5V or 3.3V
whereas low voltage is treated as 0V. Some hardware may use different mode of identification for binary
number levels like in the case of CD-ROMs, certain microscopic black spot will be considered as binary
number ‘0’ while a shiny spot reflecting light will be considered as on. Hard disks basically apply the law
of magnetism whereas static memory utilizes electric charges on passive devices like capacitors for
recognizing number systems.

The numerous patterns of 0’s and 1’s are obtained from the devices or the computer’s internal hardware
corresponds to various representations of numbers in decimal and other formats.

Page 2 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


CONVERT DENARY NUMBERS INTO BINARY AND BINARY NUMBERS INTO DENARY

UNDERSTANDING “BITS”:
U

For the sake of understanding, binary numbers can be broken down into their smallest representation
called bits
The easiest way to understand bits is to think of them as digits like we learned in first grade. A digit is a
single place that can hold numerical values between 0 and 9. Digits are normally combined together in
groups to create larger numbers. For example, “6,357” has four digits. It is understood that in the number
6,357;
-The 7 is filling the "1s place"
-The 5 is filling the "10s place"
The 3 is filling the "100s place"
The 6 is filling the "1,000s place"
So you could express things this way if you wanted to be clear:
(6 * 1000) + (3 * 100) + (5 * 10) + (7 * 1) = 6000 + 300 + 50 + 7 = 6357

Another way to express it would be to use powers of 10. Assuming that we are going to represent the
concept of "raised to the power of" with the "^" symbol (so "10 squared" is written as "10^2"), another way
to express it is like this:

(6 * 10^3) + (3 * 10^2) + (5 * 10^1) + (7 * 10^0) = 6000 + 300 + 50 + 7 = 6357

What you can see from this expression is that each digit is a placeholder for the next higher power of 10,
starting in the first digit with 10 raised to the power of zero. The power of ten decreases from the highest
weighted digit (on the L.H.S.) to the least weighted digit (on the R.H.S.).

The binary number system works exactly the same way as the decimal system, except that it contains
only two digits, 0 and 1. Like this “1011”. How do you figure out what the value of the binary number
“1011” is? You do it in the same way we did it above for 6357, but you use a base of 2 instead of a base of
10. So:

(1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 0 + 2 + 1 = 11

You can see that in binary numbers, each bit holds the value of increasing powers of 2.

Page 3 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


CONVERSION TECHNIQUES:
Let us now understand the basic conversion techniques that basically run in the background of every
computer system that is conversion from denary to binary and binary to denary number systems.

DENARY TO BINARY:
Binary number system makes use of bits and 8 bits comprise of a larger unit called byte.
In the decimal system the number 34567 could be represented as:

10^4 10^3 10^2 10^1 10^0


3 4 5 6 7

In binary the number 11001 could be written as:

2^4 2^3 2^2 2^1 2^0


1 1 0 0 1

EXAMPLE OF A SIMPLE CONVERSION OF (73)10:

Example:
Let us consider a number 98 and convert it into binary system and take it step by step:
To do this, we should check the following:
Does the number go into 128? No. so this becomes a 0.
Does it go into 64? Yes, so this becomes a 1.
Does the remaining 34 go into 32? Yes so this is also a 1
Does the remaining 2 go in 16, 8, 4, or 1? No so these are all 0′s.
Does the remaining 2 go into 2? Yes, so this is a 1.
Since there is nothing left to compare with 1, it becomes a 0 by default.

128 64 32 16 8 4 2 1
0 1 1 0 0 0 1 0

Page 4 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


98 in binary = 01100010
The largest number we can make with 1 byte is 255. So if we wanted to make a number which is larger, we
would need to add another byte.

BINARY TO DENARY CONVERSION:


The term bit is short for Binary digit.
0T 0T 39T

So 8 bits combined together make 1 byte. 0T 0T39

Given “10010111” as an example.


128 64 32 16 8 4 2 1
1 0 0 1 0 1 1 1

To work this out, you multiply the numbers which are a 1 by 1 and add them together to give you the
decimal number
= (128×1) + (16×1) + (4×1) + (2×1) +(1×1)
= 128 + 16 + 4 + 2 + 1
= 151
0T 0T

BYTE AND ITS USE IN MEMORY SIZE

WHAT IS A BYTE?
A byte is a series of 8 bits (enough to represent one alphanumeric character) processed as a single unit of
information. A single letter or character would use one byte of memory (8 bits); two characters would use
two bytes (16 bits).
In other ways, a bit is either an 'on' or an 'off' which is processed by a computer processor, we represent
'on' as '1' and 'off' as '0'. 8 bits are known as a byte, and it is bytes which are used to pass our information
in its basic form “characters”.
An alphanumeric character (e.g. a letter or number such as 'A', 'B' or '7') is stored as 1 byte. For example,
the letter 'R' uses 1 byte, which is stored by the computer as 8 bits, '01010010'.

A document containing 1000 characters would use 1000 bytes (8000 bits) Note: many non-alphanumeric
characters such as symbols (!, @,#,$,etc..) and foreign language characters (Arabic,Japanese,etc..) use
multiple bytes.

A kilobyte (KB) is 1024 bytes and a megabyte (MB) is 1024 kilobytes and so on…

Page 5 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems

USE OF BINARY SYSTEMS FOR SPECIFIC APPLICATIONS


It is useful to understand that computer systems are capable to perform specific and user controlled and
oriented applications like robotics, power systems, and digital instruments and so on. Controlled devices
usually contain registers which are made up of binary digits (bits). The following example shows how
these registers can be used to control a device.

ROBOTIC SYSTEMS:
Robotic systems rely on processors to access user provided values and data. It is essential to note here
that all the data is sent via the processor in a binary format so conversions and storage has to be
provided by the processor.

Example
U

The device on the left is a mobile trolley with 3 wheels. All


three wheels can turn left or right and each wheel has its own
electric driving motor. Sensors at the front and rear of the
trolley detect an object in its path which would subsequently
stop all movement. An 8-bit register is used to control the
device.

Page 6 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems

Therefore if the input is for example: 1 0 1 0 1 0 1 0

1 0 1 0 1 0 1 0
front - Back - The - The -
wheel wheels direction motors
turns left turn is are on
left forward

Hence, the trolley is moving forward and turning left.

(i) What does this register mean?

“0 0 0 1 0 1 1 1”

(ii) How would the following be represented using the above register?
front wheel turning right
back wheels turning left
moving in a forward direction
motors on
no object in its path

Answers
U

(i) - front wheel not turning left or right

Rear wheels turning right


going in backward direction
motors on
Error – object in path

Page 7 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


So the vehicle is going nowhere.

(ii) 01101010

EXAMPLE#2:
U

SENSORS IN PRINTING DEVICES:


U

Three sensors are attached to a printing device, with three alarms attached to the sensors. The first
sensor, "A," detects if the device needs ink. The second sensor, "B," detects if the device needs repair. The
third sensor, "C," detects if the device has jammed paper. If the device jams or needs repair, alarm 1
sound. If the device jams or is short on ink, alarm 2 sounds. If two or more problems occur at once, alarm
3 sounds.
It can now be implied that:
A=1 refers to “low ink”
B=1 refers to “Device needs repair”
C=1 refers to “device should jam”

The outputs to the system are as follows:


A1: alarm 1 sounds if B=1 or C=1(either of B=1 or C=1 will result in A1)
A2: Alarm 2 sounds if C=1 or A=1 (either of A or C being true will result in A2)
A3= any two or more of A, B, and C being ‘1’ will result in A3.

Let us now look at the cases that will form:

A B C A1 A2 A3
0 0 0 0 0 0
0 0 1 1 1 0
0 1 0 1 0 0
0 1 1 1 1 1
1 0 0 0 1 0
1 0 1 1 1 1
1 1 0 1 1 1
1 1 1 1 1 1

Page 8 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.1 Binary systems


Questions:
1) What binary values can the register hold to alert the user of a “low ink” situation?
2) The register is holding “010”. Which alarm will sound?
3) Is the system accurate in telling the user of exactly which problem is being occurred? Point out any
one situation where user is misguided?
Answers:
1) 010, 111, 111, 111
2) A2 will sound.
3) No. System has the same alarm for one problem or more than one problem. E.g. 111 could mean
that all three problems have occurred but 111 can be received even if printer is “full on ink” or not
having “jammed paper.”

Page 9 of 9
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal

At the very launch of computer expansion it was realized that people had many complexities in managing
binary numbers. For this reason, a new number system using 16 different symbols was developed. The
one main disadvantage of binary numbers is that the binary string equivalent of a large decimal base-10
number can be quite long. When working with large digital systems, such as computers, it is common to
find binary numbers consisting of 8, 16 and even 32 digits which makes it difficult to both read and write
without producing errors especially when working with lots of 16 or 32-bit binary numbers.

One common way of overcoming this problem is to arrange the binary numbers into groups or sets of four
bits (4-bits). These groups of 4-bits uses another type of numbering system also commonly used in
computer and digital systems called Hexadecimal Numbers.
0T 0T

REPRESENTING INTERGERS AS HEXADECIMAL NUMBERS:


The base 16 notational system for representing real numbers. The digits used to represent numbers using
hexadecimal notation are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.

“H” denotes hex prefix.

Examples:

28 16 = 28H = 2×161+8×160 = 40
R R0T 0T P P P P0T P0T

2F 16 = 2FH = 2×161+15×160 = 47
R R0T 0T P P P P0T P0T

BC12 16 = BC12H = 11×163+12×162+1×161+2×160= 48146


R R0T 0T P P P P P P P P

Page 1 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


Numeral systems conversion table:

Page 2 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


WHY USE HEXADECIMAL NUMBER SYSTEMS?

The main reason why we use hexadecimal numbers is because it is much easier to express binary number
representations in hex than it is in any other base number system. Computers do not actually work in hex
(don’t laugh, beginning students do ask that question). Let’s look at an example, using a byte. Bytes are
typically 8 bits, and can store the values 0 – 255 (0000 0000 – 1111 1111 in binary). For people,
expressing numbers in binary is not convenient. I am not going to turn around to my co-worker and tell
him that my phone number is 101 101 101 001 010 001 010 for obvious reasons. Imagine having to try
and work with that on a daily basis. So a more convenient expression is needed for the humans.

Since a byte is 8 bits, it makes sense to divide that up into two groups, the top 4 bits and the low 4 bits.
Since 4 bits gives you the possible range from 0 – 15, a base 16 system is easier to work with, especially if
you are only familiar with alphanumeric characters. It’s easier to express a binary value to another person
as “A” then it is to express it as “1010”. This way I can simply use 2 hex values to represent a byte and
have it work cleanly. This way even if my math is poor, I only need to memorize the multiplication tables
up to 15. So if I have a hex value of “CE”, I can easily determine that (12*161) + (14*160) = 206 in decimal,
P P P P

and can easily write it out in binary as 1100 1110. Trying to convert from binary would require me to know
what each place holder represents, and add all the values together (128 + 64 + 8 + 4 + 2 = 206). It’s much
easier to work with binary through hex than any other base system.

Page 3 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


CONVERSION TECHNIQUES:
HEXADECIMAL TO BINARY AND BINARY TO HEXADECIMAL NUMBER SYSTEM:
Let’s assume we have a binary number of: 01010111

Hexadecimal =??

8 4 2 1 8 4 2 1
0 1 0 1 0 1 1 1
0x8 1x4 0x2 1x1 0x8 1x4 1x2 1x1
0 4 0 1 0 4 2 1
0+4+0+1=5 0+4+2+1=7
5 7

Hence the hexadecimal equivalent is 57

From Denary to Hexadecimal:


117 (in denary) is 7 lots of 16 (112) plus an extra 5. Fitting this in the columns gives

256 16 1
0 7 5

Notice that 7 in binary is 0111 and that 5 is 0101, put them together and we get 01110101 which is the
binary value of 117 again. So binary and hexadecimal are all related in some way.

FROM HEXADECIMAL TO BINARY AND DENARY:


Hexadecimal number BD stands for 11 lots of 16 and 13 units

= 176 + 13

= 189 (in denary)

Note: B = 11, which in binary = 1011

D = 13, which in binary = 1101

Put them together to get 10111101 = the binary value of 189.

Page 4 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


USE OF HEXADECIMAL NUMBER IN COMPUTER REGISTERS AND MAIN MEMORY:

Computers are comprised of chips, registers, transistors, resistors, processors, traces, and all kinds of
things. To get the binary bits from one place to the next, software programmers convert binary to hex and
move hex values around. In reality, the computer is still shoving 1's and 0's along the traces to the chips.

There are two important aspects to the beauty of using Hexadecimal with computers: First, it can 0T 0T

represent 16-bit words in only four Hex digits, or 8-bit bytes in just two; thus, by using a numeration with
more symbols, it is both easier to work with (saving paper and screen space) and makes it possible to
0T 0T 0T 0T 0T 0T

understand some of the vast streams of data inside a computer merely by looking at the Hex output. This
is why programs such as DEBUG, use only Hexadecimal to display the actual Binary bytes of a Memory
Dump rather than a huge number of ones and zeros!

The second aspect is closely related: Whenever it is necessary to convert the Hex representation back
0T 0T 0T 0T

into the actual Binary bits, the process is simple enough to be done in your own mind. For
example, FAD7 hex is 1111 1010 1101 0111 (F=1111, A=1010, D=1101, 7=0111) in Binary. The reason
0T 0T 0T 0T 0T 0T

one might wish to do this is in order to work with "logical" (AND, OR or XOR) or "bit-oriented" instructions 0T 0T 0T 0T 0T 0T

(Bit tests, etc.) which may make it easier (at times) for a programmer to comprehend.
0T 0T 0T 0T

For example, if you wanted to logically AND the hex number FAD7 with D37E, you might have a difficult
0T 0T 0T 0T 0T 0T

time without first changing these numbers into Binary. If you jot them out in Binary on scratch paper, the
task will be much easier:

FAD7(hex) 1111 1010 1101 0111


D37E(hex) 1101 0011 0111 1110
ANDing gives 1101 0010 0101 0110
Answer (in hex) D 2 5 6

Page 5 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


USES OF HEXADECIMAL IN COMPUTING:
HTML COLORS:
Along with the advances in Microcomputers, "the Internet" has experienced many changes as well. A code
still used by "Web browsers" today had been invented to transfer information from servers to terminals in
a way that made the Internet a much more effective tool for research. That code is called "Hyper-Text
Markup Language" (or HTML) and it soon included a method which could theoretically reproduce
background and text with a total of 16,777,216 different colors!

The hardware available today has already advanced way beyond that limit. The main reason was a push
to display pictures "in living color;" now a common reality. And one of the first things a new computer user
should always do is make sure their display can be set to what's called "24-bit" or "True Color" (for those
16-million plus possible colors). As a matter of fact, almost every video card today has the capacity to
reproduce what's called "32-bit" color. But all those extra bits are not used for increasing the number of
colors! Why? Well, since the human eye is only capable of distinguishing something like 7 million or so
different colors that would be a real waste of technology! But you'll have to look for another page about
video cards if you want to know more; our task here is to simply explain the use of color with HTML code.

Hexadecimal color values are supported in all major browsers. A hexadecimal color is specified with:
#RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of
the color. All values must be between 00 and FF.

For example, the #0000FF value is rendered as blue, because the blue component is set to its highest
value (FF) and the others are set to the lowest value (00).Computers are comprised of chips, registers,
transistors, resistors, processors, traces, and all kinds of things. To get the binary bits from one place to
the next, software programmers convert binary to hex and move hex values around. In reality, the
computer is still shoving 1's and 0's along the traces to the chips.

ASSEMBLY LANGUAGE:
In 8 bit PC register, the largest number is 1111 1111 which has 8 bits. At the same time the 2 digit
hexadecimal number for 1111 1111 is ‘FF’.

Do you see how skillfully it is used? Don’t forget that computers process 8-digit binary numbers. For the
convenient use of programmer in Assembly language, it is easy to manipulate hexadecimal numbers
rather than binary numbers.

In Assembly Language, you would move a HEX value into a register like so:
Mov AX,03

The command is MOV or move. The item to move is the value of 3. Where? Into the AX register.

Page 6 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.2 Hexadecimal


MAC ADDRESS:
A typical MAC address looks something like this: af-14-b3-c2-14-45
You may be wondering why we've got letters and numbers in this address. MAC addresses are expressed
in hexadecimal, which gives us the ability to express more values with the same number of bits.
Theoretically, every single NIC in the world should have a totally unique MAC address, and the only way to
do this is to express MAC addresses in hexadecimal.

Page 7 of 7
Computer Science 2210 (Notes)
Chapter: 1.1 Data representation

Topic: 1.1.3 Data storage


Show understanding that sound (music), pictures, video, text and numbers are stored in different
formats Different types of data are stored in different formats.
Midi - it is associated with the storage of music files. Midi files are not music and don’t contain any sounds, it
is basically a communications protocol that allows electronic musical instruments to interact with each other.
The midi protocol uses 8-bit serial transmission with one start bit and one stop bit, and is therefore
asynchronous
Mp3 - it uses technology known as audio compression to convert sounds and music into a mp3 format. This
compression technology will reduce the size of a normal music file by about 90%.
It is compressed by using file compression algorithms which use perceptual music shaping, this essentially
removes sounds that the human ear can’t hear properly
Mp4 - mp4’s files are essentially the same as mp3, except that this format allows storage of multimedia files
like music, videos, photos
Jpeg - when a photo undergoes file compression, the size of the file is reduced. One of the file formats used to
reduce photographic file sizes is known as jpeg
Text & number format - text and numbers can be stored in a few different formats. Text is usually stored in
an ASCII format
Identify and describe methods of error detection and correction, such as parity checks, check digits,
checksums and automatic repeat requests (arq)
Parity - theres odd parity and even parity. It is basically the number of 1’s in a byte, whether it’s odd number
of 1’s or even number of 1’s. If its odd parity and even number of 1’s, there will be an error.
Automatic repeat requests (arq) - it sends an acknowledgement to show that the data is correctly transmitted.
Checksum - data is sent in blocks and an additional value, the checksum (check-digit) is sent at the end of the
block of data. This is checked and if there’s a problem, an error has occurred.
Echo-check - the data sent is sent back, and compared, if something is wrong, there is an error.
Show understanding of the concept of musical instrument digital interface (midi) files, jpeg files, mp3
and mp4 files
Midi files are data files which store the ‘analogue’ data, such as the pitch, notation, velocity, volume etc. This
can be used on other devices, and the device can play sounds as if original. The data can be recorded in a
sequencer, which can edit and play the data later. Midi is compact and can be easily modified and choice of
instruments can also be chosen.
Jpeg is a lossy compression for images, it trades quality for small file size, it can be adjusted to fit your photo
quality needs. It achieves a 10:1 compression with little visible quality depletion. This format is supported by
a lot of cameras and computers. Jped stands for joint photographic experts group.
Mp3 is a lossy compression for audio, it removes sounds which the human ear cannot hear, which lowers the
file size of the audio.
Mp4 is a video format, which stores audio and video, but it can also store things like subtitles. It works similar
to mp3, except that it stores greater volume of things.
Show understanding of the principles of data compression (lossless and lossy compression algorithms)
applied to music/video, photos and text files
Lossy - the file compression algorithm eliminated unnecessary bits of data and cannot return to it’s original
state when uncompressed.
Lossless - all the data bits from the original file are reconstructed when the file is again uncompressed. This is
important for files where loss of any data will be disastrous, e.g. a spreadsheet file.

Page 1 of 1
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission

TRANSMISSION OF DATA
Data transmission refers to the movement of data in the form of bits between two or more digital devices.
This transfer of data takes place via some form of transmission media (for example, coaxial cable, fiber
optics etc.)

Because ordinary telephone circuits pass signals that fall within the frequency range of
voice communication (about 300–3,500 hertz), the high frequencies associated with
0T 0T

data transmission suffer a loss of amplitude and transmission speed. Data signals must therefore be
0T 0T

translated into a format compatible with the signals used in telephone lines. Digital computers use
a modem to transform outgoing digital electronic data; a similar system at the receiving end translates
0T 0T

the incoming signal back to the original electronic data. Specialized data-transmission links carry signals
at frequencies higher than those used by the public telephone network.

Types of Data Transmission


2T

Serial transmission of data


Parallel transmission of data

Page 1 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


USES OF SERIAL AND PARALLEL DATA TRANSMISSION:
In digital communications systems, there are 2 methods for data transfer: parallel and serial. Parallel
communication uses multiple wires running parallel to each other, and can transmit data on all the wires
simultaneously. Serial communication on the other hand, uses a single wire to transfer the data bits one
at a time.

SERIAL TRANSMISSION
Serial transmission occurs over a single cable, one bit at a time. This type of communication is named
U U

"serial" not simply because data travels one bit at a time, but also because these bits must be organized in
a particular way so that transmission can be organized and considered trustworthy. For example, a single
transmission from a peripheral device using serial data might take only 8 bits, so the serial mechanism
has a way to dictate how to signal things like start of a new transmission of data.

Data is transmitted in the form of bits down the wire, so an 8 bit byte, which stands for a single character,
will be transmitted in 8 parts, one signal for each bit.

The diagram shows the data byte 01100011 being transmitted. As there is only one wire, only one bit can
be transmitted at a time.

Serial transmission is simple and reliable because the next bit is not transmitted until the current one has
arrived at its destination. However, because only one bit can be transmitted at a time, the speed of
transmission is slow.

Page 2 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


PARALLEL TRANSMISSION:
Let us assume that the devices are linked by more than one wire. This means that more bits can be sent
at once. A sensible number of wires would be 8, because then a whole byte could be sent at once instead
of having to send one bit at a time.

This type of data transfer is called “Parallel” transmission. Parallel transmission of data is obviously
faster than serial because all the bits are travelling at the same time, but because of the fine tolerances in
the transmission, it is less reliable as the bits can become mixed-up.

Page 3 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


SERIAL TRANSMISSION VERSUS PARALLEL TRANSMISSION
Serial transmission is slower than parallel transmission given the same signal frequency. With a parallel
0T 0T16 0T16 0T 0T 0T16 16T 0T 0T

transmission you can transfer one word per cycle (e.g. 1 byte = 8 bits) but with a serial transmission only
a fraction of it i.e. 1 bit.

The reason modern devices use serial transmission is because:


You cannot increase the signal frequency for a parallel transmission without limit, because, by
design, all signals from the transmitter need to arrive at the receiver at the same time. This cannot
0T 0T16 16T

be guaranteed for high frequencies, as you cannot guarantee that the signal transit time is equal
0T 0T4 0T4 0T

for all signal lines. The higher the frequency, the more tiny differences matter. Hence the receiver
has to wait until all signal lines are settled thus lowering the transfer rate.

One needs to consider crosstalk with parallel signal lines. The higher the frequency, the more
0T 0T4 0T4 0T

pronounced crosstalk gets and with it, the higher the probability of a corrupted word and the need
to retransmit it.

Parallel transmission; however has its own merits:

Multiple bits of information are sent at the same time.


At identical clock speeds, parallel transfers are faster than serial transfers because more data is
being transferred.

However, parallel transfers also have problems:


Many wires or traces (wire-like connections on the motherboard or expansion cards) are needed,
leading to interference concerns and thick, expensive cables.
Excessively long parallel cables or traces can cause data to arrive at different times. This is
referred to as “signal skew”. Parallel cables that are too long can cause signal skew, allowing the
parallel signals to become "out of step" with each other.
Differences in voltage between wires or traces can cause jitter.

Page 4 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


Modes of Transmission
If data is to be transmitted between devices, there are three different modes of transmission
possible.

a) Simplex mode. If data can only travel in one direction then it is known as a SIMPLEX
transmission. A good example of a simplex transmission of data is teletext information which is
passed to a television receiver, but there is no way to send data in the other direction.

Transmitter Receiver

b) Duplex mode. When data can pass in both directions at the same time it is known as DUPLEX
transmission of data. An example of duplex transmission would be a telephone conversation as
both users can speak and be heard at the same time.

Device 1 Device 2

c) Half duplex mode. When data can pass in both directions, but only in one direction at a time,
the transmission is called HALF DUPLEX. An example of half duplex is a CB radio system in
which each handset can either be set to receive mode or send mode.

Device 1 Device 2

Page 5 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


ERROR DETECTION AND CORRECTION IN DATA TRANSFER:
In networking, error detection refers to the techniques used to detect noise or other impairments
introduced into data while it is transmitted from source to destination. Error detection ensures reliable
delivery of data across vulnerable networks.

Error detection minimizes the probability of passing incorrect frames to the destination, known as
undetected error probability.

The amount of additional information sent is usually the same for a given amount of data, and the error
detection information will have a relationship to the data that is determined by the application of an
algorithm of some kind to the data itself.

The receiver applies the same algorithm to the data it receives to obtain its own version of the error
correction code, and then compares that version with the error correction code it has received. If the two
codes match, the receiver can be reasonably sure that the data is correct. If not, it will assume that an
error has occurred and respond in the appropriate manner.

PARITY BITS AS A METHOD FOR ERROR DETECTION:


The movement of digital data from one location to another can result in transmission errors, the receiver
not receiving the same signal as transmitted by the transmitter as a result of electrical noise in the
transmission process. Sometimes a noise pulse may be large enough to alter the logic level of the signal.
For example, the transmitted sequence 1001 may be incorrectly received as 1101. In order to detect such
errors, a parity bit is often used. A parity bit is an extra “0” or “1” bit attached to a code group at
transmission. In the even parity method, the value of the bit is chosen so that the total number of 1s in the
code group, including the parity bit, is an even number.

For example, in transmitting 1001 the parity bit used would be 0 to give 01001, and thus an even number
of 1s. In transmitting 1101 the parity bit used would be 1 to give 11101, and thus an even number of 1s.
With odd parity, the parity bit is chosen so that the total number of 1s, including the parity bit, is odd. Thus
if at the receiving end, the number of 1s in a code group does not give the required parity, the receiver will
know that there is an error and can request that the code group be retransmitted.

Consider the following example:

Page 6 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


In this example, the number of 1 data bits is even, so the parity bit is set to 0. By contrast, in the example
0T 0T 0T 0T 0T 0T

below, the data bits are odd, so the parity bit becomes 1:

Let's pretend that after being transmitted, the lowest-weighted bit of the previous byte (the one on the far
right) had fallen victim to interference:

The parity bit, in this case, no longer corresponds to the byte's parity: an error has been detected.
0T 0T

However, if two bits (or an even number of bits) had simultaneously changed as the signal was being sent,
no error would have been detected.

As the parity control system can only detect an odd number of errors, it can only detect 50% of all errors.
This error-detection mechanism also has the major downside of being unable to correct the errors it finds
(the only way to fix it is to request that the erroneous byte be retransmitted)

Page 7 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


INTEGRATED CIRCUITS:
In the beginning all data sent to and from disks traveled in serial form—one bit was sent right after
another, using just a single channel or wire. With advancement in IC technology, it became feasible and
cheap to put multiple devices on a single piece of silicon, and the parallel interface was born.

The decreasing cost of integrated circuits, combined with greater consumer demand for speed and cable
length, has led to parallel communication links becoming deprecated in favor of serial links. Typically, it
used eight channels for transmission, allowing eight bits (one byte) to be sent simultaneously, which was
faster than straight serial connections. The standard parallel interface used a bulky and expensive 36-wire
cable.

Serial or parallel data transmission is used in many Integrated circuits today. Multiplexer is one such
U U

example of an IC where both serial and parallel data transmission is used.

MULTIPLEXERS:
The multiplexer or “MUX” is a combinational logic circuit designed to switch one of several input lines
0T 0T16 16T

through to a single common output line by the application of a control signal. Multiplexers operate like
very fast acting multiple position rotary switches connecting or controlling multiple input lines called
“channels” one at a time to the output.

Multiplexers, or MUX’s, can be either digital circuits made from high speed logic gates used to switch
digital or binary data or they can be analogue types using transistors, MOSFET’s or relays to switch one of
the voltage or current inputs through to a single output.

The most basic type of multiplexer device is that of a one-way rotary switch as shown.

As you can see, initially inputs are provided via parallel transmission technique but the output is given out
serially.

Page 8 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.1 Data transmission


Universal Serial Bus (USB):
The USB, which stands for “Universal Serial Bus”, is a high-speed serial standard that, along with FireWire,
0T 0T

has almost totally replaced the ordinary serial and parallel standards that have been used to connect
0T 0T 0T 0T

peripheral devices to PCs since the 1980s.


0T 0T

In theory, up to 127 devices can be connected to a single USB port on a computer's motherboard, using
0T 0T

only one of a computer's 16 or 23 Interrupt Requests (IRQs) by using a USB hub, which itself has a
0T 0T 0T 0T

number of USB ports.

A USB hub can have its own power source, or draw its power through the computer to which it is
0T 0T

attached. To avoid power problems, a powered hub is the best choice. Seven peripherals can be attached
0T 0T 0T 0T

to each USB hub. One of these peripherals can be a second hub to which up to another seven peripherals
0T 0T 0T 0T

can be connected, and the second hub can be attached to a third hub, etc.
0T 0T

Page 9 of 9
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects

THE INTERNET
The word “Internet” is basically derived from "interconnection of computer networks". Alternatively
referred to as the net or the web, the Internet was initially developed by the IPTO with the intention of
0T 0T 0T 0T 0T 0T 0T 0T 0T 0T 0T 0T3U U0T3 0T

helping to develop the progress of computing technology by linking the work being done by all the best
academic computer centers. The Internet as we know it today first started being developed in the late
1960's and transmitted its first message on Friday, October 29, 1969. In 1993, the Internet experienced 0T 0T3U U3T 0T 0T3U U3T

one of its largest growths to date and today is accessible by people everywhere in the world.
The Internet contains billions of web pages created by people and companies from around the world,
making it a limitless location to locate information and entertainment. The Internet also has thousands of
services that help make life more convenient. For example, many financial institutions offer online banking
that enables a user to manage and view their account details online.

The Internet basics

The Internet uses the TCP/IP protocol and is accessed using a computer modem, broadband, 3G or
0T 0T3U U0T3 0T3U U0T3 0T 0T 0T3U U3T 0T 0T3U U3T 0T 0T3U U0T3 0T

network that is connected through an ISP. 0T 0T3U U3T

The Internet is explored, which is more commonly referred to as surfing, using a 0T 0T3U U3T

computer browser. 0T 0T3U U3T

Finding information on the Internet is achieved by using a search engine. 0T 0T3U U3T

Users browse web pages by following hyperlinks. 0T 0T3U U0T3 0T 0T 0T3U U3T

Files, pictures, songs, and video can be shared by uploading and downloading. 0T 0T3U U0T3 0T 0T 0T3U U3T

The Internet is also used for communicating with others through networks, forums, chat, e-mails, 0T 0T 0T 0T3U U3T 0T 0T3U U3T

and IM.
0T 0T3U U3T

Page 1 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


Connecting to the Internet
You may require the following to connect to the internet:

a computer
telephone line (cable being the exception)
modem and/or router
an ISP (Internet Service Provider)
Web browser, e.g. Internet Explorer, Firefox, Chrome, Safari, Opera etc.

Page 2 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


SECURITY CONCERNS FOR INTERNET USAGE
Internet is used widely and has become a common platform to share the files between the computers in
the world. Internet has made new ways to interact among the people and the organizations.

And with increase in the usage of the Internet there are many threats in the computer market like Trojans,
spy wares, virus attacks. These threats attack the computer; corrupt data files, and may even crash the
system. So it is also very important to protect your computer from these malicious attacks. So to avoid
these threats and the hackers in order to be safe on the Internet, we must follow some safety measures to
prevent these threats to our computer. Hence Computer security is essential to prevent loss of your
precious data.

Here are certain security aspects you need to be aware of to protect your valuable data and resources:

Internet Confidentiality & Privacy


The Internet provides little assurance of privacy or confidentiality. The use of firewalls, anonymizers, and
0T 0T16 0T16 0T

encryption can help mitigate the risks. Major considerations to keep in mind are discussed below.

Silent communications: There are thousands of rogue actors and infected computers probing
U U

machines across the Internet at any given second. These bad apples are almost certainly trying to
get control of your machine through any security fault or unpatched module they can find.
Fortunately, their communications are fairly straightforward to trap, since by definition they are
unsolicited -- it is easy to tell the difference between packets from a website you just accessed
from a probe and from some site you never heard of before.

The technological solution to this threat is called a "firewall", a program that monitors all
communications and traps all illicit packets. Most operating systems now come with a firewall
preinstalled. However, some, such as the Windows firewall, only block suspect incoming
communications, leaving completely open access to the Internet from your machine. This is a 0T 0T16 0T16 0T

barn-door sized hole that is eagerly used by almost every program you have on your computer to
contact the home company for all sorts of reasons ranging from automatic checking for updates to
transmission of usage metric data for their own proprietary purposes. The solution to this is a third
party firewall that protects both incoming and outgoing communications. The free version
0T 0T 0T 0T

of Zone Alarm is widely used.


0T 0T 0T 0T

Surfing leaves tracks: There is little privacy or confidentiality on the Internet. Websites
U U

can track your surfing on their site by IP address and related system information, including
0T 0T 0T 0T 0T 0T 0T 0T

system names and Internet network addresses that often uniquely identify your computer. Search
engines generally record your queries together with your computer identification, building up a
profile of your interests over time.

To minimize these threats, you can turn your default browser settings to exclude cookies, since 0T 0T

they can be used to build up detailed profiles of your surfing patterns over time (advertising sites
Page 3 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


with presence on many sites can even use cookies to track your surfing patterns across different
sites). You can also use networked or single-point anonymizers to obscure your entire computer's 0T 0T 0T 0T

local identifying information and obtain the maximum available Internet privacy.

Posting Information is always public: When you post anything to a public Internet newsgroup,
U U

mailing list, or chat room, you generally give up the rights to the content and any expectation of
privacy or confidentiality. In most countries, anything you post to a public space can be saved,
archived, duplicated, distributed, and published, even years later, by anyone in the same way as a
photograph taken in a public space like a city park.

If you have ever posted anything to the newsgroups, you might find it interesting to search them 0T 0T

now for the email address you used at the time, which is one reason you
0T 0T 0T 0T

should disguise your email address when posting to the Usenet newsgroups.
0T 0T 0T 0T 0T 0T 0T 0T 0T 0T

Your Personal data can enlist all your activities: If you give a site personal data like an email
U U

address, home address, phone number, birth date, or credit card number, be aware that the
information can be easily cross referenced by a range of large service companies to assemble a
detailed database of your buying habits, surfing patterns, and interests. And it usually is.

If you do give websites personal information, it is a good idea to first read their Internet privacy
policy to see how confidential they promise to keep it. Always keep a good track of security
features offered by websites like “https” links, and allowing networking security options on your
data.

Intercepting Valuable Information: Without speculating on whom or why, Internet communications


U U

interception is technically easy to do at any of the perhaps five and twenty-five routers through 0T 0T 0T 0T

which your packets are switched on the way to their destination. Software taps are easy to add.
0T 0T 0T 0T 0T 0T

Direct physical interception through tapping into copper network cable near a house or in a
switching station is straightforward with inexpensive equipment, and enables an eavesdropper to
copy all of the traffic that passes over the line. Radio frequency interception of the traffic on
copper lines is possible. Tapping into fiber optic line is more difficult, usually requiring a high angle
bend to get a bit of light leakage, but is also technically possible. 0T

Encryption is the only sure solution.

Your Government bodies have the main control: Many national governments are large enough with
U U

enough resources that they can and do intercept Internet communications.


However, because of the volume of information if for no other reason, you can be reasonably
assured that no-one is taking the time to look at your specific Internet packets unless you are
connected to an investigation.

Page 4 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


The bottom line is that you have little privacy or confidentiality on the Internet, and unless your
communications are encrypted and/or anonymized, you should assume that they can be read by
others. At the same time you need to make a realistic threat assessment depending on what you
are doing.

Internet risks associated with viruses, spy-ware and hacking

It is convenient to have access to vast content on the Internet such as important information, useful
30T 30T

services and wonderful entertainment but unfortunately by accessing the Internet, you leave yourself 30T 30T

vulnerable to some trouble makers who are waiting for an opportunity to harm you and your computer. 30T 30T

Yes, we’re talking about computer viruses, spyware/adware and hackers.


30T 30T

Computer viruses, spyware and adware- Plague to a Healthy Computer System

Computer viruses are software programs designed to access your computer without your consent,
30T 30T 30T 30T

interfere with the computer’s operation and records, corrupts, or deletes your personal data.
30T 30T

Adware are software programs designed for advertising and changing your computer's configuration. 30T 30T

Spyware is software designed to collect personal information like what websites you visit or even
discreetly transmits your personal information, such as your credit card number from your computer 30T 30T

without your knowledge.

Another threat over the internet is of “Hackers”. The term hacker is used in popular media to describe
someone who attempts to break into computer systems. Typically, this kind of hacker would be a
proficient programmer or engineer with sufficient technical knowledge to understand the weak points in a
security system.

What damages can they cause?


While viruses can be intentionally destructive, for example, by destroying data, many viruses are fairly
benign or just plain annoying. Adware is mainly annoying but spyware can be downright dangerous if it
manages to get hold of important information like your passwords or credit card information. Hackers can
breaks into someone else’s computer system, often on a network; by passes, passwords or licenses in
computer programs or in other ways intentionally breach computer security.

Symptoms of a Virus Outbreak


The worse with viruses, adware/spyware and hackers are that they silently operate for a relatively long
period of time in your computer without being detected. Therefore it’s very important to follow the
30T 30T

preventive methods described later in this guide. The common symptoms of a virus infection are that
30T 30T

your computer works slower than normal, it stops responding and freezes often, crashes and restarts
30T 30T

frequently or fails to run normally. Other possible symptoms are that the applications don’t work properly
and you can’t print correctly, the discs and disc drives on your computer are inaccessible and you often
30T 30T

see unusual error messages.

Page 5 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


The signs of spyware or adware infection are similar to the signs of a computer virus infection, but in
30T 30T

addition to those you might get unwanted pop-up windows on your screen even if you’re not browsing in
the Internet, your web browser’s start up page can be different than it should be or you might notice an
30T 30T

unwanted toolbar on your web browser.

It can be difficult to detect a hacker on a computer because nothing changes to help disguise the hack.
Below are the most common things that change after a computer is hacked.

New programs installed


Computer passwords have changed
Increased network activity
Unknown programs wanting access
Security programs uninstalled
Computer doing things by itself

ANTIVIRUS A WAY OF PROTECTION AGAINST INTERNET RISKS

WAYS OF PROTECTION

Even though the idea of having unwanted software running on your computer is scary, by following few
30T 30T

easy steps you can keep your computer free from viruses, adware, spyware and other trouble makers.
30T 30T

Call the VIRUS POLICE DEPARTMENT a.k.a. “The Antivirus software”

In addition to a firewall you should install some kind of anti-virus software before connecting your
computer for the first time to the Internet. Typical anti-virus software scans for the new viruses entering
30T 30T

your computer, cleans up any viruses it finds and makes sure they can't do any more harm.
30T 30T

Just like firewall, your anti-virus software should be turned on at all the times so that when you start up
your computer the virus scanner will also open. This ensures that viruses are caught as soon as possible.
30T 30T

Anti-virus software will also check disks inserted in your computer, emails you receive and programs you
30T 30T

download from the Internet for viruses.


30T 30T

If you receive a virus, your anti-virus software will usually notify you then will try to repair the file the virus
has infected. It also isolates any files that can’t be repaired and tries to rescue any files it can. Some
software asks you to send the virus to the anti-virus company. If it is a new one the company will add it to
30T 30T 30T 30T

their database.

Page 6 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


Having a functional Firewall System

An Internet firewall is a computer program or hardware appliance designed to prevent unauthorized


30T 30T 30T 30T

access to private computers or networks. A Firewall can screen out viruses, worms, malware and hackers
that try to access your computer over the Internet. Installing a firewall is the most effective and important
30T 30T 30T 30T

first step you can take to protect your computer. Install the firewall before you access the Internet for the
30T 30T 30T 30T

first time and keep it running at all times.

You can purchase a firewall for your computer from a local computer store or from the Internet. Some
30T 30T 30T 30T 30T 30T

operating systems like Windows XP (with service pack 2) and Mac OS X have a built-in firewall.

Working of a Firewall
A firewall enforces a policy or set of rules governing the flow of data to and from the outside world.
Firewalls that are used to protect home computers are usually based on packet filtering, i.e. Data packets
(small units of information) are admitted or rejected according to the way these rules are configured. For
the typical home user their primary function is to block uninvited incoming connections. Most firewall
tools will come with a sensible set of rules by default.

Password Protection
Passwords are very important in keeping your online information safe. What is very important is the
strength of the password that you choose. Your password should meet the following criteria:

Be at least 6 - 8 characters

Contain at least one character from ALL of the following four classes:
Uppercase letters (e.g. A, B, C), Lower case letters (eg. a, b, c), Numbers (eg. 1, 2, 3), Punctuation
symbols (e.g. ~!@#$%^&*()+-=)

Doesn't contain your first name, your last name, your user ID, the word Optus, SingTel, a day of the
week, month of the year or the word password.

Is not a common word or keyboard sequence (e.g. 123, QWERTY, asdf, zxcv, poiuy).
You should change your password regularly and never share your password to others.

Use Updated and Valid software

As the viruses change constantly, it is very important that you keep your computer’s operating system, 30T 30T

firewall software and the anti-virus software up to date. The anti-virus software will automatically ask to
be updated so make sure you do that. Many virus scanners can be obtained bundled with one year of free
"updates" included. After this subscription runs out, the program will usually recommend that you re- 30T 30T

subscribe in order to keep up-to-date with the needed protection.

Be alert of suspicious Emails


Most viruses arrive on your computer via email. Do not open an email attachment you haven’t expected or
30T 30T

if you don’t recognize, even if you use an anti-virus software. Note that it is possible to get virus infected

Page 7 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.2 Security aspects


email also from your friends’ and colleagues’ email-addresses. A virus is not dangerous until the infected
attachment is opened. Check that the contents of the message make sense before you open any
attachments. Don't forward any attachment without being sure it is safe. Delete any email you think is
infected and empty your deleted items folder regularly.

Pop Ups- The Virus Minions


Pop-up windows are windows that “pop up” on your computer screen when you open certain websites.
30T 30T

Some websites try to fool you to accidentally download spyware or adware to your computer by clicking
30T 30T

OK or Accept button on the pop up window. The safest way to close a pop up window is to close it from
the little box with “x” on it on the top of the window.

Avoid Downloading files off unknown Internet sources


You can also get viruses, adware and spyware on your computer by downloading software and other files
from the Internet. If the software is free and provided by an unknown software developer, or is an illegal
30T 30T

"cracked" or "hacked" version of commercial software it is more likely to contain an additional and
unwanted software virus than if you download or buy it from a respected and well-known software
developer.

Back up your Data


To avoid losing your work in case your computer gets infected by a virus, make sure you have a recent
backup of your most important work. If you usually back up the contents of your disk to an external hard
drive or other writable media like floppy disks, don't plug in backup disks to your computer if you think
your computer has a virus, as the virus could spread to your backups

Encryption
Encryption is called the translation of data into a secret code. Encryption is the most effective way to
achieve data security. To read an encrypted file, you must have access to a secret key or password that
enables you to decrypt it. Unencrypted data is called plain text ; encrypted data is referred to as cipher
text.

Page 8 of 8
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation

WORKING OF THE INTERNET


Whenever you need to send a message or retrieve information from another computer, the TCP/IP
protocols are what make the transmission possible. Your request goes out over the network,
hitting domain name servers (DNS) along the way to find the target server. The DNS points the request
0T 0T42 0T42 0T

in the right direction. Once the target server receives the request, it can send a response back to your
computer. The data might travel a completely different path to get back to you. This flexible approach to
data transfer is part of what makes the Internet such a powerful tool.

BROWSER

Browser, short for web browser, is a software application used to enable computers users to locate and
access web pages. Browsers translates the basic HTML (Hypertext Mark Up Language) code that allows
us to see images, text videos and listen to audios on websites, along with hyperlinks that let us travel to
different web pages. The browser gets in contact with the web server and requests for information. The
web server receives the information and displays it on the computer.

There are several types of browsers but the one thing they have in common is that they carry out the same
function; they transfer hypertext. Here are some familiar common web browsers:

Google Chrome
Mozilla Firefox
Microsoft Edge

Every browser features a toolbar that allows you to perform various functions like:

Go back to the first page you started on the internet which is called Home.
Bookmark your favorite websites
Print content you find interesting on web pages
Check your web history, like the websites you visited in the past
You can go forward and backwards to see the previous sites you viewed

There are two basic ways that you can navigate through the browser:

You can click on links on different web pages. Those links will lead you to other web pages.
If you know the URL or the address of the website you can type it in write in the browser's box all
the way at the top. There's no need to type in the: http:// part when inserting the address
because the browser automatically places it in. Then you have to click enter.

Page 1 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


So every time you click on a link or enter a URL, your browser will request the information from the web
server. If your browser returns to the page with a error message, the address you typed in could be wrong
on you may not be connected to the internet.

What are Internet Servers?

In general, all of the machines on the Internet can be categorized as two types: servers and clients. Those
machines that provide services (like Web servers or FTP servers) to other machines are servers. And the
U U

machines that are used to connect to those services are clients. When you connect to “Yahoo!” at
U U

www.yahoo.com to read a page, Yahoo! is providing a machine (probably a cluster of very large
machines), for use on the Internet, to service your request. Yahoo! is providing a server. Your machine, on
the other hand, is probably providing no services to anyone else on the Internet. Therefore, it is a user
machine, also known as a client. It is possible and common for a machine to be both a server and a client,
but for our purposes here you can think of most machines as one or the other.

A server machine may provide one or more services on the Internet. For example, a server machine might
have software running on it that allows it to act as a Web server, an e-mail server and an FTP server.
3TU U3T 3TU U3T

Clients that come to a server machine do so with a specific intent, so clients direct their requests to a
specific software server running on the overall server machine. For example, if you are running a Web
browser on your machine, it will most likely want to talk to the Web server on the server machine.
Your Telnet application will want to talk to the Telnet server, your e-mail application will talk to the e-mail
3TU U3T

server, and so on.

Page 2 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


Hypertext Transfer Protocol (http)

Short for Hypertext Transfer Protocol, the underlying protocol used by the World. HTTP defines how
3TU U3T

messages are formatted and transmitted, and what actions Web servers and browsers should take in
3TU U3T 3TU U3T

response to various commands. For example, when you enter a URL in your browser, this actually sends
3TU U3T

an HTTP command to the Web server directing it to fetch and transmit the requested Web page. There is 3TU U3T

much more to HTTP than simply sending the message that an end user wants to see a web page. HTTP
actually identifies eight different methods which indicate what the desired action is and what action
should be performed. These eight different methods are:

HEAD – Asks for the material in a GET request, but without the response body.
GET – Requests the representation of a specified source with a response body.
POST – Submits the data to be processed from an HTML form to the identified source.
PUT – Uploads a representation of the source that has been specified.
DELETE – Deletes a specific source.
TRACE – This echoes back a specific request so that the user can see what servers are adding or
changing the request.
OPTIONS – Used to check the functionality of a web server by returning the HTTP methods that
the server supports for a specified URL.
CONNECT – Facilitates SSL-encrypted communication through an unencrypted HTTP proxy by
converting the request connection to a transparent TCP/IP tunnel.

Important to communication and the way the entire Internet works, the hypertext transfer protocol or
HTTP is a necessary protocol.

The other main standard that controls how the World Wide Web works is HTML, which covers how Web 3TU U3T

pages are formatted and displayed.

HTML
HTML is an abbreviation that stands for Hypertext Markup Language. It is the language of web pages—
the markup language that browsers read to render web pages.
0T 0T 0T 0T

HTML refers to a markup language that has several versions and web browsers and other user
agents have varying levels of support for these versions. In general, the earlier a version is, the more
0T 0T

browser support there is for that version.

To publish information for global distribution, one needs a universally understood language, a kind of
publishing mother tongue that all computers may potentially understand. The publishing language used
by the World Wide Web is HTML (from Hypertext Markup Language).

HTML gives authors the means to:

Publish online documents with headings, text, tables, lists, photos, etc.
Retrieve online information via hypertext links, at the click of a button.

Page 3 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


Design forms for conducting transactions with remote services, for use in searching for
information, making reservations, ordering products, etc.
Include spread-sheets, video clips, sound clips, and other applications directly in their documents.

HTML Structure & Presentation


When doing HTML coding we should know that there is difference between the HTML presentation and
42T

HTML structure.

STRUCTURE defines the semantics and structural markup of the HTML document, whereas
42T

PRESENTATION is what we see when the HTML appears in browser. Commonly called style and includes
appearance and use of multimedia.

These two are commonly written separately and called document and cascade style sheet (CSS). CSS
42T

controls every aspect of webpage presentation.

Media Access Control (MAC) address


The MAC address is a unique value associated with a network adapter. MAC addresses are also known as
hardware addresses or physical addresses. They uniquely identify an adapter on a LAN.

MAC addresses are 12-digit hexadecimal numbers (48 bits in length). By convention, MAC addresses are
usually written in one of the following two formats:

MM:MM:MM:SS:SS:SS
MM-MM-MM-SS-SS-SS

The first half of a MAC address contains the ID number of the adapter manufacturer. These IDs are
regulated by an Internet standards body. The second half of a MAC address represents the serial number
assigned to the adapter by the manufacturer.

In the example “00:A0:C9:14:C8:29”

The prefix “00A0C9”

Indicates the manufacturer is Intel Corporation.

Why MAC Addresses?


Recall that TCP/IP and other mainstream networking architectures generally adopt the OSI model. In this
model, network functionality is subdivided into layers. MAC addresses function at the data link layer (layer
2 in the OSI model). They allow computers to uniquely identify themselves on a network at this relatively
low level.

Page 4 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


URL (Uniform Resource Locator) definition
Posted by: Margaret Rouse
WhatIs.com

A URL (Uniform Resource Locator, previously Universal Resource Locator) - usually pronounced by
sounding out each letter but, in some quarters, pronounced "Earl" - is the unique address for a file that is
accessible on the Internet. A common way to get to a Web site is to enter the URL of its home page file in
your Web browser's address line. However, any file within that Web site can also be specified with a URL.
Such a file might be any Web (HTML) page other than the home page, an image file, or a program such as
a common gateway interface application or Java applet. The URL contains the name of the protocol to be
used to access the file resource, a domain name that identifies a specific computer on the Internet, and a
pathname, a hierarchical description that specifies the location of a file in that computer.
On the Web (which uses the Hypertext Transfer Protocol, or HTTP), an example of a URL is:
http://www.ietf.org/rfc/rfc2396.txt
3TU U3T

which specifies the use of a HTTP (Web browser) application, a unique computer named www.ietf.org, and
the location of a text file or page to be accessed on that computer whose pathname is /rfc/rfc2396.txt.

A URL for a particular image on a Web site might look like this:
http://searchnetworking.techtarget.com/WhatIs/images/coaxla.gif
3TU U3T

A URL for a file meant to be downloaded using the File Transfer Protocol (FTP) would require that the "ftp"
protocol be specified like this hypothetical URL:
ftp://www.somecompany.com/whitepapers/widgets.ps
3TU U3T

Cookies
Cookies are very small text files placed on your computer by a Web server when you view some sites
0T 0T 0T 0T 0T 0T

online (not all Web sites place cookies). They're used to store data about you and your preferences so that
the Web server doesn't have to repeatedly request this information, potentially slowing down load time.

Cookies are commonly used to store personal registration data like your name, your address, the contents
of a shopping cart, and your preferred layout for a Web page, what map you might be looking at, and so
on. Cookies make it easy for Web servers to personalize information to fit your specific needs and
preferences when you're visiting a Web site.

Implications of Cookies
The easiest answer is that cookies, in and of themselves, are completely harmless. However, some Web
sites use them to track users as they browse the Web, collecting highly personal information and often
discreetly transferring that information to other Web sites without permission or warning. This is why we
often hear about Web cookies in the news.

Page 5 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


DNS
It's like your computer's GPS for the Internet. Its basic job is to turn a user-friendly domain name like
"google.com" into an Internet Protocol (IP) address like 64.233.167.104 that computers use to identify
each other on the network.

Computers and other network devices on the Internet use an IP address to route your request to the site
you're trying to reach. This is similar to dialing a phone number to connect to the person you're trying to
call. Thanks to DNS, though, you don't have to keep your own address book of IP addresses. Instead, you
just connect through a domain name server, also called a DNS server or name server, which manages a
massive database that maps domain names to IP addresses.

Internet Protocol (IP) address


Every machine on a network has a unique identifier. Just as you would address a letter to send in the mail,
computers use the unique identifier to send data to specific computers on a network. Most networks
today, including all computers on the Internet, use the TCP/IP protocol as the standard for communicating
0T 0T

on the network. In the TCP/IP protocol, the unique identifier for a computer is called its IP address.

There are two standards for IP addresses: IP Version 4 (IPv4) and IP Version 6 (IPv6). All computers with
IP addresses have an IPv4 address, and many are starting to use the new IPv6 address system as well.
Here's what these two address types mean:
IPv4 uses 32 binary bits to create a single unique address on the network. An IPv4 address is
expressed by four numbers separated by dots. Each number is the decimal (base-10)

Page 6 of 7
Computer Science 2210 (Notes)
Chapter: 1.2 Communication and Internet
technologies

Topic: 1.2.3 Internet principles of operation


representation for an eight-digit binary (base-2) number, also called an octet. For example:
U U

216.27.61.137
IPv6 uses 128 binary bits to create a single unique address on the network. An IPv6 address is
expressed by eight groups of hexadecimal (base-16) numbers separated by colons, as in
2001:cdba:0000:0000:0000:0000:3257:9652. Groups of numbers that contain all zeros are often
omitted to save space, leaving a colon separator to mark the gap (as in 2001: cdba: 3257:9652).

MAC vs. IP Addressing


The MAC address generally remains fixed and follows the network device, but the IP address changes as
the network device moves from one network to another. IP networks maintain a mapping between the IP
address of a device and its MAC address.

Page 7 of 7
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates

Logic gates serve as the building blocks to digital logic circuits using combinational logic. Many
electronic circuits operate using binary logic gates. Logic gates basically process signals which represent
true or false or the equivalent i.e. ON or OFF, 1 or 0

Whilst there are a number of logic gates, only the six simplest are covered in this booklet:

1. NOT gate
2. AND gate
3. OR gate
4. NAND gate
5. NOR gate
6. XOR gate.

The following notes describe the function of all six gates, how to produce truth tables, how to design
networks using logic gates, and how to determine the output from a logic network

The six main logic gates


The most common symbols used to represent logic gates are shown below. To avoid confusion the
graphical representations will be used in exam questions but candidates may use either set of symbols
when answering questions.

Simple graphical representation

AND OR NOT NAND NOR XOR

Page 1 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


Symbols used to represent logic gates

Page 2 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


A Truth Table is simply a table listing all the combinations of inputs and their respective outputs.

The NOT gate has only one input, but the rest have 2 inputs.

The next section describes the function of all six logic gates.

Name Symbol Logic Truth Table


NOT GATE The output (called X)
is true (i.e.1 or ON)
when the INPUT A is
NOT TRUE (i.e. 0 or
OFF)

AND GATE The output is only


true (i.e.1 or ON)
when the
(INPUT A AND
INPUT B) are both
TRUE (i.e. 0
or OFF)
OR GATE The output is true
(i.e.1 or ON) if
(INPUT A OR INPUT
B) are TRUE (i.e. 0 or
OFF)

NAND GATE This is basically an


AND gate with the
output inverted
The output is true
(i.e.1 or ON) if
(INPUT A AND
INPUT B) are NOT
both TRUE (i.e. 0
or OFF)
NOR GATE This is basically an
OR gate with the
output inverted
The output is true
(i.e.1 or ON) if
NOT (INPUT A AND
INPUT B) are TRUE

Page 3 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


EXCLUSIVE- The output is true
OR GATE only when the inputs
(XOR GATE) are opposite of each
other

The tables above containing 1s and 0s are known as truth tables and are an integral part of logic gates
U U

functionality. These are used extensively throughout this booklet in the design and testing of logic
networks built up from logic gates.

Combinations of logic gates


It is possible to combine logic gates together to produce more complex logic networks.

This booklet will only deal with a maximum of three inputs and up to six logic gates. The output from a
logic network is checked by producing the truth table (as shown in the examples below).

We will deal with two different scenarios here. The first involves drawing the truth table from a given logic
network and the second involves designing a logic network for a given problem and then testing it by
drawing the truth table.

Producing the truth table from a given logic network


Consider the following logic network which contains three inputs and three logic gates:

Page 4 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


If we now look at the output in two stages. First let us consider the outputs being produced at stages “S”
and “T”. To do this, we need to draw a truth table. There are three inputs (A, B and C) which gives 23 (i.e. 8)
possible combinations of 1s and 0s. To work out the outputs at “S” and “T” we need to refer to the truth
tables for the NOR gate and for the AND gate. For example, when A = 1 and B = 1 then we have 1 NOR 1
which gives the value of S = 0. Continuing doing the same thing for all 8 possible inputs we get the
following interim truth table:

Page 5 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


Designing logic networks to solve a specific problem and testing using truth tables

Consider the following problem:


“If button A or button B are on and button C is off then the alarm X goes on”

We can convert this into logic gate terminology (ON = 1 and OFF = 0):
If (A = 1 OR B = 1) AND (C = NOT 1) then (X = 1)
(Notice: rather than write 0 we use NOT 1)

To draw the logic network, we do each part in brackets first i.e. A = 1 OR B = 1 is one gate then C = NOT 1
is the second gate. These are then joined together by the AND gate. Once the logic network is drawn we
can then test it using a truth table. Remember the original problem – we are looking for the output to be 1
when A or B is 1 and when C is 0. Thus we get the following logic network and truth table from the
network. Looking at the values in the truth table, we will be able to clearly see that it matches up with the
original problem which then gives us confidence that the logic network is correct.

Page 6 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates


Let us now consider a second problem:

A steel rolling mill is to be controlled by a logic network made up of AND, OR and NOT gates only. The mill
receives a stop signal (i.e. S = 1) depending on the following input bits:

A stop signal (S = 1) occurs when:


Either Length, L > 100 meters and Velocity, V < 10 m/s
Or Temperature, T < 1000 C and Velocity, V > 10 m/s
Draw a logic network and truth table to show all the possible situations when the stop signal could be
received.

The first thing to do is to try and turn the question into a series of logic gates and then the problem
becomes much simplified.

The first statement can be re-written as: (L = 1 AND V = NOT 1) since Length > 100 meters
corresponds to a binary value of 1 and Velocity < 10 m/s corresponds to a binary value of 0 (i.e.
NOT 1).
The second statement can be re-written as (T = NOT 1 AND V = 1) since Temperature < 1000C
corresponds to a binary value of 0 (i.e. NOT 1) and Velocity > 10 m/s corresponds to a binary value
of 1
Both these statements are joined together by OR which gives us the logic statement:
if (L = 1 AND V = NOT 1) OR (T = NOT 1 AND V = 1) then S = 1

We can now draw the logic network and truth table to give the solution to the original problem (input L has
been put at the bottom of the diagram just to avoid crossing over of lines; it merely makes it look neater
and less complex and isn’t essential):

Page 7 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.1 Logic gates

Page 8 of 8
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.2 Computer architecture and the fetch execute

Von Neumann Architecture

The earliest computing machines had fixed programs. For example, a desk calculator (in principle) is a
fixed program computer. It can do basic mathematics, but it cannot be used as a word processor or a
gaming console. Changing the program of a fixed-program machine requires re-wiring, re-structuring, or
re-designing the machine. The earliest computers were not so much "programmed" as they were
"designed". "Reprogramming", when it was possible at all, was a laborious process, starting with
flowcharts and paper notes, followed by detailed engineering designs, and then the often-arduous process
of physically re-wiring and re-building the machine. It could take three weeks to set up a program on
ENIAC (a computer of 1940s) and get it working.

The phrase Von Neumann architecture derives from a paper written by computer scientist John von
Neumann in 1945. This describes design architecture for an electronic digital computer with subdivisions
of a central arithmetic part, a central control part, a memory to store both data and instructions, external
storage, and input and output mechanisms. The meaning of the phrase has evolved to mean a stored-
program computer. A stored-program digital computer is one that keeps its programmed instructions, as
well as its data, in read-write, random-access memory (RAM). So John Von Neumann introduced the idea
of the stored program. Previously data and programs were stored in separate memories. Von Neumann
realized that data and programs are indistinguishable and can, therefore, use the same memory. On a
large scale, the ability to treat instructions as data is what makes assemblers, compilers and other
automated programming tools possible. One can "write programs which write programs". This led to the
introduction of compilers which accepted high level language source code as input and produced binary
code as output.

Page 1 of 4
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.2 Computer architecture and the fetch execute


The Von Neumann architecture uses a single processor which follows a linear sequence of fetch-decode-
execute. In order to do this, the processor has to use some special registers, which are discrete memory
locations with special purposes attached. These are:

Register Meaning
PC Program Counter
CIR Current Instruction Register
MAR Memory Address Register
MDR Memory Data Register
IR/IX Index Register
Accumulator Holds results
Status Process states such as whether a result is zero,
Register positive/negative or resulted in overflow.

The program counter keeps track of where to find the next instruction so that a copy of the
instruction can be placed in the current instruction register. Sometimes the program counter is
called the Sequence Control Register (SCR) as it controls the sequence in which instructions are
executed.

The current instruction register holds the instruction that is to be executed.

The memory address register is used to hold the memory address that contains either the next
piece of data or an instruction that is to be used.

The memory data register acts like a buffer and holds anything that is copied from the memory
ready for the processor to use it.

The central processor contains the arithmetic-logic unit (also known as the arithmetic unit) and the
control unit. The arithmetic-logic unit (ALU) is where data is processed. This involves arithmetic and
logical operations. Arithmetic operations are those that add and subtract numbers, and so on. Logical
operations involve comparing binary patterns and making decisions.

The control unit fetches instructions from memory, decodes them and synchronizes the operations before
sending signals to other parts of the computer.

The accumulator is in the arithmetic unit, the program counter and the instruction registers are in
the control unit and the memory data register and memory address register are in the processor.

An index register is a microprocessor register used for modifying operand addresses during the
run of a program, typically for doing vector/array operations. Index registers are used for a special
kind of indirect addressing where an immediate constant (i.e. which is part of the instruction itself)
is added to the contents of the index register to form the address to the actual operand or data.

Page 2 of 4
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.2 Computer architecture and the fetch execute

A typical layout is shown in following which also shows the data paths.

Page 3 of 4
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.2 Computer architecture and the fetch execute


The Fetch-Decode-Execute-Reset Cycle
The following is an algorithm that shows the steps in the cycle. At the end, the cycle is reset and the
algorithm repeated.

1. Load the address that is in the program counter (PC) into the memory
address register (MAR).
2. Increment the PC by 1.
3. Load the instruction that is in the memory address given by the MAR into
the memory data register (MDR).
4. Load the instruction that is now in the MDR into the current instruction
register (CIR).
5. Decode the instruction that is in the CIR.
6. If the instruction is a jump instruction then
a. Load the address part of the instruction into the PC
b. Reset by going to step 1.
7. Execute the instruction.
8. Reset by going to step 1.

Steps 1 to 4 are the fetch part of the cycle. Steps 5, 6a and 7 are the execute part of the cycle and steps
6b and 8 are the reset part.

Step 1 simply places the address of the next instruction into the memory address register so that the
control unit can fetch the instruction from the right part of the memory. The program counter is then
incremented by 1 so that it contains the address of the next instruction, assuming that the instructions
are in consecutive locations.
The memory data register is used whenever anything is to go from the central processing unit to main
memory, or vice versa. Thus the next instruction is copied from memory into the MDR and is then copied
into the current instruction register.

Now that the instruction has been fetched the control unit can decode it and decide what has to be done.
This is the execute part of the cycle. If it is an arithmetic instruction, this can be executed and the cycle
can restart as the PC contains the address of the next instruction in order. However, if the instruction
involves jumping to an instruction that is not the next one in order, the PC has to be loaded with the
address of the instruction that is to be executed next. This address is in the address part of the current
instruction, hence the address part is loaded into the PC before the cycle is reset and starts all over again.

A CPU cannot do math on data registers, although it can do it indirectly with an index register. The index
register works with the data registers, allowing a program to process strings of data efficiently. To
process your first name, for example, a program move 300 to MAR and zero to the index register. An
indexed operation adds the index value to the MDR, retrieving the letter at location 300. Next, the program
increments the index by one and gets the next letter. It repeats this process until it has moved the whole
name. By itself, the index register does little; its value is that it gives greater speed and convenience to
address registers.

Page 4 of 4
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices

An information system cannot do anything until you give it some information to process. Input devices
transfer data into a computerized information system so that it can be processed. Remember that the
0T 0T 0T 0T

computer does not process information; it processes data.


0T 0T 0T 0T 0T 0T

An input device transfers data from the outside world into a computer.
40TU

There are two different categories of input device. They are:

Manual Input Devices: With a manual input device the user must enter data into the computer by
hand. E.g. mouse, keyboard, scanner.

Direct Data Entry (DDE) Devices: A direct data entry device can transfer information automatically
from a source document such as a form or barcode into the computer. The user does not need to
manually enter the information. E.g. optical mark recognition, smart cards.

There are many different input devices available. Each input device is suitable for a different purpose.

Graphics Tablets
Cameras
Video Capture Hardware
Trackballs
Barcode reader
Digital camera
Gamepad
Joystick
Keyboard
Microphone
MIDI keyboard
Mouse (pointing device)
Scanner
Webcam
Touchpad
Pen Input
Microphone
Electronic Whiteboard

Page 1 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


Now you will see the working of some of the input devices:

SCANNERS
2D SCANNERS:
A scanner is a series of charge coupled devices (CCDs) (an array of photosensitive cells) mounted in a
stationary row that registers the presence or absence of light reflected from a piece of flat art. This spot of
light is then the "pixel" equivalent of the dot on the paper. The entire scanned image is built up row by row
as the light scans the paper and is reflected onto the CCD.

The number of pixels horizontally is controlled by how closely the CCDs are placed next to each other
along the single row. The number of pixels vertically is controlled by how slowly the light bar and mirror
inch along the length of the flat art thus reflecting onto the CCDs. Therefore, the more CCDs and the
smaller the steps of the advancing light bar the greater the resolution. Typically the resolution available is
600 dots per inch for full color (just 3 separate scans with filters).

Line Art scanning is simply transferring pen and ink style drawings, clip art, and some pencil
0T 0T

sketches into the computer system. Line Art has neither shading nor color other than black. Line
Art scanning is considered 1-bit scanning, that is the computer sees the image as either black or
white.

Grayscale Scanning is most often used for original photographs, but can also be effective for
0T 0T

maintaining the soft edge of some pencil sketches that use lots of shading. Most good flatbed
desktop grayscale scanners are now capable of scanning 256 shades of grey.

Halftone Scanning is essentially a grayscale scan with processing to reduce the threat of more
0T 0T

patterns. (These are caused by the scan sampling interfering with the printing sampling due to the
halftone printing process).

Color Scanning is done on a continuous-tone device in a non-screened system that is capable of


0T 0T

applying the entire range of its colors to the smallest picture element that it can reproduce. In
effect, this means that the device is capable of making any spot on its output any color you wish.

Page 2 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


3D SCANNERS:
There are many different devices that can be called 3D scanners. Any device that measures the physical
world using lasers, lights, or x-rays and generates dense point clouds or polygon meshes can be
considered a 3D scanner. They go by many names including 3D digitizers, laser scanners, white light
scanners, industrial CT, LIDAR, and others. The common uniting factor of all these devices is that they
capture the geometry of physical objects with hundreds of thousands or millions of measurements.

There are many different approaches to 3D scanning, based on different principles of imaging. Some
technologies are ideal for short-range scanning, while others are better for mid- or long-range scanning.

Short-Range (<1 meter focal distance)

Laser Triangulation 3D Scanners


40T 40T

Laser triangulation scanners use either a laser line or single laser point to scan across an object. A sensor
picks up the laser light that is reflected off the object, and using trigonometric triangulation, the system
calculates the distance from the object to the scanner.
The distance between the laser source and the sensor is known very precisely, as well as the angle
between the laser and the sensor. As the laser light reflects off the scanned object, the system can
discern what angle it is returning to the sensor at, and therefore the distance from the laser source to the
object’s surface.

Structured Light (White or Blue Light) 3D Scanners


40T 40T

Page 3 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices

Structured light scanners also use trigonometric triangulation, but instead of looking at laser light, these
systems project a series of linear patterns onto an object. Then, by examining the edges of each line in the
pattern, they calculate the distance from the scanner to the object’s surface. Essentially, instead of the
camera seeing a laser line, it sees the edge of the projected pattern, and calculates the distance similarly.

Short-range 3D Scanner Types


40T Pros
40T Cons
40T

Laser triangulation Available in many forms Generally less accurate


Area scanner Generally lower resolution
Handheld Higher noise
Portable arm
Often more
portable
Less part prep
needed
Less sensitive to
ambient light
Pattern fringe triangulation Usually more accurate Limited to area scanner type
Often higher resolution Generally not as
Lower noise small/portable
More sensitive to surface
finish (requires prep)
May require specific lighting

Mid- and Long Range (>2 meters focal distance)

Laser Pulse-based 3D Scanners


40T 40T

Laser pulse-based scanners, also known as time-of-flight scanners, are based on a very simple concept:
the speed of light is known very precisely, so if we know how long a laser takes to reach an object and
reflect back to a sensor, we know how far away that object is. These systems use circuitry that is accurate
to picoseconds to measure the time it takes for millions of pulses of the laser to return to the sensor, and
calculates a distance. By rotating the laser and sensor (usually via a mirror), the scanner can scan up to a
full 360 degrees around itself.

Page 4 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


Laser Phase-shift 3D Scanners
40T 40T

Laser phase-shift systems are another type of time-of-flight 3D scanner technology, and conceptually
work similarly to pulse-based systems. In addition to pulsing the laser, these systems also modulate the
power of the laser beam, and the scanner compares the phase of the laser being sent out and then
returned to the sensor. For reasons that are beyond this web page’s scope, phase shift measurement is
more precise.

Mid- and Long-range 3D Scanner


40T Pros
40T Cons
40T

Types
Pulse-based Medium and long range 0T 0T Less accurate
(2m – 1000m) Slower data acquisition
Higher noise
Phase-shift More accurate Medium range only
Faster data acquisition
Lower noise

Page 5 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


BARCODE READER
There are many types of barcode scanners such as Laser scanners, CCD barcode scanners,
imager type scanners, and more. Our first focus will be on how a CCD barcode scanner works.

Bar codes are read into the computer using a wand or a fixed scanner. Bar codes are not easily damaged
and can normally still be read if they are creased or not stuck onto a flat surface. They can be printed
using a normal printer and ink and so are cheap to produce. The information normally included on a bar
code for a product is country of origin, manufacturer and item code. The price is not included in the bar
code.

The CCD barcode scanner is a scanner that has no moving parts. CCD stands for Charged-Coupled Devise
Scanner. The scanner has a light source that when pointed to an object or barcode, it illuminates that
image. The image is usually a barcode. Once the barcode is illuminated, a reflection is created and the
barcode scanner reads that image.

How does the barcode scanner read the image? Well, there is a linear photodiode within the scanner head.
This photodiode can read the reflected light off the lines on the barcode. This reflection is a digital image
that is then scanned electronically within the device. When the image is scanned electronically, each bar
on the barcode is converted to the corresponding number or letter.

The barcode scanner is connected to a PC or Mac and the CCD scanner then sends the sequence of
numbers and/or letters to the PC or Mac to populate the field of entry. This connection can be made in a
number of ways. One way is with a keyboard wedge. This is a Y connection where one end of the Y
connects to the keyboard and the other end of the Y connects to the scanner with the bottom of the Y
plugging into the PC where the keyboard would normally connect. This method is used many times when
the PC does not have enough interfaces. Serial is another connection method and works with just a
straight serial cable from the barcode scanner directly to the PC serial connection. USB is now about the
most popular method, because most PC's and Mac's today have many USB ports. Just plug and play!

Now we can look at how a laser barcode scanner works. The laser scanner works by sending a low energy
light beam or laser beam to read the spacing between patterns on the image one space at a time. The
beam is moving back and forth by using a mobile mirror which causes a blinking effect. You can usually
see the red line moving over the barcode. The reflection comes back and is then read by the fixed mirror in
the scanner. The scanner then generates analog and digital signals that match the pattern. A barcode
reader decoder then processes the information and sends it through the data communications interface.

Page 6 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices

DIGITAL CAMERAS:
A digital camera takes light and focuses it via the lens onto a sensor made out of silicon. It is made up of
a grid of tiny photosites that are sensitive to light. Each photosite is usually called a pixel, a contraction of
0T 0T 0T 0T 0T 0T

"picture element". There are millions of these individual pixels in the sensor of a DSLR camera.

Digital cameras sample light from the outside world, or outer space, spatially, tonally and by time. Spatial
sampling means the angle of view that the camera sees is broken down into the rectangular grid of pixels.
Tonal sampling means the continuously varying tones of brightness in nature are broken down into
individual discrete steps of tone. If there are enough samples, both spatially and tonally, we perceive it as
faithful representation of the original scene. Time sampling means we make an exposure of a given
duration.

Our eyes also sample the world in a way that can be thought of as a "time exposure", usually on a
relatively short basis of a few tenths of a second when the light levels are high as in the daytime. Under
low light conditions, the eye's exposure, or integration time can increase to several seconds. This is why
0T 0T 0T 0T

we can see more details through a telescope if we stare at a faint object for a period of time.

TOUCH SENSITIVE SCREENS:


These screens do a similar job to concept keyboards. Grids of light beams or fine wires crisscross the
computer screen. When you touch the screen, the computer senses where you have pressed. Touch
screens can be used to choose options which are displayed on the screen. Touch screens are not used
very often as they are not very accurate, tiring to use for a long period and are more expensive than
alternatives like a mouse. The main applications for which touch screens are used are the provision of
public information systems. Touch screen operated computers can be found in places such as travel
agents, airports, and ATM’s.

MOUSE
A mouse is the most common pointing device. You move the mouse around on a mat and a small cursor
called a pointer follows your movements on the computer screen. By pressing a button on the mouse
(most mice have 1, 2 or 3 buttons) you can select options using icons or menus on the screen. Mice can
also be used to "draw" onto the screen. They are particularly useful if your computer has a graphical user
interface.

Most mice use a small ball located underneath them to calculate the direction that you are moving the
mouse in. As you move the mouse, this ball rotates. The mouse monitors how far the ball turns and in
what direction and sends this information to the computer to move the pointer on the screen.

Page 7 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


KEYBOARD
Almost all computers are supplied with a keyboard. A keyboard has over a hundred keys on it. When you
press a key, a number (ASCII code) is sent to the computer to tell it which key you have pressed. The
keys are arranged in four groups:

The keys on a keyboard are usually arranged in the same order as those on a typewriter. This layout of
keys is called QWERTY because Q-W-E-R-T-Y is the order in which the letters occur on the top row of the
keyboard. Some newer designs have the letters arranged in a different order such as the DVORAK
keyboard. Most people find the QWERTY arrangement best as they have had some practice using it, but
users trained on the new keyboards can type faster than the fastest typists can on QWERTY keyboards.

CONCEPT KEYBOARD
A concept keyboard is a flat board which contains a grid of switches. Each switch can be programmed to
do whatever you want. An overlay image is placed on top of the grid so that the user can tell what
0T 0T4 0T4 0T

pressing on different areas (switches) will do. Example uses of concept keyboards include:

Games for young children: The overlay image could be a picture of a farmyard. Pressing on
40T 0T4 0T

an animal would cause the computer to make the noise that the animal does.
Tills in restaurants/pubs: The overlay contains a list of all the meals that can be sold. Instead
40T 0T4 0T

of typing in prices the waiter simply presses the keyboard where the meals/drinks he is serving are
listed.

Concept keyboards are particularly useful for people who would find using an ordinary keyboard difficult
and in locations where an ordinary keyboard might be damaged, e.g. by spillage or dust.

Page 8 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


TOUCH SCREENS ON MOBILE DEVICES:
There are three types of touch screens:
Capacitive,
Resistive,
Infrared.

There are some basic differences in the way these three types of technology work. Resistive screens are
made out of various layers. The commands for finger or stylus are made in the outer layer, which comes
into contact with a flexible and protective membrane. The third layer is the first screen that touches the
screen and closes the circuit. This type of screens doesn’t support multi-touch, because the circuits can
come in conflict.
Capacitive screens are made out of a protection layer, one with transparent electrodes and glass
substrate. These electrodes are the ones that capture commands. The electrical induction of the fingers
enables this layer to send signals to the running software.

The oldest and easiest to understand kind of screen is the infrared one. At the edges of the screen there
are several infrared emitters and receivers. The transmitters are placed on one side of the screen and the
receivers are placed on the other side. We have a matrix of vertical and horizontal infrared. If you press the
screen with your finger, any infrared beam (vertical and horizontal) is interrupted. The system detects
what rays have been interrupted, thus it knows what area of the screen is being pressed and acts
accordingly.

Page 9 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


Interactive whiteboards (SMART BOARDS)
While the traditional white board already has everyone’s attention, the electronic device is a new
technology that is slowly gaining popularity due to its interactive power.

The digital screen allows images from the computer to be displayed on a board. It can also be modified on
the screen itself, using a pen or a highlighting tool. Its touch screen feature allows teachers to run
programs directly from the screen simply by tapping the application with her finger and even makes
scrolling easy.
Smart Boards are becoming an essential component of every classroom. Some reasons for this trend is
that:

It can accommodate different learning styles. Tactical learners can use the screen and learn by
40T

touching and marking at the board, audio learners can have a discussion and visual learners can
observe the teaching on the board.
It is neater and does not have the cleanliness hassle and is therefore easier to maintain.
40T

Most teachers understand the “why” but struggle with the “how”. Here are some ideas on how you
40T

can use Smart Boards.


Use it as a tool for note-taking. Students can come and write important points on the board.
40T

Alternately, you can appoint a student to type out notes on the computer while you talk, so that the
other students can view and take them down.
Brainstorming in the classroom can be fun with a Smart Board. You can not only put together text/
40T

ideas but also images, diagrams or videos.


Classroom games can be played with ease on the board. Board games in particular can be played
40T

on the board itself.


All forms of media– videos, photographs, graphs, maps, illustrations, games, etc. – can be used on
40T

the board, making it incredibly dynamic in nature. This expands the range of content that you can
use for teaching or presenting new information.

A lot of new software is available for free on the internet that can be easily integrated. There are many
forums and websites that aim to help teachers by providing Smart Board ideas and activities. Explore
these for more ideas.
The Smart Board is tomorrow’s technology and is bound to change the look of classrooms forever. Using
smart boards in your classroom can help you stay ahead with technology that could make the education
process simpler and perhaps even more productive.

Page 10 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


Microphones
Microphones are a type of transducer - a device which converts energy from one form to another.
Microphones convert acoustical energy (sound waves) into electrical energy (the audio signal).

Different types of microphone have different ways of converting energy but they all share one thing in
common: The diaphragm. This is a thin piece of material (such as paper, plastic or aluminium) which
vibrates when it is struck by sound waves. In a typical hand-held mic like the one below, the diaphragm is
located in the head of the microphone.

When the diaphragm vibrates, it causes other components in the microphone to vibrate. These vibrations
are converted into an electrical current which becomes the audio signal.

Note: At the other end of the audio chain, the loudspeaker is also a transducer - it converts the electrical
energy back into acoustical energy.

QR Code Scanner:
A barcode scanner is composed of three parts: the illuminator, the decoder, and the sensor/convertor. The
barcode scanner illuminates the barcode with red light using the illuminator system. The
sensor/convertor part of the scanner then detects the reflected light. Once the light is detected, an analog
signal is generated. This signal contains varying voltage based on the intensities of the light reflection.
The analog signal is converted by the sensor into a digital signal. The digital signal is then interpreted by
the decoder. The decoder then sends the information to the computer attached to the scanner.

QR code T 31T

Page 11 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


In the case of QR code scanner, the decoder sends the information to your mobile phone instead of a
computer. The app you download for your phone that is a QR code scanner contains the illuminator, which
is the red light that runs across the screen when you open the app. The sensor and decoder then work to
decode the QR code. Then the decoder sends the information to your phone, and you will be able to see
where the QR code was supposed to take you.

The way the scanner reads the reflected light it actually a lot more complicated than the way that I simply
described it, but I think it's fascinating that all you have to do is download a free app and all of a sudden
your phone is a barcode scanner. The barcode was first patented in 1952, and now almost every person
with a smart phone carries around their own barcode scanner with them every day. Since this scanning
technology is so easily accessible with most phones, QR codes as a marketing tool seem like they will be
around for a while.

Page 12 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


INPUT DEVICES IN REAL LIFE SCENARIOS

PASSPORT SCANNING AT AIRPORTS:


At the airports during immigration check, the passport scanner captures ultraviolet and infrared images,
as well the full page of a passport in color. In a simultaneous single action, the reader also decodes the
machine readable zone (MRZ) and processes eData, including the holder's image, from the chip.

The scanner then automatically detects when a document with machine readable data has been
presented. Additionally, it is able to compensate for out-of-position MRZ data, so that the advanced
recognition engine reliably provides highly accurate and very fast document reading capability, allowing
large volumes of documents and smart cards to be processed quickly and efficiently.

The unit features blue, amber, green and red LED lights to keep the user informed of statuses from ready
to scan through to processing and successful scan, or that there is an issue with the document. A
programmable audio beep provides additional user feedback to confirm successful scans.

Page 13 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


BARCODE READERS IN SUPERMARKET CHECKOUTS:
In case of a supermarket, a barcode can make the running of a supermarket easier. A customer walks into
a supermarket, picks some items and shows it to the cashier. The cashier takes the items, shows the
barcode on the item to a device (barcode scanner), the system calls up the product, item number, price
and other information related to the item and notes it. The cashier shows the other items to the system
and the system calls up the product in that manner. After the cashier has shown the last item to the
scanner, the total cost is displayed on the screen, the cash drawer is opened and receipt is generated
automatically, the system records the transaction against the account of the cashier that completed the
transaction. The manager just connects to the database and reviews the transaction summary performed
by his cashiers.

SENSORS:
Sensors are sophisticated devices that are frequently used to detect and respond to electrical or optical
40T 0T4 0T

signals. A sensor converts the physical parameter (for example: temperature, blood pressure, humidity,
0T 0T 0T 0T4 0T4 0T

speed, etc.) into a signal which can be measured electrically. Let’s explain the example of temperature.
0T 0T

The mercury in the glass thermometer expands and contracts the liquid to convert the measured
temperature which can be read by a viewer on the calibrated glass tube.

TEMPERATURE SENSORS:
Temperature is the most common of all physical measurements. We have temperature measurement-
and-control units, called thermostats, in our home heating systems, refrigerators, air conditioners, and
ovens. Temperature sensors are used on circuit boards, as part of thermal tests, in industrial controls, and
in room controls such as in calibration labs and data centers. Though there are many types of

Page 14 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


temperature sensors, most are passive devices: Thermocouples, RTDs (resistance temperature detectors),
and thermistors.

Thermocouples (T/Cs) are the most common type of sensor because they don’t require an excitation
signal. They consist of two wires made of different metals joined at the point of measurement. Based on
the See beck effect, T/Cs operate on the premise that each metal develops a voltage differential across its
length based on the type of metal and the difference in temperature between the ends of the wire. By
using two metals, you get two different voltages V1 and V2. The difference (VT) represents temperature.

Resistance-temperature detectors (RTDs) have a smaller range, typically a few hundred degrees
Centigrade, but they have better accuracy and resolution than thermocouples. RTDs use precision wire,
usually made of platinum, as the sense element. The element needs a known excitation current, typically
1mA. RTDs come in two, three, and four-wire configurations. Four-wire configurations, are usually used as
reference probes in calibration labs, have the best accuracy because two wires carry current and two are
used for measuring the resistance across the element.

LIGHT SENSORS:
A light sensor, as its name suggests, is a device that is used to detect light. There are many different types
of light sensors, each of which works in a slightly different way. A photocell or photo resistor, for example,
0T 0T 0T 0T

is a small sensor that changes its resistance when light shines on it; they are used in many consumer
products to determine the intensity of light. A charged coupled device (CCD) transports electrically
charged signals, and is used as a light sensor in digital cameras and night-vision devices.
Photomultipliers detect light and multiply it.

Devices that include these sensors have many uses in scientific applications, but are also found in items
that people encounter each day. A simple light sensor may be part of a security or safety device, such as a
burglar alarm or garage door opener. These types of devices often work by shining a beam of light from
0T 0T 0T 0T

one sensor to another; if the light is interrupted, an alarm sounds or the garage door won't close.

Many modern electronics, such as computers, wireless phones, and televisions, use ambient light sensors
to automatically control the brightness of a screen, especially in low-light or high-light situations. They
can detect how much light is in a room and raise or lower the brightness to a more comfortable level for
the user. Light sensors also may be used to automatically turn on lights inside or outside a home or
business at dark.

Barcode scanners found in most retailer locations work using light sensor technology. The light emitted
from the scanner illuminates the barcode, which is read and decoded by a sensor. Quick Response (QR)
codes operate in much the same way, though they contain more information and typically can be read
using a Smartphone if the user has downloaded a code reader.

Page 15 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


MAGNETIC FIELD SENSORS:
Magnetic sensors detect changes and disturbances in a magnetic field like flux, strength and direction.
Other types of detection sensors work with characteristics like temperature, pressure, light. From
established knowledge about the existing magnetic field and the data collected from sensors regarding
changes and alterations, many things can be known. Rotation, angles, direction, presence and electrical
current can all be monitored. Magnetic sensors are divided into two groups, those that measure the
complete magnetic field and those that measure vector components of the field. The vector components
are the individual points of the magnetic field. The techniques used to create these sensors involve
various combinations of physics and electronics.

Measuring a Magnetic Field


A magnetic field surrounds an electric current. The field is detectable by its force or interaction on
electrical charges, magnets and magnetic products. The strength and direction of a magnetic field can be
measured and documented. Fluctuations in that field are detected and adjustments or changes are made
in a machines response, a doctor’s decision, the direction the navigational instrument gives or the
response of a detection system. The Earth's magnetic field is a great example. It is measured and tracked
by magnetic sensors which are part of the navigational tools that Honeywell and other corporations
design and manufacture. Most magnetic sensors are used for measurement in industrial processes,
navigational tools, and scientific measuring.

Magnetic Sensing Technology


There are several types of technologies used to make a magnetic sensor work. Fluxgate, Hall Effect,
magneto-resistive, magneto inductive, proton precession, optical pump, nuclear precession, and SQUID
(superconducting quantum interference devices) each have a different approach to using magnetic
sensors. Magneto resistive devices record electrical resistance of the magnetic field. Magneto-inductive
are coils surrounding magnetic material whose ability to be permeated changes within the Earth's
magnetic field. Fluxgate measures magnetic fields against a known internally created magnetic based
response that runs through a continually fluxing set of parameters. Each type of technology focuses on a
particular area for detection, a measurement to be detected and way of recording changes.

GAS SENSORS:
In current technology scenario, monitoring of gases produced is very important. From home appliances
such as air conditioners to electric chimneys and safety systems at industries monitoring of gases is very
crucial. Gas sensors are very important part of such systems. Small like a nose, gas sensors
spontaneously react to the gas present, thus keeping the system updated about any alterations that occur
in the concentration of molecules at gaseous state.

Gas sensors are available in wide specifications depending on the sensitivity levels, type of gas to be
sensed, physical dimensions and numerous other factors. This Insight covers a methane gas sensor that
can sense gases such as ammonia which might get produced from methane. When a gas interacts with
this sensor, it is first ionized into its constituents and is then adsorbed by the sensing element. This
Page 16 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


adsorption creates a potential difference on the element which is conveyed to the processor unit through
output pins in form of current.

The gas sensor module consists of a steel exoskeleton under which a sensing element is housed. This
sensing element is subjected to current through connecting leads. This current is known as heating
current through it; the gases coming close to the sensing element get ionized and are absorbed by the
sensing element. This changes the resistance of the sensing element which alters the value of the current
going out of it.

PRESSURE SENSORS:
Based on the type of applications they are used in, pressure sensors can be categorized into many types.
However, following are most common types of pressure sensors that have been widely used:

1. Strain Gauge Type: These sensors are similar to a wheat stone bridge in their working. In wheat stone
bridge, the ratio of resistances of two adjacent arms connected to one end of the battery should be equal
to that of other two arms connected to another end of battery. When the two ratios are equal, no output is
generated from the wheat stone bridge. In the case of a strain gauge, one arm of the wheat stone bridge is
connected to a diaphragm. The diaphragm compresses and expands due to the pressure applied. This
variation in the diaphragm causes the output in the bridge to vary. A voltage would be generated
proportional to every deviation from the normal balanced condition, so every single compression or
expansion movement of the diaphragm will produce an output indicating a change in pressure conditions.
Since resistance change is the main cause for potential difference, these sensors are also termed as
piezo-resistive type of pressure sensors.

Page 17 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices

2. Capacitive Pressure Sensor: A capacitor has two metal plates and a dielectric sandwiched between
them. In capacitive pressure sensor, one of these metal plates is permitted to move in and out so that the
capacitance between them changes due to varying distance between the plates. The movable plate is
connected to a diaphragm which senses the pressure and then expands or compresses accordingly. The
movement of the diaphragm would affect the attached metal plate’s position and capacitance would vary.
These sensors, though much ineffective at high temperatures, are widely used at ambient temperature
range due to their linear output.

3. Piezoelectric Pressure Sensor: Piezoelectric crystals develop a potential difference (i.e. voltage is
induced across the surfaces) whenever they are subjected to any mechanical pressure. These sensors
have the crystal mounted on a dielectric base so that there is no current leakage. Attached to the crystal is
a horizontal shaft to which a diaphragm is connected. Whenever the diaphragm senses pressure, it
pushes the shaft down which pressurizes the crystal and voltage is produced.

MOISTURE SENSORS:
Operation of the sensor depends upon the adsorption of water vapor into a porous non-conducting
"sandwich" between two conductive layers built on top of a base ceramic substrate.

The active sensor layer and the porous top conductor, that allows transmission of water vapor into the
sensor, are engineered very thinly. Therefore the sensor responds very rapidly to changes in applied
moisture, both when being dried (on process start-up) and when called into action if there is moisture
ingress into a process. Despite this extreme sensitivity to changes in moisture content, the Impedance
Moisture Sensor can be incredibly rugged due to the nature of its construction. To protect the sensor
Page 18 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


further against contaminants and pipe sward it recommended that the sensor is housed in a protective
sintered stainless steel guard.

HUMIDITY SENSORS:
Humidity is the presence of water in air. The amount of water vapor in air can affect human comfort as
well as many manufacturing processes in industries. The presence of water vapor also influences various
physical, chemical, and biological processes. Humidity measurement in industries is critical because it
may affect the business cost of the product and the health and safety of the personnel. Hence, humidity
sensing is very important, especially in the control systems for industrial processes and human comfort.

Controlling or monitoring humidity is of paramount importance in many industrial & domestic


applications. In semiconductor industry, humidity or moisture levels needs to be properly controlled &
monitored during wafer processing. In medical applications, humidity control is required for respiratory
equipment, sterilizers, incubators, pharmaceutical processing, and biological products. Humidity control is
also necessary in chemical gas purification, dryers, ovens, film desiccation, paper and textile production,
and food processing. In agriculture, measurement of humidity is important for plantation protection (dew
prevention), soil moisture monitoring, etc. For domestic applications, humidity control is required for living
environment in buildings, cooking control for microwave ovens, etc. In all such applications and many
others, humidity sensors are employed to provide an indication of the moisture levels in the environment.

PH SENSORS:
In the process world, pH is an important parameter to be measured and controlled.

The pH of a solution indicates how acidic or basic (alkaline) it is. The pH term translates the values of the
hydrogen ion concentration- which ordinarily ranges between about 1 and 10 x -14 gram-equivalents
per liter - into numbers between 0 and 14.

On the pH scale a very acidic solution has a low pH value such as 0, 1, or 2 (which corresponds to a large
0T 0T

concentration of hydrogen ions; 10 x 0, 10 x -1, or 10 x -2 gram-equivalents per liter) while a very basic
0T 0T

solution has a high pH value, such as 12, 13, or 14 which corresponds to a small number of hydrogen ions
(10 x -12, 10 x -13, or 10 x -14 gram-equivalents per liter). A neutral solution such as water has a pH of
approximately 7.

A pH measurement loop is made up of three components, the pH sensor, which includes a measuring
electrode, a reference electrode, and a temperature sensor; a preamplifier; and an analyzer or transmitter.
A pH measurement loop is essentially a battery where the positive terminal is the measuring electrode and
the negative terminal is the reference electrode. The measuring electrode, which is sensitive to the
hydrogen ion, develops a potential (voltage) directly related to the hydrogen ion concentration of the
solution. The reference electrode provides a stable potential against which the measuring electrode can
be compared.

Page 19 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


When immersed in the solution, the reference electrode potential does not change with the changing
hydrogen ion concentration. A solution in the reference electrode also makes contact with the sample
solution and the measuring electrode through a junction, completing the circuit. Output of the measuring
electrode changes with temperature (even though the process remains at a constant pH), so a
temperature sensor is necessary to correct for this change in output. This is done in the analyzer or
transmitter software.

MOTION SENSORS:
The modern world is filled with gadgets that get excited when they sense human motion. Automatic doors
in elevators and shopping malls, burglar alarms at houses and shops, automatic lighting systems,
electronic amenities in washrooms are just a few examples where human presence or absence puts the
device into active or passive state. Now, what if we tell you that behind this smart response to motion is
a gizmo that does not even reach the 2cm mark in size. Known as Pyroelectric or Passive Infrared
Sensor (PIR, in both cases), this small electronic device is the curious case for this Insight.

Every object that has a temperature above perfect zero emits thermal energy (heat) in form of radiation.
We, Humans, radiate at wavelength of 9-10 micrometers all time of the day. The PIR sensors are tuned to
detect this IR wavelength which only emanates when a human being arrives in their proximity. The term
“pyroelectricity” means: heat that generates electricity (here, an electric signal of small amplitude). Since
these sensors do not have an infrared source of their own, they are also termed as passive.

SENSORS IN REAL LIFE SCENARIOS:

STREET LIGHTS:
Some lights don't have any sort of detectors. For example, in a large city, the traffic lights may simply
operate on timers -- no matter what time of day it is, there is going to be a lot of traffic. In the suburbs and
on country roads, however, detectors are common. They may detect when a car arrives at an intersection,
when too many cars are stacked up at an intersection (to control the length of the light), or when cars
have entered a turn lane (in order to activate the arrow light).

There are all sorts of technologies for detecting cars -- everything from lasers to rubber hoses filled with
0T 0T 0T 0T

air! By far the most common technique is the inductive loop. An inductive loop is simply a coil of wire
embedded in the road's surface. To install the loop, they lay the asphalt and then come back and cut a
groove in the asphalt with a saw. The wire is placed in the groove and sealed with a rubbery compound.
You can often see these big rectangular loops cut in the pavement because the compound is obvious.
Inductive loops work by detecting a change of inductance.

Page 20 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


SECURITY DEVICES:
Door and window sensors come in two pieces. One fits onto the door or window itself, while its
counterpart attaches to the frame. Adhesive usually keeps the sensors in place, though sensors can be
screwed directly into the frame. Position the two pieces of the sensor right next to each other, because
they interact. When the two pieces are separated, such as when the door or window is opened, they send a
signal to the alarm panel.0T

Door and window sensors should not be your sole line-of-defense in your home security system. A
shatter sensor detects the sound of a window breaking, alerting your alarm system in the process.
Likewise, it detects strong vibrations that a regular window sensor might not pick up on. Motion sensors
often rely on infrared energy detection. As someone moves through a room, the sensor detects the
changes in infrared energy and activates an alarm. It works from a distance, whereas door and window
sensors solely work for the door or window they’re attached to.

POLLUTION CONTROL
Air pollution comes from many different sources: stationary sources such as factories, power plants, and
0T 0T4 0T4 0T

smelters and smaller sources such as dry cleaners and degreasing operations; mobile sources such as 0T 0T4 0T4 0T

cars, buses, planes, trucks, and trains; and naturally occurring sources such as windblown dust, and
0T 0T4 0T4 0T

volcanic eruptions, all contribute to air pollution.

The amount of pollution also has an effect on total Air Quality. These pollution sources can also emit a
wide variety of pollutants. These pollutants are monitored by national, state and local organizations.

Monitoring stations are set up in mobile or fixed facilities equipped with instrumentation to monitor
pollutants down to very low levels. Part of this instrumentation invariably includes a wind sensor, as it is
important to know the influence of wind on any modeling that is done on the results.

GAMES
The innovative technology behind Kinect is a combination of hardware and software contained within the
Kinect sensor accessory that can be added to any existing Xbox 360. The Kinect sensor is a flat black box
0T 0T

that sits on a small platform, placed on a table or shelf near the television you're using with your Xbox
360. For a video game to use the features of the hardware, it must also use the proprietary layer of Kinect
software that enables body and voice recognition from the Kinect sensor
0T 0T 0T 0T 0T

The motion-sensor controls allow users much more freedom when playing games. The advantages it has
over a standard wireless control pad mostly revolve around response time and pointer accuracy. The
controller and motion-sensor bar react very quickly. Using the controller lets the user quickly move from
one side of the screen to the other with only a flick of the wrist. The motion-sensor bar is also very
accurate and intuitive: The pointer moves precisely as would be expected. Moreover, games such as
boxing or tennis are no longer a passive, couch-based entertainment. It can give the user actually enjoys a

Page 21 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


cardiovascular workout. Experts have shown that playing an energetic game provides excellent exercise
that burns calories and fat. A variety of games designed to simulate a workout routine or dance class is
also available. Lastly, the motion-sensor remote is very easy to use. It allows non-gamers to pick up the
remote and begin playing without having to learn complicated controls.

HOUSEHOLD APPLICATIONS
Sensors used in household appliances and consumer electronics comprise proximity sensors,
40T 0T4 0T

temperature sensors, pressure sensors, flow and level sensors as well as acoustic sensors, image
sensors and camera modules. Photodetectors, position sensors and rotary speed sensors are of
importance, too.

The use of sensors in household appliances is mainly driven by higher energy and resource efficiency
0T 0T4 0T4 0T

requirements, advanced performance and convenience standards as well as by smarter electronics to


improve ease of operation. New consumer electronic devices must be capable to handle media and data
0T 0T4 0T4 0T

simultaneously. The major sensors used are photosensors, image sensors, inertial sensors and acoustic
sensors.

Large household appliances are expected to become smarter and even more efficient in their use of water
40T 0T4 0T

and electric power. Smart electronic controls and sensors improve their user-friendliness and
performance at the same time. Smart appliances of the future will be able to start their operation when
electric power tariffs will be cheapest.

Coffee-making machines are becoming more automated, have enhanced functionalities and
0T 0T4 40T 0T 0T4 0T4 0T

consume less energy than the previous generation. The sensor content of coffee machines as well as of
0T 0T4 0T4 0T

other small appliances such as personal care and beauty appliances is constantly growing.
0T 0T4 0T4 0T

Page 22 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.3 Input devices


INDUSTRIAL APPLICATIONS:
Some examples of the industrial equipment sensors for include:
Transport and Case Refrigeration Systems
Temperature Sensors are used to measure the supply air to control compartments.
Pressure Sensors measure refrigerant pressure to improve system efficiency.
Wind Farm
Inclinometers are used to level windmill during construction and operation.
Vibration Sensors (Accelerometers) monitor the gearbox and provide early warning for
maintenance.
Oil and Gas
Rugged, hermetically sealed Rotary Magnetic Encoders, which are coupled to the fuel flow
meter of a gas pump, are used to convert rotational pulses into gallons or liters purchased.
LVDT Sensors are used to provide positive feedback regarding valve position for flow controls.
Process Control
Fluid Property Analyzers installed in refrigeration and cooling systems monitor lubricant
refrigerant ratios and fluid condition.
LVDT Sensors provide positive feedback of pneumatic cylinder position.
Traffic/Smart Highway
Our specially designed Traffic Sensors are used to monitor traffic patterns and collect data on
highways.

Page 23 of 23
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

An output device is any device used to send data from a computer to another device or user. Most
computer data output that is meant for humans is in the form of audio or video. Thus, most output
devices used by humans are in these categories. Examples include monitors, projectors, speakers,
headphones and printers.

Many different output devices are available to use with a computer system. Here are descriptions of the
most common output devices.

LCD Monitor
How It Works: LCD Monitor Your typical thin-film transistor (TFT) LCD monitor or notebook screen is, at
heart, a high-tech sandwich. Liquid crystals are the pastrami.
By John A. Burek

A fluorescent or electroluminescent light source (or backlight) (1), occupies the panel's rear. (In a few new
models, the backlighting source is a row of LEDs around the perimeter of the screen.) In front of it are two
glass-mounted polarizing filters (2) and (5), scored with super-fine parallel grooves and oriented with
their grooves facing and rotated 90 degrees to each other. (A polarizing filter allows light waves to pass or
not pass, depending on the waves' orientation; those waves that do pass are thus oriented in a known
plane.) The filters lie a tiny distance apart, and a layer of liquid-crystal molecules (3) is sandwiched
between them.

Liquid crystals, by their nature, arrange themselves in predictable structures. Here, the molecules' natural
tendency is to lie parallel with the grooves in the filters, with the excess molecules suspending themselves
in the tiny space between the filters, arranging themselves in a helical arrangement. When light from the
backlight (polarized by the rear filter) hits a given helix, it follows the path of the molecules and is

Page 1 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices


"twisted" in the proper direction to pass through the front polarizing filter and on to your eye. (If the light
was not twisted, the front filter would partially or wholly block it.)

Now, introduce a transparent, thin grid of transistors (4) that can apply current at any given intersection of
the grid, with each intersection representing a "subpixel." Each pixel in a color LCD employs three
addressable subpixels (red, green, and blue) fronted by a matching color filter. Charge a given transistor,
and there the crystal arrangement "untwists," redirecting the local orientation of light before it reaches the
color filters and the front polarizing filter. Depending on its orientation, the light in each subpixel may
pass, pass partially, or be blocked; by precisely regulating the transistor charges, the display controls how
much light can reach a pixel's three individual color filters and exit the front polarizing filter as visible
light (6).

Because the eye perceives any given set of three subpixels as a single color dot, you simply see a pixel as
a dot of blended color; therefore, varying the pixels' ratios of red, green, and blue creates the illusion of
individually colored pixels. Now, multiply this operation by hundreds of thousands—possibly more than a
million—pixels, performed many times per second, and respect your "humble" desktop LCD.

LEDS:
The flat-panel display refers to a class of video devices that have reduced volume, weight and power
requirement compared to the CRT. You can hang them on walls or wear them on your wrists. Current uses
for flat-panel displays include calculators, video games, monitors, laptop computer, graphics display.

The flat-panel display is divided into two categories:


Emissive Displays - The emissive displays are devices that convert electrical energy into light.
0T 0T

Examples are plasma panel and LED (Light-Emitting Diodes).


Non-Emissive Displays - The Non-emissive displays use optical effects to convert sunlight or light
0T 0T

from some other source into graphics patterns. Example is LCD (Liquid-Crystal Device)

Page 2 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices


Printers:
Printers are the most important output device; they are used to print information on paper.

The 2 types of printers are:


1. Impact Printers
U

2. Non-Impact Printers
U

Impact Printers:
The printers that print the characters by striking against the ribbon and onto the paper, are called impact
printers.

Characteristics of Impact Printers are the following:


Very low consumable costs
Impact printers are very noisy
Useful for bulk printing due to low cost
There is physical contact with the paper to produce an image

These printers are of two types:


3. Character printers
U

4. Line printers
U

Non-impact Printers
The printers that print the characters without striking against the ribbon and onto the paper are called
Non-impact Printers. These printers print a complete page at a time, also called as Page Printers.

These printers are of two types:


1. Laser Printers
U

2. Inkjet Printers
U

Characteristics of Non-impact Printers:


Faster than impact printers.
They are not noisy.
High quality.
Support many fonts and different character size.

Page 3 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices


Laser Printers

These are non-impact page printers. They use laser lights to produce the dots needed to form the
characters to be printed on a page.

Advantages
Very high speed.
Very high quality output.
Gives good graphics quality.
Supports many fonts and different character sizes.

Disadvantage
Expensive.
Cannot be used to produce multiple copies of a document in a single printing.

Inkjet Printers

Inkjet printers are non-impact character printers based on a relatively new technology. They print
characters by spraying small drops of ink onto paper. Inkjet printers produce high quality output with
presentable features.

They make less noise because no hammering is done and these have many styles of printing modes
available. Colour printing is also possible. Some models of Inkjet printers can produce multiple copies of
printing also.

Advantages
High quality printing
More reliable

Disadvantages
Expensive as cost per page is high
Slow as compared to laser printer

Page 4 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

3D PRINTERS:
Over thousands of years, dripping water creates layers and layers of mineral deposits, which accumulate
to form stalagmites and stalactites. Unlike these natural formations, though, 3-D printing is much faster
0T 0T32U U32T

and follows a predetermined plan provided by computer software. The computer directs the 3-D printer to
add each new layer as a precise cross-section of the final object.

Additive manufacturing and 3-D printing specifically, continues to grow. Technology that started out as a
way to build fast prototypes is now a means of creating products for the medical, dental, aerospace and
automotive industries. 3-D printing is also crossing over into toy and furniture manufacturing, art and
0T 0T32U U0T32 0T

fashion.

2D Cutters
Successful fabricators find that in almost all sheet metal applications, laser cutting offers unparalleled
quality at high production speeds. Lasers provide high precision cutting with minimal heat distortion of
the metal. They easily process different materials of varying thicknesses, with a minimum of costly set up
or downtime. A single laser can cut different part designs, of differing sheet thicknesses, without ever
changing the machine setup. Superior edge quality, free from burrs and narrow kerfs are standard.

3D Cutters
A three-dimensional (3D) laser cut is like a regular laser cut, except the laser is able to recognize all sides
of a substrate and not just the substrate’s face. Unlike two-dimensional (2D) laser cutting, a 3D laser cut
normally is able to work with a cube or other large substrate shape and not just a flat piece of material.
The substrate itself can be many different types of materials, such as glass, crystal, metal and wood.
Other cutting methods can only cut into the material’s surface, but the laser can be set to cut the inside of
the material, which most commonly is used with crystal.

One aspect of a 3D laser cut is that the cutting machine is able to recognize all sides of the substrate.
With a 2D laser cutter, the machine is only able to cut into and recognize the face of the material. The 3D
method allows the cutter to go through and specifically cut and shape the substrate as needed by the
uploaded design, which allows the machine to make much more complex shapes and projects.

Two-dimensional laser cutters normally can only cut into a flat piece of material, but a 3D laser cut can be
made into a thick piece of material such as a cube or sphere. Much like the ability to recognize all sides of
the substrate, this enables the machine to make much more complex cuts when compared to a 2D
machine. At the same time, there are some cheaper 3D laser cutters that lack this ability.

Page 5 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

Many different materials can be used with a 3D laser cut machine, and each material has a different
purpose. Wood can be formed into pieces for furniture or decorative elements, glass and crystal can be
formed into shapes, and metal can be formed into parts or printed circuit boards (PCBs). This normally
can be done by 2D laser cutters, too, because lasers tend to be versatile cutters.

A unique aspect of a 3D laser cut is the ability to go beyond the substrate’s surface. This enables the
cutter to cut beneath the surface without leaving any scratches on the material’s surface. This usually is
made in crystal and glass, and a 3D image is engraved in the center of the material. Wood also can be
used for this; it sometimes is done and then the wood is split open to reveal the internal design, but this is
not as common as crystal.

SPEAKERS AND HEADPHONES


A speaker is essentially the final translation machine -- the reverse of the microphone. It takes the 0T 0T32U U32T

electrical signal and translates it back into physical vibrations to create sound waves. When everything is
working as it should, the speaker produces nearly the same vibrations that the microphone originally
recorded and encoded on a tape, CD, LP, etc. Traditional speakers do this with one or more drivers. 0T 0T41 41T

Headphones (which are often called "cans" by DJs and people who work in radio broadcasting) work in 0T 0T32U U0T32 0T

exactly the same way as speakers, so you might want to consult our article on loudspeakers if you're not 0T 0T32U U0T32 0T

sure how they use magnetism to turn electrical energy into sound.
0T 0T32U U0T32 0T 0T 0T32U U0T32 0T

The biggest difference between loudspeakers and headphones is, of course, size. A loudspeaker needs to
set all the air moving in a room so you can hear the sound it's making, but the speaker in a headphone
only has to move the volume of air inside your ear canal. That's why it can be so much smaller and more
discreet.

Large headphones are essentially just two loudspeakers mounted on a strap that clamps firmly over your
head. Ear buds work the same way but, as you would expect, everything inside them (the magnet, the coil
of wire, and the diaphragm cone that makes sound) is shrunk down to a much smaller size.

Speakers tend to be built into "enclosures" to amplify their sounds and keep them safe from damage.
Speaker enclosures usually have openings at the front or the back so air can move more freely in and out
of them to generate decent sound. The same is true of headphones and ear buds, which come in two main
types. As their name suggests, closed-back headphones are sealed at the back so (theoretically) no
0T 0T1 0T1 0T

sound escapes (or leaks in from outside) while open-back headphones are open to the air at the back as
0T 0T1 0T1 0T

well as the front. Many people find that open-back headphones sound better but much of the noise will
leak into the room around you and annoy other people, while "ambient" noise from the room can easily
penetrate open-back headphones and annoy you too. If that's a problem, you need closed-back
headphones or noise-cancelling headphones, which make it easy to cut yourself off completely.
0T 0T32U U32T

Page 6 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

LCD PROJECTORS:
The technology behind the LCD projector is nearly three decades old in 2012, but it remains one of the top
digital projection technologies, alongside Digital Light Processing (DLP) projectors. Inventor Gene Dolgoff
0T 0T41 0T41 0T 41T 41T 0T 0T41 41T

developed the first LCD projector in 1984, and both Epson and Sony continue to employ the technology in
21st century projectors.

The old method of film projection was simple: Each frame of the film was a tiny, translucent photograph.
Shine light through the film and then have that light pass through an imaging lens and you'd display a
larger version of that tiny image onto a wall or screen.

LCD projectors work a little differently. A beam of high-intensity light travels through thousands of
shifting pixels in an LCD display instead of through a frame of translucent film. And these projectors don't
just use a single LCD display either -- they use three, which is why they're also called 3LCD projectors. 0T 0T41 41T

The light splits into three hues, and then travels through three LCDs before recombining in a prism to
generate the crisp, colorful image projected on the screen.

DIGITAL LIGHT PROJECTORS:


At the heart of every DLP projection system is an optical semiconductor known as the DLP chip, which
was invented by Dr. Larry Hornbeck of Texas Instruments in 1987.

The DLP chip is perhaps the world's most sophisticated light switch. It contains a rectangular array of up
to 8 million hinge-mounted microscopic mirrors; each of these micro mirrors measures less than one-fifth
0T 0T 0T 0T

the width of a human hair.

When a DLP chip is coordinated with a digital video or graphic signal, a light source, and a projection lens,
its mirrors can reflect a digital image onto any surface.
0T 0T 0T 0T

Page 7 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

OUTPUT DEVICES IN REALLIFE SCENARIOS:

PRINTING IN LARGE VOLUMES:


Printing is not only done in offices or when you need to submit a report of a project to your teacher. There
are scenarios where printing is to be done at large scales and one soft copy, a printer and some pages will
create a large volume of the same soft copy. Here are certain scenarios where you may need to print in
large volumes:

Brochures
Notepads - Custom Notepads and Personalized Notepads
Flyers
Postcards
Business Cards
Post-It® Notes
Catalogs
Door Hangers
Sell Sheets
Bookmarks
Letterhead
Stickers
Posters
Forms
Booklets
RIP cards
Direct Mail
Lots More

DIGITAL DISPLAYS
The integrated anti-reflection/anti-glare shield makes it perfect for digital signage and information display
applications in high-traffic public areas. The overlay provides extra protection from the elements and
helps prevent scratches, fingerprints and dust.

Visual retail is the next big step in the evolution of digital signage. Remotely managed, interactive,
intelligent video displays deliver advertising, information, and visually engaging experiences that are
informative, immersive, and fun.

Page 8 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.4 Output devices

SMALL SCREENS ON MOBILE DEVICES


Mobile devices are all around us. With many countries now reporting over 100% handset penetration by
population, mobile phones are now nothing if not ubiquitous. Following in their footsteps are tablet
devices, which driven by the success of Apple’s iPad and Amazon’s Kindle are becoming a more and more
common sight.

Beyond new hardware, users are being offered a wider selection of competing operating systems and user
interfaces. The release of iOS5 and “Mango” for Windows Phone 7 are two high-profile examples of the
battle being fought to be the one device we carry with us. The integration of software, applications, and
personalized content is part of an evolution in the small screen experience. Large organizations such as
Amazon are even testing tablet-optimized redesigns of their websites.

Page 9 of 9
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media

Storage Devices are the data storage devices that are used in the computers to store the data. The
computer has many types of data storage devices. Some of them can be classified as the removable data
Storage Devices and the others as the non-removable data Storage Devices.
The memory is of two types; one is the primary memory and the other one is the secondary memory.
0T 0T43 43T 0T 0T43 0T43 0T 0T 0T43 43T

The primary memory is the volatile memory and the secondary memory is the non-volatile memory. The
volatile memory is the kind of the memory that is erasable and the non-volatile memory is the one where
in the contents cannot be erased. Basically when we talk about the data storage devices it is generally
assumed to be the secondary memory.

The secondary memory is used to store the data permanently in the computer. The secondary storage
devices are usually as follows: hard disk drives – this is the most common type of storage device that is
used in almost all the computer systems. The other ones include the floppy disk drives, the CD ROM, and
the DVD ROM. The flash memory, the USB data card etc.

PRIMARY STORAGE

Primary Storage, also referred to as computer memory, is used by the CPU (Central Processing Unit) of a
computer to continuously read and execute programming instructions. Also it reads and writes data
from/to the file store in the Secondary Storage of the computer. And this is accessible directly by the CPU.
Typical examples of Primary Storage types are RAM, ROM, and memory adapters.

SECONDARY STORAGE

Secondary Storage refers to non-volatile data storage which is not directly accessible by the CPU and
only accessible via primary storage devices using I/O (Input/Output) channels or device drivers. Typical
examples of Secondary Storage are hard disks, floppy disks, optical storage devices ( such as CD , DVD
drives), magnetic tape data storage devices, RAM drives, and flash memory (such as USB sticks /keys.)

OFF-LINE STORAGE

Off-line storage or disconnected storage is computer data storage on a medium or a device that is not
under the control of a processing unit. The medium is recorded, usually in a secondary or tertiary storage
device, and then physically removed or disconnected. This type of storage system must be inserted or
connected by a human operator before a computer can access the information.

Page 1 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


The medium is recorded, usually in a secondary or tertiary storage device, and then physically removed or
disconnected. This type of storage system must be inserted or connected by a human operator before a
computer can access the information.

CHARACTERISTICS OF STORAGE

VOLATILITY OF INFORMATION

Volatile memory requires a constant power to maintain the stored information. They are required to be
very fast and they also are the fastest memory technologies of today (not a universal rule). Non-volatile
memory will retain the stored information even if there is no supply of electric power. It is suitable for
long-term storage of information. Examples of this category are secondary, tertiary, and off-line storage.

ABILITY TO ACCESS NON-CONTIGUOUS INFORMATION


Information from the storage devices can be either seek sequentially or randomly. In a sequential access
the information is seek one after the other. In a random access any location in storage can be accessed at
any moment in approximately the same amount of time.

ABILITY TO CHANGE INFORMATION


Certain storage devices information to be overwritten at any time. They are often referred to as Mutable
storage. Read only storage retains the information stored during the time of manufacture, and write once
storage (WORM) allows the information to be written only once at some point of time after the
manufacture. These are called immutable storage.

CAPACITY AND PERFORMANCE


Storage capacity: It is the total amount of stored information that a storage device or medium can hold.
E.g. 80GB of hard disk. Storage density: It is the compactness of stored information. E.g. 1.2 Gigabytes per
square inch). Latency: It is the time taken to access a particular location in storage. Throughput: It is the
rate at which information can be read from or written to the storage.

Page 2 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media

Different Kinds of Data Storage

Primary Storage
The primary storage is basically the memory in-built in the computer itself such as:

Random Access Memory (RAM)


The computer processor uses it as a scratch pad. It stores the information on a temporary basis. RAM is a
fickle memory which loses the entire information the moment you switch off your computer. However,
what works in its favor is its greater access rate. Access rate is basically time needed to access to a
particular memory. Monetarily, random access memory is expensive.

Read Only Memory (ROM)


It stores the information permanently. In this type of memory, data is stored either by the manufacturer or
by the user. The main thing about this type of storage is that the data once stored, cannot be changed. Its
access rate is less in comparison with the RAM. ROMs are less expensive than RAM.

Page 3 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


Secondary Storage
These storage devices are external to the basic built in of the computer processor and are used to build
more space for storage. The secondary storage cannot be changed, but the information sustains even if
the computer is turned off.

Some of the secondary storage devices are:

Hard Drives
Hard drives are present inside the CPU. They store the information in a digital form on the platters having
magnetic surface. The information is unchangeable. There are different types of hard drives present
today.

Solid State Drives (SSD)


The traditional spinning hard drive (HDD) is the basic nonvolatile storage on a computer. That is, it doesn't
"go away" like the data on the system memory when you turn the system off. Hard drives are essentially
metal platters with a magnetic coating. That coating stores your data, whether that data consists of
weather reports from the last century, a high-definition copy of the Star Wars trilogy, or your digital music
0T 0T16 0T16 0T

collection. A read/write head on an arm accesses the data while the platters are spinning in a hard drive
enclosure.

An SSD does much the same job functionally (saving your data while the system is off, booting your
system, etc.) as an HDD, but instead of a magnetic coating on top of platters, the data is stored on
interconnected flash memory chips that retain the data even when there's no power present. The chips
can either be permanently installed on the system's motherboard (like on some small laptops and ultra-
books), on a PCI/PCI e card (in some high-end workstations), or in a box that's sized, shaped, and wired to
slot in for a laptop or desktop's hard drive (common on everything else). These flash memory chips differ
from the flash memory in USB thumb drives in the type and speed of the memory. That's the subject of a
totally separate technical treatise, but suffice it to say that the flash memory in SSDs is faster and more
reliable than the flash memory in USB thumb drives. SSDs are consequently more expensive than USB
thumb drives for the same capacities.

Page 4 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


OFFLINE STORAGE DEVICES:

Blu-ray Discs
Gaming lovers generally go for this secondary storage, as they offer high definition video storage. They
are the optical storage devices. Physically, blu-ray discs are same as CDs and DVDs. The storage capacity
of the blu-ray discs is much larger.

Compact Discs (CD)


CDs are very popular for saving audio, video or any other data. They have the ability to store the
information for a longer time. The information is optically stored and is non- fickle. CDs are also known as
the offline storage data device, especially used to increase the security of the information. They are hugely
used as a backup for important information.

Digital Versatile Disc (DVD)


It stores the data in a similar way as a CD does, but the storage space herein is larger than a CD. Like CDs,
these are also known as offline storage data.

Flash Memory
Flash memory is an advanced version of ROMs. The main difference between the two is that in flash
cards, the information stored can be electrically erased. The entire erasing process takes place only in few
seconds. Also, according to your requirements, you can very easily modify the information.

USB Flash Drives


They are also called as thumb drives. If you want to store the information in a compact and portable way,
then USB flash cards are for you. With the help of a USB port, USB flash drives get connected to the
computer. They use the universal serial bus interface to save a large amount of information. They can be
rewritten and come with a built-in flash memory. USB flash drives can store data of up to 64 gigabytes.

External Hard Drives


They work similarly as hard drives present inside the computer, but the main difference is that they are
present outside. They are connected to a computer through a USB port. They can store data of up to 700
gigabytes.

Page 5 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


TYPES OF STORAGE DEVICES
MAGNETIC:
The most common and enduring form of removable-storage technology is magnetic storage. For example, 0T 0T43 0T43 0T

1.44-MB floppy-disk drives using 3.5-inch diskettes have been around for about 15 years, and they are
still found on almost every computer sold today. In most cases, removable magnetic storage uses a drive, 0T 0T43 43T

which is a mechanical device that connects to the computer. You insert the media, which is the part that 0T 0T43 43T

actually stores the information, into the drive.

Just like a hard drive, the media used in removable magnetic-storage devices is coated with iron oxide.
0T 0T32U U32T 0T 0T43 43T

This oxide is a ferromagnetic material, meaning that if you expose it to a magnetic field it is permanently
0T 0T43 0T43 0T

magnetized. The media is typically called a disk or a cartridge. The drive uses a motor to rotate the media 0T 0T43 0T43 0T 0T 0T43 43T

at a high speed, and it accesses (reads) the stored information using small devices called heads. 0T 0T43 43T

Each head has a tiny electromagnet, which consists of an iron core wrapped with wire. The electromagnet
0T 0T43 43T

applies a magnetic flux to the oxide on the media, and the oxide permanently "remembers" the flux it sees.
0T 0T43 0T43 0T

During writing, the data signal is sent through the coil of wire to create a magnetic field in the core. At the
gap, the magnetic flux forms a fringe pattern. This pattern bridges the gap, and the flux magnetizes the
oxide on the media. When the data is read by the drive, the read head pulls a varying magnetic field across 0T 0T43 0T43 0T

the gap, creating a varying magnetic field in the core and therefore a signal in the coil. This signal is then
sent to the computer as binary data. 0T 0T32U U32T

Before music CDs were introduced in the 1980s, portable music devices used magnetic tape in the form of
music cassettes. Early computers adapted this technology to store digital information. One of the major
weaknesses is that information on a tape can only be accessed in a very sequential fashion. This is fine if
you want to listen to a whole music album in sequence, but computer systems typically need to access
data in a non-sequential manner. For magnetic tape, this means you may need to fast-forward through a
lot of tape to get to a specific piece of data. While magnetic tape is a very cheap way to store data, the
very slow access to the data meant that it was primarily used for creating back-ups of data in case older
forms of storage failed. Tape backup systems are still in use today, but their importance has greatly
declined with the advance of cheap, large capacity hard disk drives.

The floppy disk became widely used as a portable storage medium. The floppy disk uses magnetic
storage in the form of a thin disk that is protected by a more rigid plastic casing. Data could be written to
a floppy disk on one computer using a floppy disk drive, and you could then physically take it to another
computer to be read. In a time before computer networks were widely used for data transfer, floppy disks
presented an easy-to-use and fast way to move data between computers. Today's equivalent of the
floppy disk is the USB flash drive (which does not use magnetic storage), which is used to physically
move relatively small amounts of data between multiple computers. By today's standards, floppy disks
had a very small capacity in the order of 1MB. Floppy disks were widely used throughout the 1980s and
1990s, but their use declined with the introduction of external hard disk drives and flash-based storage

Page 6 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


devices. While once a standard feature on any computer, modern day computer system no longer feature
floppy drives.

OPTICAL STORAGE DEVICES:


Optical storage devices save data as patterns of dots that can be read using light. A laser beam is the
usual light source.

The data on the storage medium is read by bouncing the laser beam off the surface of the medium. If the
beam hits a dot it is reflected back differently to how it would be if there were no dot. This difference can
be detected, so the data can be read.

Dots can be created using the laser beam (for media that is writable such as CD-Rs). The beam is used in
a high-power mode to actually mark the surface of the medium, making a dot. This process is known as
‘burning’ data onto a disc.

The different patterns of dots correspond to the data stored on the disc.

Read-Only Optical Discs


Read-only optical discs have data written onto them when they are manufactured. This data cannot be
changed.

CD-ROM
Compact Disc - Read-Only Memory (CD-ROM) discs can hold around800MB of data. The data cannot be
altered (non-volatile), so cannot be accidently deleted. CD-ROMs are random-access devices.
CD-ROMs are used to distribute all sorts of data: software (e.g. office applications or games), music,
electronic books (e.g. an encyclopedia with sound and video.)

DVD-ROM
Digital Versatile Disc - Read-Only Memory (DVD-ROM) discs can hold around 4.7GB of data (a dual-layer
DVD can hold twice that). DVD-ROMs are random-access devices.
DVD-ROMs are used in the same way as CD-ROMs (see above) but, since they can hold more data, they
are also used to store high-quality video.

Page 7 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


High Capacity Optical Discs

Blu-Ray
Blu-Ray disks are a recent replacement for DVDs. A Blu-Ray disc can hold25 - 50GB of data (a dual-layer
Blu-Ray disc can hold twice that). Blu-Ray discs are random-access devices.
Blu-Ray discs are used in the same way as DVD-ROMs (see above) but, since they can hold more data,
they are also used to store very high-quality, high-definition (HD)video.

The 'Blu' part of Blu-Ray refers to the fact that the laser used to read the disc uses blue light instead of red
light. Blue light has a shorter wave-length than red light (used with CDs and DVDs).

Using a blue laser allows more data to be placed closer together on a Blu-Ray disc, than on a DVD or CD,
so Blu-Ray has a much higher storage capacity than these older discs.

HD DVD
High-density DVD (HD-DVD) discs can hold around 15GB of data (a dual-layer HD-DVD can hold twice
that). HD-DVDs are random-access devices.
HD-DVD discs are used in the same way as DVD-ROMs (see above) but, since they can hold more data,
they are also used to store very high-quality, high-definition (HD) video.

The HD-DVD format was launched at the same time as Blu-Ray. For about a year they competed to be the
'next DVD'. For various reasons, Blu-Ray won the fight, and the HD-DVD format has been abandoned.

Recordable Optical Discs


Recordable optical discs can have data written onto them (‘burnt’) by a computer user using a special disc
drive (a disc ‘burner’).

CD-R and DVD-R


CD-Recordable (CD-R) and DVD-recordable (DVD-R) discs can have data burnt onto them, but not erased.
You can keep adding data until the disc is full, but you cannot remove any data or re-use a full disc.

CD-RW and DVD-RW


CD-Rewritable (CD-RW) and DVD-Rewritable (DVD-RW) discs, unlike CD-Rs and DVD-Rs, can have data
burnt onto them and also erased so that the discs can be re-used.
When CD-Rs and DVD-Rs are burnt, the laser makes permanent marks on the silver-colored metal layer.
This is why these discs cannot be erased.

When CD-RWs and DVD-RWs are burnt the laser makes marks on the metal layer, but in a way that can be
undone. So these discs can be erased.
Page 8 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


DVD-RAM
DVD-Random Access Memory (DVD-RAM) discs are a type of re-writable DVD. They often come in a
floppy-disc style case (to protect the disc).

DVD-RAM discs have a similar capacity to a normal DVD, holding 4.7GB of data. DVD-RAM discs are
random-access devices.
DVD-RAM discs are used in many camcorders (video recording cameras).

The discs are much higher quality than normal DVD-RWs and can reliably store data for up to 30 years.
This means that they are often used for video and data back-up and archiving.

SOLID STATE STORAGE DEVICES


In contrast to magnetic and optical forms of backing storage, these devices have no moving parts and so
are called 'solid state'. Instead, they use a special kind of programmable ROM memory chip on which data
is stored. Very different to usual memory, this kind of chip remembers the data even when the power has
been turned off.

USB Flash Drives


Universal Serial Bus (USB) is a type of socket or port in computer systems that allow USB type devices to
connect to it. One of which is the USB Flash Drive - sometimes called pen drive.

USB Flash drives come in various sizes from 16 MB up to and over 4GB. They are very useful and a simple
way of backing up and transporting data. Because of the USB connection they will work on any computer
with a USB port and have really replaced floppy discs as a method of moving files from one computer
system to another.

Memory Cards
Like USB flash drives, these solid state devices come in various sizes, from 64MB to over 2GB. They
connect differently and need a card reader to 'read' their contents.

Commonly, they are used in digital cameras to store photographs and are similar to SIM cards used in
phones.

Page 9 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


Solid State Hard Drives:
Solid state drives have several advantages over the magnetic hard drives. The majority of this comes from
the fact that the drive does not have any moving parts. While a traditional drive has drive motors to spin
up the magnetic platters and the drive heads, all the storage on a solid state drive is handled by flash
memory chips.

This provides three distinct advantages:


1. Less Power Usage
2. Faster Data Access
3. Higher Reliability

The power usage is a key role for the use of solid state drives in portable computers. Because there is no
power draw for the motors, the drive uses far less energy than the regular hard drive. Now, the industry
has taken steps to address this with drives spinning down and the development of hybrid, but both of
these still use more power. The solid state drive will consistently draw less power than the traditional and
hybrid hard drive.
Faster data access will make a number of people happy. Since the drive does not have to spin up the drive
platter or move drive heads, the data can be read from the drive near instantly. Hybrid hard drives do tend
to mitigate the speed aspect when it comes to frequently used drives. Similarly, Intel's new Smart
Response Technology is a similar method of caching on a small solid state drive to produce similar
results.

STORAGE REQUIREMENT OF A FILE

Formula to compute storage needs:


Basic storage capacity requirements can be estimated by simple calculation:
Total storage needed = # of image files x average file size x 1.25

Example: A Collection of 3,000 text images, each averaging 75KB, would require about 225MB of storage.
However, many other factors can increase storage needs. OCR text for the same pages might run 3KB per
page, or about 1/25th the space required for the corresponding image file. The number and size of
derivative files, as well as whether they're permanently stored or created on the fly could add further to
storage requirements. In addition, all storage technologies involve a certain amount of wasted space. The
precise amount depends on factors such as the storage technology used, total capacity, partition size,
and average file size. Some experimentation may be necessary to determine the approximate percentage
of wasted space, but it needs to be taken into account in estimating storage needs. The formula above
factors in a generous overage to cover such concerns.

Page 10 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


How Many Pages in a Gigabyte?

There are a number of factors that determines how many pages are in a gigabyte. Different document
types will generate very different files sizes and take up more space. For example, a Microsoft Word file
with just text and no graphics would take up a relatively small amount of file space, but a paper document
that has been scanned to a digital, PDF file format image with hidden searchable text can result into a
large amount of disk space. The table below summarizes common file sizes based on various document
types to help determine how much storage space will be needed when subscribing to Net
Documents. (16-17,000 Word Documents = 1GB of storage on average)

Digital Files
DOCUMENT TYPE AVERAGE SIZE AVERAGE
PER PAGE PAGES PER
GIGABYTE
15k 64,800
Microsoft Word files

6k 166,000
Microsoft Excel files

57k 17,500
Microsoft
PowerPoint files

100k 10,000
Adobe PDF files (image+text)

1.5k 677,90
Text files

10k 100,000
Email files

65k 15,477
Image files (TIFF)

PDF files are approximately one-tenth the size of a TIFF image, making PDFs much faster to transmit and
download. Benefits of PDF over TIFF: 1) Search ability, 2) file size 3) clarity, 4) universal compatibility.

Page 11 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media

Scanning Paper Documents

SOURCE AVERAGE PER # OF


SIZE GIGABYTE PAGES
SCANNED
Scanned Page – 50k 64,800 pages 1
TIFF
Banker Box 125MB 8 boxes 2,750

File Cabinet (4 2 cabinets 10,000


drawer of paper)
DVD-ROM (2 sided, 10 GB, 20
4 layers) Cabinets

More Information:
A terabyte is a trillion bytes, or a million megabytes, or 1,000 gigabytes, as measured by the hard-drive
industry.
A 1-Terabyte drive can hold:
About 330,000 3MB photos
or 250,000 MP3s
or 358 Movies
or 1000 hours of video
An hour of standard video takes up about 1GB, while an hour of high-definition video takes up 4GB.

Page 12 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.5 Memory, storage devices and media


Here are a few more details to consider:

Although data storage capacity is generally expressed in binary code, many hard drive manufacturers
(and some newer BIOSs) use a decimal system to express capacity.
o For example, a 30 gigabyte drive is usually 30,000,000,000 bytes (decimal) not the
32,212,254,720 binary bytes you would expect.
Another trivial point is that in the metric system the "k" or "kilo" prefix is always lowercase
(i.e. kilogram = kg not Kg) but since these binary uses for data storage capacity are not properly
metric, it has become standard to use an uppercase "K" for the binary form.
When used to describe Data Transfer Rate, bits/bytes are calculated as in the metric system
o Kilobits per second are usually shortened to kbps or Kbps. Although technically speaking, the
term kilobit should have a lowercase initial letter; it has become common to capitalize it in
abbreviation (e.g. "56 Kbps" or "56K"). The simple "K" might seem ambiguous but, in the
context of data transfer, it can be assumed that the measurement is in bits rather than bytes
unless indicated otherwise.

File Storage Capacity by Bits and Bytes


bit byte Kilobyte Megabyte Gigabyte
bit 1 8 8,192 8,388,608 8,589,934,592
byte 8 1 1,024 1,048,576 1,073,741,824
Kilobyte 8,192 1,024 1 1,024 1,048,576
Megabyte 8,388,608 1,048,576 1,024 1 1,024
Gigabyte 8,589,934,592 1,073,741,824 1,048,576 1,024 1
Terabyte 8,796,093,022,208 1,099,511,627,776 1,073,741,824 1,048,576 1,024
Petabyte 9,007,199,254,740,992 1,125,899,906,842,624 1,099,511,627,776 1,073,741,824 1,048,576
Exabyte 9,223,372,036,854,775,808 1,152,921,504,606,846,976 1,125,899,906,842,624 1,099,511,627,776 1,073,741,824
9,444,732,965,739,290,427,
Zettabyte 1,180,591,620,717,411,303,424 1,152,921,504,606,846,976 1,125,899,906,842,624 1,099,511,627,776
392

File Storage Capacity by Powers of Two (Base 2)


bit byte Kilobyte Megabyte Gigabyte Terabyte Petabyte Exabyte Zettabyte Yottabyte
bit 2^0 2^3 2^13 2^23 2^33 2^43 2^53 2^63 2^73 2^83
byte 2^3 2^0 2^10 2^20 2^30 2^40 2^50 2^60 2^70 2^80
Kilobyte 2^13 2^10 2^0 2^10 2^20 2^30 2^40 2^50 2^60 2^70
Megabyte 2^23 2^20 2^10 2^0 2^10 2^20 2^30 2^40 2^50 2^60
Gigabyte 2^33 2^30 2^20 2^10 2^0 2^10 2^20 2^30 2^40 2^50
Terabyte 2^43 2^40 2^30 2^20 2^10 2^0 2^10 2^20 2^30 2^40
Petabyte 2^53 2^50 2^40 2^30 2^20 2^10 2^0 2^10 2^20 2^30
Exabyte 2^63 2^60 2^50 2^40 2^30 2^20 2^10 2^0 2^10 2^20
Zettabyte 2^73 2^70 2^60 2^50 2^40 2^30 2^20 2^10 2^0 2^10
Yottabyte 2^83 2^80 2^70 2^60 2^50 2^40 2^30 2^20 2^10 2^0

Page 13 of 13
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.6 Operating systems

Operating system is a software program which controls the operations of the computer system &
manages all of the computer’s hardware and programs. It acts as a layer of software between
applications programs and hardware and provides an interface through which a user can run an
application. It controls how the computer responds to user’s requests and how the hardware
communicates with each other.

Without an operating system, no matter how many programs you have, the computer is useless. However,
not all computers need an operating system. An automated system such as household appliances that is
microprocessor-controlled, like a washing machine or a digital camera, has a single control program
performing a single task with a fixed set of input and output hardware.

Loading an operating system:


When a user switches on a laptop, desktop it usually has no operating system in internal memory ready to
run and manage the computer. Computer then automatically run a small firmware program to start the
process of loading the operating system into RAM, ready to take control. In a PC or laptop this firmware is
stored in flash memory. The first firmware program performs a power-on selftest (POST). The purpose of
Posting is to prevent the computer from starting to run in an unusable state. It checks the integrity of the
firmware what external devices are connected and the size of internal memory.

Then it identifies the most promising disk drive from which to load an operating system. The second
firmware program called the ‘boot loader’ then loads the first, tiny portion of the operating system into
RAM from a hard disk. This portion of the operating system software can in turn load the rest of the
operating system software and associated data into RAM. This process, in which the operating system
loads itself and then takes control of the computer, is known as ‘bootstrapping’.

Page 1 of 5
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.6 Operating systems

Function of operating system:


1. Manage user accounts and security using one or more usernames and password.
2. Provide an interface for the user that allows the user to:
a. Run application programs.
b. Manage files in backing storage.
c. Read and respond to error messages.
3. Manage the processors time
4. Manage the allocation of internal memory.
5. Control peripheral devices-input devices such as keyboards, output devices such as printers and
backing storage such as hard disk drive.
6. Provide spooling (temporary storage of input or output data in a queue on hard disk)
7. Manage interrupt signals to the processor.
8. Perform ‘housekeeping tasks’, such as defragmenting a drive or file indexing.

Types of Interfaces:
The means of communication between the user and the machine is known as the user interface and
consists of both hardware and software. It consist al hardware and software through which a user provide
input to a computer or receives information from it. There are different types of interface, which are useful
in different situations and for different types of user.
Command line interface
Graphical user interface

Graphical user interface


Graphical interfaces are called GUI (graphical user interface) or WIMP (windows, icons, menus, and
pointer) because it displays graphics as well as text.

A GUI is very user friendly. The user will expect to be able to select options by use of menus of choices
and by using small pictures which represent the different options available. Choices are selected by the
user by using some sort of pointing device to indicate choice; typically this would be a mouse.

Page 2 of 5
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.6 Operating systems

Command line interface


Or command based interface is one where the user types a series of commands at the keyboard which tell
the computer what their intentions are. The user needs to know what the possible commands are, and
also needs to understand the way files are stored on the system. The characteristics of a command based
interface are
The user needs to know what commands are available
The user needs to understand the commands
The user needs to understand the way that material is stored in the computer system

Because of the above points there are two very important characteristics about a command based
interface. First, the system is very much more open than in the other types of interface. Other interfaces
restrict the options that the user has available to them. This can be particularly important for the system
manager because different users can only be allowed to have access to specific parts of the system. The
second characteristic is that command based interfaces can only be used by computer literate people
because you not only have to understand the commands and their uses but you also need to understand
something about how the computer operates, particular how information is stored.

Utility software
Utility programs are part of the operating system of a computer and are routines which carry out
important tasks which are necessary from time to time on the system. They do not produce a pretty
picture, or a letter which can be sent to someone so they are not application programs, but the types of
job that they do are so important that the system could not run without them. There are many examples of
utility software but we shall limit ourselves to just a few:

1. The surface of a disk can store so much data that the computer cannot handle it all at once so it needs
to be split up so that data stored on it can be found again. When it is new a disk surface is blank so the
computer “draws lines” on the surface to split it into small areas. The process is called formatting and it is
carried out by a utility program called a disk formatter.

2. When files are to be stored on a disk they need to be managed. This includes arranging for them to be
stored in a certain place, finding files again after they have been stored, moving them around to get them
in a sensible order and deleting them when they are not needed any more. All of these actions are carried
out by utility programs called file handlers.

3. A computer system is made up of lots of different sorts of hardware, each piece of which needs
instructions about how to work. These programs are called hardware drivers.

Page 3 of 5
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.6 Operating systems


4. Some files are very large. In most files it is possible to find simple ways of reducing the size of the file
while keeping all its meaning. This can be very important when files are being sent from one computer to
another as the communication is speeded up. The programs that reduce the size of files are called file
compressors.

5. When files are being sent from one computer to another it is possible that they may contain a virus
which will infect the receiving computer. A virus checker (scanner, killer,..) is a utility program which keeps
a constant check on files searching for viruses which it will delete if it finds any.

Buffer
An operating system is often able to pass input data to an application program far faster than an input
device can supply it. Similarly, it can often supply the application programs output data far faster than an
output device can accept it. To compensate for the difference in rates of data processing and allow the
processor to perform other tasks while waiting to receive or send data, system software uses an area of
memory to hold data temporarily. Such an area in memory is called a buffer.

Polling
Method in which operating system periodically checks each peripheral device for communication is called
polling.

Interrupts
An interrupt is a signal sent from a peripheral device (hardware) or program (software) to the processor to
indicate that the sender needs attention. This leaves the operating system entirely free to process other
task until its attention is needed.

A processor usually has relatively few hardware interrupt inputs with different priorities. Before fetching
each machine code instruction from internal memory, the processor checks an area of memory within the
processor called its ‘interrupt register’ to see whether any interrupts are waiting to be serviced.
Programs can also generate interrupts. An application program can use a software interrupt request a
service from the operating system.

Page 4 of 5
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.6 Operating systems

Handshaking
Term used to describe the process of one computer establishing a connection with another computer or
device. The handshake is often the steps of verifying the connection, the speed, or the authorization of the
computer trying to connect to it.

Checksum
A checksum is a way of summarizing a block of data such as a USB or network data packet. At its
simplest, it consists of the arithmetical sum of all the numerical values of all the elements of the block.
The sum reduced to a standard number of digits and transmitted with the block. When the block of data
get to its destination, the same mathematical calculation is performed on the data by the received device
and the result is compared with the received checksum. If two checksum match, the integrity of the data
has been maintained. If the two checksums do not match then an error has been made in transmitting the
data and the receiving device requests the sending device to re-transmit the data. Even if one binary digit
has changed in the data, the recalculated check sum does not match the received checksum and the data
are rejected.

File Management:
Another part of the operating system is the file manager. While the memory manager is responsible for the
maintenance of primary memory, the file manager is responsible for the maintenance of secondary
storage (e.g., hard disks)

The operating system is responsible for the following activities in connections with file management:
File creation and deletion.
Directory creation and deletion.
Support for manipulating files and directories.
Mapping files onto secondary storage.
File backup on stable (nonvolatile) storage media.
Identify and locate a selected file
Use a directory to describe the location of all files plus their attributes
On a shared system describe user access control
Blocking for access to files
provide simple and fast algorithms to read and write files
give and deny access rights on files to users and programs
allocate and de-allocate files to processes
provide users and programs with simple commands for file handling

Page 5 of 5
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.7 High- and low-level languages and their translators

Software is created by using a computer language to set out a set of instructions that the computer will
follow. There are many computer languages but they do share some common features.

CONVERTORS (translators):

Every high level language source's code should be converted to low level language so that computer's
microprocessor can understand and execute that.

For that reason every language comes with its own interpreter , which is either a compiler or a interpreter.

INTERPRETER:

Is a program which only works with a source code and do not produce an independent executable
file.
Interpreter converts each source code’s line and executes it.
Interpreter works within emulator and doesn't work directly over two microprocessor. This saves
computer from crashing when the program performs any illegal operation.
It help's programmers for the error correction while writing programs and testing them.

COMPILER :

It reads the whole program and generates an executable file (exe) , which can be easily distributed
without the fear of source code being copied.
Debugging is tough with compilers as they convert the whole program and gives out all the errors
in that program compiler runs directly over the microprocessor, thus can crash the computer.

ASSEMBLY LANGUAGE Assembler:

Every new architecture has its own assembly language


Any source code that is written for that particular architecture should be translated to machine
language through a translator made in assembly for that particular architecture called Assembler.

Page 1 of 2
Computer Science 2210 (Notes)
Chapter: 1.3 Hardware and software

Topic: 1.3.7 High- and low-level languages and their translators


Difference between Compilers & Interpreters:

Interpreter reads one line of source code at a time, converts it to machine understanding form and
execute it.
Compiler takes the source code as a whole, converts it to machine language and generates an
object (machine) file that can be executed on users wish without compilation.

Distribution:
U

Interpreter doesn't work without the source code. So, intellectual property rights infringement is
possible, i.e. anyone having source code can copy and further distribute it under their own name.
Compiler on other the other hand generates an executable file that when distributed does not
require source code and can be executed independently.

Shell:
U

Interpreter doesn't work directly over the microprocessor but in a shell (emulator) that mimics the
microprocessor and doesn't hang the computer when a program malfunctions.
Compiler works directly with the microprocessor and can hang the pc.

Debugging:
U

Interpreter stops at the line where error occurs and compiler continues and generates many errors.

Page 2 of 2
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security

1.4.1 Importance of Security and Data Integrity.

Data security deals in the area of keeping data safe. It includes preventing unauthorized personnel from
retrieving it, moreover preventing it from damage or intentional destruction, infection or corruption. If the
data is recovered, stolen, copied, or damaged from these computer systems then it can lead to a serious
problems.

Data integrity is the counterbalance of data in both during and after processing.

Data may get:


Lost or damaged during a system crash - especially if the crash affects the hard disk.
Corrupted as a result of faulty disks, disk drives, or power failures.
Lost by accidentally deleting or overwriting files.
Lost or become corrupted by computer viruses.
Hacked by unauthorized users and deleted or redact.
Destroyed by natural disasters, in acts of terrorism, or war
Deleted or altered by employees wishing to betray the company in order make money or as the act of
revenge or Blackmail.

How to keep your data safe from accidental damage, human errors and corruption?
Measures that can be taken to keep data secure include:

Making regular backups of files (backup copies should be stored in fireproof safes or away from the
place of origin e.g. another building)
Protecting your computer against viruses by running an anti-virus check every once in a while
Use a password protected computer so that access to data is restricted.
Safe storage of important files stored on removable disks, e.g. locked away in a fireproof and
waterproof safe. How much you invest on secure data storage all depends on how important your data
really is.
Allowing only authorized staff into certain computer areas, e.g. by controlling entry to these areas by
means of ID cards, magnetic swipe cards, or biometric scanners.
Always logging off or turning terminals off when not in use and if possible locking them by means of
physical lock.
Avoiding accidental deletion of files by write-protecting disks
Using data encryption techniques to code data so that it makes no apparent sense.

Page 1 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Accidental damage

Accidental damage refers to the damage caused unintentionally, like deletion of data while the person is
unaware of its consequences. Or damage of data by removing important files without intent or amending
data without checking new arrivals. To prevent such damages, a well-organized backup is required.

The main factors that had to be on field are:


1) Medium – such as Magnetic tapes, CD-RW, external storage devices, zip drive.
2) Location – where the medium should be stored, e.g. off site in a fire proof safe.
3) Type of backup – full (all data, program and its features) or partial (just the sensitive data changing
everyday like in banks or airports)
4) Timings – at what time intervals should the data be backed up? e.g. at the end of working data, end of
working in morning shift, end of day, end of week, every hour (it all depends on how important your
data is, and on your medium space availability)
5) Testing – backups needs to be examined i.e. recoverable or not at an instance.

A best example of a suitable backup for students working on a project at school and at home would
be:

Take a copy on to a USB on a regular basis (at the end of each period, lesson or when you’re done
working on it at home).
Keep an extra copy in a safe place at home.
Test the backup to ensure that both the copies work at school and at home.

Getting familiar with malicious actions, including unauthorized viewing, copying and corruption.
It is convenient to have access to vast content on the Internet such as important information, useful
29T 29T

services and wonderful entertainment but unfortunately by accessing the Internet, you leave yourself
29T 29T

vulnerable to some trouble makers who are waiting for an opportunity to harm you and your computer. 29T 29T

Yes, we’re talking about computer viruses, spyware/adware and hackers.


29T 29T

Computer viruses, spyware and adware! What these species are?


Computer viruses are software programs designed to access your computer without your consent,
29T 29T 29T 29T

interfere with your computer’s operation and records, corrupts, or deletes your personal data.
29T 29T

Adware are software programs designed for advertising and changing your computer's configuration.
29T 29T

Spyware is software designed to collect personal information like what websites you visit or even
discreetly transmit your personal information, such as your credit card number from your computer 29T 29T

without your knowledge.

Page 2 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Another threat over the internet is of “Hackers”. The term hacker is used in popular media to describe
someone who attempts to break into computer systems. Typically, this kind of hacker would be a
proficient programmer or engineer with sufficient technical knowledge to understand the weak points in a
security system.

How hectic could they be?


While viruses can be intentionally destructive, for example, by destroying data, many viruses are fairly
benign or just plain annoying. Adware is mainly annoying but spyware can be downright dangerous if it
manages to get hold of important information like your passwords or credit card information. Hackers can
breaks into someone else’s computer system, often on a network; by passes, passwords or licenses in
computer programs or in other ways intentionally breach computer security.

How does a person know if his/her computer is infected?


The worse with viruses, adware/spyware and hackers are that they silently operate for a relatively long
period of time in your computer without being detected. Therefore it’s very important to follow the
29T 29T

preventive methods described later in this guide. The common symptoms of a virus infection are that
29T 29T

your computer works slower than normal, it stops responding and freezes often, crashes and restarts
29T 29T

frequently or fails to run normally. Other possible symptoms are that the applications don’t work properly
and you can’t print correctly, the discs and disc drives on your computer are inaccessible and you often
29T 29T

see unusual error messages.

The signs of spyware or adware infection are similar to the signs of a computer virus infection, but in
29T 29T

addition to those you might get unwanted pop-up windows on your screen even if you’re not browsing in
the Internet, your web browser’s start up page can be different than it should be or you might notice an
29T 29T

unwanted toolbar on your web browser.

It can be difficult to detect a hacker on a computer because nothing changes to help disguise the hack.
Below are the most common things that change after a computer is hacked.
New programs installed
Computer passwords have changed
Increased network activity
Unknown programs wanting access
Security programs uninstalled
Computer doing things by itself

Page 3 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


1.4.2 How can a computer get rid of intruders?
The idea of having unwanted software running on your computer is scary; by following a few easy steps
29T 29T

you can keep your computer free from viruses, adware, spyware and other trouble makers.
29T 29T

Installing a fire wall


An Internet firewall is a computer program or hardware appliance designed to prevent unauthorized
29T 29T 29T 29T

access to private computers or networks. Firewall screens out viruses, worms, malware and hackers that
try to access your computer over the Internet. Installing a firewall is the most effective and the most
29T 29T 29T 29T

important first step you can take to protect your computer. Install the firewall before you access
29T 29T

the Internet for the first time and keep it running at all times.
29T 29T

Firewalls can be either hardware or software but the ideal firewall configuration will consist of both. In
addition to limiting access to your computer and network, a firewall is also useful for allowing remote
access to a private network through secure authentication certificates and logins.

Hardware firewalls can be purchased as a stand-alone product but are also typically found in broadband
routers, and should be considered an important part of your system and network set-up. Most hardware
firewalls will have a minimum of four network ports to connect other computers, but for larger networks,
business networking firewall solutions are available.

Software firewalls are installed on your computer (like any software) and you can customize it; allowing
you some control over its function and protection features. A software firewall will protect your computer
from outside attempts to control or gain access to your computer.

How it works?
A firewall enforces a policy or set of rules governing the flow of data to and from the outside world.
Firewalls that are used to protect home computers are usually based on packet filtering, i.e. Data packets
(small units of information) are admitted or rejected according to the way these rules are configured. For
the typical home user their primary function is to block uninvited incoming connections. Most firewall
tools will come with a sensible set of rules by default.

Firewalls are setup at every connection to the Internet, therefore subjecting all data flow to careful
monitoring. Firewalls can also be tuned to follow "rules". These Rules are simply security rules that can be
set up by you or by the network administrators to allow traffic to their web servers, FTP servers, Telnet
servers, thereby giving the computer owners/administrators immense control over the traffic that flows in
& out of their systems or networks.

Rules will decide who can and cannot connect to the internet, what kind of connections can be made,
which or what kind of files can be transmitted in and out. Basically all traffic in & out can be watched and
controlled thus giving the firewall installer a high level of security & protection.

Page 4 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security

Firewall’s logic
Firewalls use 3 types of filtering mechanisms:
Packet filtering or packet purity
Data flow consists of packets of information and firewalls that analyze these packets to sniff out
offensive or unwanted packets depending on what you have defined as unwanted packets.

Proxy
Firewalls in this case assume the role of a recipient & in turn sends it to the node that has
requested the information & vice versa.

What is a proxy server?


A proxy server is computer that functions as an intermediary between a web browser (such as
Internet Explorer) and the Internet. Proxy servers help improve web performance by storing a copy
of frequently used webpages. When a browser requests a webpage stored in the proxy server's
collection (its cache), it is provided by the proxy server, which is faster than going to the web.
Proxy servers also help improve security by filtering out some web content and malicious
software.
Proxy servers are used mostly by networks in organizations and companies. Typically, people
connecting to the Internet from home will not use a proxy server.

Inspection
In this case Firewalls instead of sifting through all of the information in the packets, mark key
features in all outgoing and request & check for the same matching characteristics in the inflow to
decide if it is relevant information that is coming through.

Firewall rules
Firewall rules can be customized as per your needs, requirements & security threat levels. You can create
or disable firewall filter rules based on conditions such as:

IP Addresses
Blocking off a certain IP address or a range of IP addresses, which you think are predatory. What is my IP
address? Where is an IP address located?

Domain names
You can only allow certain specific domain names to access your systems/servers or allow access to only
some specified types of domain names or domain name extension like (.edu or .mil).

Page 5 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Protocols
A firewall can decide which of the systems can allow or have access to common protocols like IP, SMTP,
FTP, UDP, ICMP, Telnet or SNMP.

Ports
Blocking or disabling ports of servers that are connected to the internet will help maintain the kind of data
flow you want to see it used for & also close down possible entry points for hackers or malignant
software.

Keywords
Firewalls also can sift through the data flow for a match of the keywords or phrases to block out offensive
or unwanted data from flowing in.

Firewalls are a must have for any kind of computers that go online. They protect you from all kinds of
abuse & unauthorized access like Trojans that allow taking control of your computers by remote logins or
backdoors, virus or use your resources to launch DOS attacks.
Firewalls are worth installing. Be it a basic standalone system, a home network or an office network, all
face varying levels of risks & Firewalls do a good job in minimize these risks. Tune the firewall for your
requirements & security levels and you have one less threat to worry about.

How passwords are essential in keeping data safe while stored and transmitted
Passwords are very important in keeping your online information safe. What is very important is the
strength of the password that you choose. Your password should meet the following criteria:

Be at least 6 - 8 characters
Contain at least one character from ALL of the following four classes:
Uppercase letters (e.g. A, B, C), Lower case letters (eg. a, b, c), Numbers (eg. 1, 2, 3), Punctuation
symbols (e.g. ~!@#$%^&*()+-=)
Doesn't contain your first name, your last name, your user ID, the word Optus, SingTel, a day of the
week, month of the year or the word password.
Is not a common word or keyboard sequence (e.g. 123, QWERTY, asdf, zxcv, poiuy).
You should change your password regularly and never share your password to others.

For more efficient security, Biometric passwords give more security.

Page 6 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Biometric passwords

Biometric password systems use handwriting, hand geometry, voiceprints, iris structure and vein
structure. You'll also learn why more businesses and governments use the technology and whether
contact lenses fake, recorded voice and silicone hand could really get James Bond into the lab (and let
him save the world).
You take basic security precautions every day you use a key to get into your house and log on to your
computer with a username and password. You've probably also experienced the panic that comes with
misplaced keys and forgotten passwords. It isn't just that you can't get what you need -- if you lose your
keys or wrote your password on a piece of paper, someone else can find them and use them just as you
would.

Instead of using something you have (like a key) or something you know (like a password), biometrics use
your body to identify you. Biometrics can use physical characteristics, like your face, fingerprints, irises or
veins, or behavioral characteristics like your voice, handwriting or typing rhythm. Unlike keys and
passwords, your personal traits are extremely difficult to lose or forget. They can also be very difficult to
copy. For this reason, many people consider them to be safer and more secure than keys or passwords.

Biometric systems can seem complicated, but they all use the same three steps:
Enrollment: The first time you use a biometric system, it records basic information about you, like
your name or an identification number. It then captures an image or recording of your specific trait.
Storage: Contrary to what you may see in movies, most systems don't store the complete image or
recording. They instead analyze your trait and translate it into a code or graph. Some systems also
record this data onto a smartcard that you carry with you.
Comparison: The next time you use the system, it compares the trait you present to the
information on file. Then, it either accepts or rejects that you are who you claim to be.

Systems also use the same three components:


A sensor that detects the characteristic being used for identification
A computer that reads and stores the information
A Software that analyzes the characteristic, translates it into a graph or code and performs the
actual comparisons

Next, we'll examine how biometrics provides security using other traits, starting with handwriting.

Handwriting

At first sight, using handwriting to identify people might not seem like a good idea. After all, many people
can learn to copy other people's handwriting with a little time and practice. It seems like it would be easy
to get a copy of someone's signature or the required password and learn to forge it.
Page 7 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security

But biometric systems don't just look at how you shape each letter; they analyze the act of writing. They
examine the pressure you use and the speed and rhythm with which you write. They also record the
sequence in which you form letters like whether you add dots and crosses as you go or after you finish the
word.

Unlike the simple shapes of the letters, these traits are very difficult to forge. Even if someone else got a
copy of your signature and traced it, the system probably wouldn't accept their forgery. A handwriting
recognition system's sensors can include a touch-sensitive writing surface or a pen that contains sensors
that detect angle, pressure and direction. The software translates the handwriting into a graph and
recognizes the minute changes in a person's handwriting from day to day and over time.

Hand and finger geometry


Individual’s hands and fingers are unique -- but not as unique as other traits, like fingerprints or irises.
That's why businesses and schools, rather than high-security facilities, typically use hand and finger
geometry readers to authenticate users, not to identify them. Disney theme parks, for example, use finger
geometry readers to grant ticket holders admittance to different parts of the park. Some businesses use
hand geometry readers in place of timecards.

Systems that measure hand and finger geometry use a digital camera and light. To use one, you simply
place your hand on a flat surface, aligning your fingers against several pegs to ensure an accurate
reading. Then, a camera takes one or more pictures of your hand and the shadow it casts. It uses this
information to determine the length, width, thickness and curvature of your hand or fingers. It translates
that information into a numerical template.

Hand and finger geometry systems have a few strengths and weaknesses. Since hands and fingers are
less distinctive than fingerprints or irises, some people are less likely to feel that the system invades their
privacy. However, many people's hands change over time due to injury, changes in weight or arthritis.
Some systems update the data to reflect minor changes from day to day.

Voice prints
Your voice is unique because of the shape of your vocal cavities and the way you move your mouth when
you speak. To enroll in a voiceprint system, you either say the exact words or phrases that it requires, or
you give an extended sample of your speech so that the computer can identify you no matter which words
you say.

When people think of voiceprints, they often think of the wave pattern they would see on an oscilloscope.
But the data used in a voiceprint is a sound spectrogram, not a wave form. A spectrogram is basically a
graph that shows a sound's frequency on the vertical axis and time on the horizontal axis. Different
speech sounds create different shapes within the graph. Spectrograms also use colors or shades of grey
to represent the acoustical qualities of sound. Some companies use voiceprint recognition so that people
can gain access to information or give authorization without being physically present. Instead of stepping
Page 8 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


up to an iris scanner or hand geometry reader, someone can give authorization by making a phone call.
Unfortunately, people can bypass some systems, particularly those that work by phone, with a simple
recording of an authorized person's password. That's why some systems use several randomly-chosen
voice passwords or use general voiceprints instead of prints for specific words. Others use technology
that detects the artifacts created in recording and playback.

Iris scanning
Iris scanning can seem very futuristic, but at the heart of the system is a simple CCD digital camera It
uses both visible and near-infrared light to take a clear, high-contrast picture of a person's iris. With near-
infrared light, a person's pupil is very black, making it easy for the computer to isolate the pupil and iris.
When you look into an iris scanner, either the camera focuses automatically or you use a mirror or audible
feedback from the system to make sure that you are positioned correctly. Usually, your eye is 3 to 10
inches from the camera. When the camera takes a picture, the computer locates:
The center of the pupil
The edge of the pupil
The edge of the iris
The eyelids and eyelashes

It then analyzes the patterns in the iris and translates them into a code. Iris scanners are becoming more
common in high-security applications because people's eyes are so unique (the chance of mistaking one
iris code for another is 1 in 10 to the 78th power. They also allow more than 200 points of reference for
comparison, as opposed to 60 or 70 points in fingerprints.

The iris is a visible but protected structure, and it does not usually change over time, making it ideal for
biometric identification. Most of the time, people's eyes also remain unchanged after eye surgery, and
blind people can use iris scanners as long as their eyes have irises. Eyeglasses and contact lenses
typically do not interfere or cause inaccurate readings.

Use of SECURE SOCKET LAYER (SSL)


Organizations that use the Web to collect and transmit sensitive data to customers or other organizations
need to secure their Web site. The general standard is the use of secure socket layers (SSL), which
0T 0T

encrypts data transmitted via a Web site. Upon opening an Internet browser, an open or closed lock
appears in the lower right hand corner of the Web site. If the lock is closed, it means the data transmitted
over the Web site is secure, generally by SSL. This allows the transmission and collection of private data
over a Web site, without worrying about a hacker accessing it. There is no such thing as security without
risks, but the use of SSL and secure Web sites when transmitting data significantly reduces the risk of it
being inappropriately intercepted. Secure Web sites can be established by using internal Web
analysts/programmers or working with a vendor who has expertise in creating an appealing and secure
Web experience. SSL uses both symmetric and asymmetric encryption algorithms. Symmetric algorithms
use the same key to encrypt and decrypt data. They are faster than asymmetric algorithms but can be
Page 9 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


insecure. Asymmetric algorithms use a pair of keys. Data encrypted using one key can only be decrypted
using the other. Typically, one of the keys is kept private while the other is made public. Because one key
is always kept private, asymmetric algorithms are generally secure; however, they are much slower than
symmetric algorithms. To reap the benefits of both algorithms, SSL encapsulates a symmetric key that is
randomly selected each time inside a message that is encrypted with an asymmetric algorithm. After both
the client and server possess the symmetric key, the symmetric key is used instead of the asymmetric
ones.

When server authentication is requested, SSL uses the following process:


1. To request a secure page, the client uses HTTPS.
2. The server sends the client its public key and certificate.
3. The client checks that the certificate was issued by a trusted party (usually a trusted Certificate
Authority) that the certificate is still valid, and that the certificate is related to the contacted site.
4. The client uses the public key to encrypt a random symmetric encryption key and sends it to the
server, along with the encrypted URL required and other encrypted HTTP data.
5. The server decrypts the symmetric encryption key using its private key and uses the symmetric
key to decrypt the URL and HTTP data.
6. The server sends back the requested HTML document and HTTP data that are encrypted with the
symmetric key.
7. The client decrypts the HTTP data and HTML document using the symmetric key and displays the
information.

SSL versus TLS


SSL TLSTLS (Transport Layer Security) and SSL (Secure Sockets Layer) are protocols that provide data
encryption and authentication between applications and servers in scenarios where that data is being
sent across an insecure network, such as checking your email (How does the Secure Socket Layer work?).
The terms SSL and TLS are often used interchangeably or in conjunction with each other (TLS/SSL), but
one is in fact the predecessor of the other — SSL 3.0 served as the basis for TLS 1.0 which, as a result, is
sometimes referred to as SSL 3.1. With this said though, is there actually a practical difference between
the two?

Which is more secure – SSL or TLS?


It used to be believed that TLS v1.0 was marginally more secure than SSL v3.0, its predecessor. However,
SSL v3.0 is getting very old and recent developments have shown that SSL v3.0 is now completely
insecure. As SSL v3.0 is effectively “dead” as a useful security protocol. Places that still allow its use for
web hosting as placing their “secure web sites” at risk. Unfortunately, even now a majority of web sites do
not use the newer versions of TLS and permit weak encryption ciphers.

Page 10 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


What happens if I do not select either one?
If neither SSL nor TLS is used, then the communications between you and the server can easily
become a party line for eavesdroppers. Your data and your login information are sent in plain text for
anyone to see; there is no guarantee that the server you connect to is not some middle man or interloper.
For more on this, see: the case for email security.

ENCRYPTION
The translation of data into a secret code. Encryption is the most effective way to achieve data security.
To read an encrypted file, you must have access to a secret key or password that enables you
to decrypt it. Unencrypted data is called plain text ; encrypted data is referred to as cipher text.

Security Encryption Systems


Computer encryption is based on the science of cryptography, which has been used as long as humans
have wanted to keep information secret. Before the digital age, the biggest users of cryptography were
governments, particularly for military purposes.

The Greek historian Plutarch wrote, for example, about Spartan generals who sent and received sensitive
messages using a scytale, a thin cylinder made out of wood. The general would wrap a piece of
parchment around the scytale and write his message along its length. When someone removed the paper
from the cylinder, the writing appeared to be a jumble of nonsense. But if the other general receiving the
parchment had a scytale of similar size, he could wrap the paper around it and easily read the intended
message.

The Greeks were also the first to use ciphers, specific codes that involve substitutions or transpositions of
letters and numbers. As long as both generals had the correct cipher, they could decode any message the
other sent. To make the message more difficult to decipher, they could arrange the letters inside the grid
in any combination.

Most forms of cryptography in use these days rely on computers, simply because a human-based code is
too easy for a computer to crack. Ciphers are also better known today as algorithms, which are the guides
for encryption -- they provide a way in which to craft a message and give a certain range of possible
combinations. A key, on the other hand, helps a person or computer figure out the one possibility on a
given occasion.

Computer encryption systems generally belong in one of two categories:


Symmetric-key encryption
Public-key encryption (Not is syllabus)

Page 11 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Symmetric Key
Just like two Spartan generals sending messages to each other, computers using symmetric-key
encryption to send information between each other must have the same key.

In symmetric-key encryption, each computer has a secret key (code) that it can use to encrypt a packet of
information before it is sent over the network to another computer. Symmetric-key requires that you know
which computers will be talking to each other so you can install the key on each one. Symmetric-key
encryption is essentially the same as a secret code that each of the two computers must know in order to
decode the information. The code provides the key to decoding the message.

Think of it like this: You create a coded message to send to a friend in which each letter is substituted with
the letter that is two down from it in the alphabet. So "A" becomes "C," and "B" becomes "D". You have
already told a trusted friend that the code is "Shift by 2". Your friend gets the message and decodes it.
Anyone else who sees the message will see only nonsense.

The same goes for computers, but, of course, the keys are usually much longer. The first major symmetric
algorithm developed for computers in the United States was the Data Encryption Standard (DES), uses a
56-bit key.

Because computers have become increasingly faster since the '70s, security experts no longer consider
DES secure -- although a 56-bit key offers more than 70 quadrillion possible combinations
(70,000,000,000,000,000), an attack of brute force (simply trying every possible combination in order to
find the right key) could easily decipher encrypted data in a short while. DES has since been replaced by
the Advanced Encryption Standard (AES), which uses 128-, 192- or 256-bit keys. Most people believe that
AES will be a sufficient encryption standard for a long time coming: A 128-bit key, for instance, can have
more than 300,000,000,000,000,000,000,000,000,000,000,000 key combinations [source: CES
Communications].

Getting known to the need of keeping online systems safe from attacks including denial of
service attacks, phishing, pharming.

Denial of Service Attacks (DoS)

DoS stand for Denial of Service. A malicious hacker uses a DoS attack to make a computer resource (i.e. –
website, application, e-mail, voicemail, and network) stop responding to legitimate users. The malicious
hacker does this by commanding a fleet of remotely-controlled computers to send a flood of network
traffic to the target. The target becomes so busy dealing with the attacker’s requests that it doesn’t have
time to respond to legitimate users’ requests. That can cause the target system to stop responding,
resulting in long delays and outages.

Page 12 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


What is a pharming scam?
Phishing scams involve emails that trick you into clicking on a link to a scam website where you are asked
to enter your personal, password or financial information. Pharming scams however automatically
redirect you to these scam websites, often without your knowledge.

Pharming is when you are redirected to a fake/scam version of a website which may look identical to the
website you were trying to view. This is sometimes referred to as page-hijacking or page-jacking. In this
scam, the legitimate URL you typed into your browser or the bookmarked link you followed automatically
changes and redirects you to a fake address, often which looks very similar to the legitimate address.

There are two main methods of committing pharming scams, both leading to potential identity fraud. In
the first, a victim’s computer is infected with a virus or malware which then causes technical changes on
the computer which redirect you to the fake website, even if you type in the correct internet address or
clicked on a bookmark/favorite entry. This style of pharming may be identified by some
antivirus/antispyware software programs.

The second type of pharming is more sophisticated and generally undetectable by antivirus/antispyware
programs making it very hard to protect yourself. In this case, an external DNS server, rather than your
computer, is attacked resulting in you being unknowingly redirected to a fake/scam copy of a legitimate
site. As your computer is not infected, antivirus software cannot help you.

The scam websites which you are redirected to are set up by scammers and may look identical to
legitimate websites which request your personal details such as online banking websites.

The fake site will ask you to enter sensitive personal details such as:
usernames
passwords
bank account and credit card numbers
Email addresses.

If successful, a pharming scam will most likely lead to identity theft using the personal details you enter
into the fake website.

Warning signs
Legitimate websites which ask you to enter sensitive personal details are commonly encrypted to
protect your details. This is usually identified by the use of “https:” rather than “http:” at the start of
the internet address or a closed padlock or unbroken key icon at the bottom right corner of your
browser window. If these are missing or there is an open padlock or broken key icon present, the
website is not secure and could be a scam site.

Page 13 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


The pharming website will often have a striking resemblance to a legitimate site however the
internet address will be slightly different, as may some elements of the visual appearance of the
site.
The site may ask you for personal information which the original site didn’t, for example an online
banking website will usually ask you to enter your username and password, however a pharming
site may also request your bank account or credit card number.

Protect yourself from pharming websites


Never provide your personal, credit card or account details online unless you have verified the
website is authentic.
You can verify a website’s authenticity by looking for “https:” at the beginning of the internet
address, the locked padlock icon or the unbroken key icon.
If you know what the correct internet address should be, check the address of the site you are
viewing matches and ensure it hasn’t changed from what you entered or expected.
Check if the website has a digital certificate. If it has one it will generally appear as a padlock icon
alongside the web address. You can click on the icon to ensure that the certificate has been
verified, is official and has not expired.
Keep your computer programs updated - many programs give you the option to receive updates
automatically. Install and regularly update antivirus, antispyware and firewall software.
Remain cautious when downloading free software from the web as these often carry viruses or
malware.
If you think you have provided your account details to a scammer, contact the organization you
hold your account with immediately, such as your bank or email provider.

What is phishing?
‘Phishing’ refers to emails that trick people into giving out their personal and banking information; they
can also be sent by SMS. These messages seem to come from legitimate businesses, normally banks or
other financial institutions or telecommunications providers. The scammers are generally trying to get
information like your bank account numbers, passwords and credit card numbers, which they will then use
to steal your money.

Phishing emails often look genuine and use what look to be genuine internet addresses—in fact, they
often copy an institution's logo and message format, which is very easy to do. It is also common for
phishing messages to contain links to websites that are convincing fakes of real companies' home pages.

The website that the scammer’s email links to will have an address (URL) that is similar to but not the
same as a real bank's or financial institution’s site. For example, if the genuine site is at
'www.realbank.com.au', the scammer may use an address like 'www.realbank.com.au.log107.biz' or
'www.phoneybank.com/realbank.com.au/login'.

Page 14 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


Warning signs
You receive an email or SMS claiming to be from a financial institution or telecommunication
provider. This message may seem to be from your bank, service provider or a business you don’t
have an account with. The email contains a link that leads you to a website where you are
prompted to enter your bank account details.
The email does not address you by your proper name.
The email might contain typing errors and grammatical mistakes.
The email might claim that your details are needed for a security and maintenance upgrade, to
‘verify’ your account or to protect you from a fraud threat. The email might even state that you are
due to receive a refund for a bill or other fee that it claims you have been charged.

Protect yourself from phishing scams


NEVER send money or give credit card or online account details to anyone you do not know and
trust.
Do not give out your personal, credit card or online account details over the phone unless you
made the call and know that the phone number came from a trusted source.
Do not open suspicious or unsolicited emails (spam)—ignore them. You can report spam to
Australian Communications and Media Authority. If you do not wish to report the message, delete
it.
Do not click on any links in a spam email or open any files attached to them.
Never call a telephone number that you see in a spam email or SMS.
If you want to access an internet account website, use a bookmarked link or type the address in
yourself—NEVER follow a link in an email.
Check the website address carefully. Scammers often set up fake websites with very similar
addresses.
Never enter your personal, credit card or online account information on a website if you are not
certain it is genuine.
Never send your personal, credit card or online account details through an email.

We may not think about if often, but there are several ethical and legal issues that surround our computer
use. It is our responsibility to ensure that we are using computers in a manner that will not bring harm to
others.

Page 15 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


1.4.4 INTERNET SECURITY FOR REAL LIFE SCENARIOS

ONLINE BANKING
Most Internet banking is automatically conducted over a relatively safe kind of Internet connection called
Secure Socket Layers (SSL), and the banks themselves have high security which is rarely breached, but
the weak link is your own personal computer, and it's a very weak link indeed.

Most personal computers are shot through with security holes. This is especially true of PCs running
Windows. You'll find some examples on this page. The big problem is that if a hacker breaches the
0T 0T32U U32T

security on your computer, they can access your Internet bank account through it and pretend that they're
you. The bank won't know the difference and you'll find it very difficult to persuade them that somebody
else transferred all the money out of your account, even though the transaction was conducted on your
computer using your telephone and your Internet connection.

If you decide to take on the security challenge of Internet banking, here are some important tips:

If you have a computer at work, running on a big network, it's highly likely that it's much safer than your
machine at home. Its level of security can be measured (roughly) by how strict the limitations are on its
use. For example, are you able to download software from the Internet and install it on your machine? Are
you able to view all kinds of files on the Internet, including Java and streaming content? If you can't do
these things (not just because they're against the rules but because your computer physically won't allow
them) then it's likely that your security at work is very good. You may decide to use this computer for your
entire Internet banking (assuming, of course, that you've asked your employer for permission).

The only downside to this is that your network manager can spy on you and even collect your password
0T 0T32U U0T32 0T

as you type it in, but the chances are that they're earning plenty of money themselves and don't need to
steal yours.

However when you access your account, make sure you use a good password. Here are some tips on 0T 0T32U

passwords. Never, ever, store an important password in the Password List of your computer. Anybody
U32T

with a decent knowledge of computing can read stored passwords in a couple of seconds (even, a
competent eight year old could do it).

If you bank through your home PC, you'll need to learn more about security. Start with the Tin Hat security 32TU

tips. It's pretty much essential that you run anti-virus software and a firewall to keep out hackers. You'll
U32T 32TU U0T32 0T 0T 0T32U U0T32 0T

also need the latest version of your operating system.

Macs are relatively secure, though recently they've been attacked more often... Again, you need the latest
version of your operating system for maximum security. Each time a new version comes out it plugs more
of the leaks in the previous effort.

Page 16 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


If you're running Linux, it's likely that you know a fair amount about computer vulnerabilities yourself.
You'll also know that Linux can be made safe. You're off to a good start.

ONLINE SHOPPING:
Online shopping can be a convenient and fun activity, provided you take a few precautions to ensure that
your information and money stay safe. Take the time to review these tips on what to do when making a
purchase in order to have the best experience possible.

When Making a Purchase:


Don't shop at a site if you're not comfortable—If you feel that the site may not be secure, you're
42T 42T

probably right. Little things such as misspellings, requests for excessive personal information, and
low-resolution logos and photos may be warning signs.
Never click on links from spam emails to make purchases—it’s always a bad idea to click on a link
42T 42T

in an email from someone you don’t know, but it's particularly dangerous if you buy on a site
advertised in a spam email. Always try to use a search engine to locate legitimate e-tailor sites.
0T 0T32U U0T32 0T

Check the web address to make sure you are on the correct site—Once you arrive at a site, you
42T 42T

need to make sure that it is legitimate and not a fake or spoofed version.
Check that the site is secure—Look for a security seal, such as the McAfee SECURE Trustmark,
42T 42T 0T 0T32U U32T

indicating that the site has been scanned and verified as secure by a trusted third party. This
security seal indicates that the site will protect you from identity theft, credit card fraud, spam and
other malicious threats.
In addition, check to see if the site uses encryption—or scrambling—when transmitting information
0T 0T32U U32T

over the Internet by looking for a lock symbol on the page and checking to make sure that the web
address starts with "https://”, rather than “http://” which indicates that encryption is being used.
42T 42T

Use a credit card or an online payment service—if the site turns out to be fraudulent, your credit
42T 42T

card company will usually reimburse you for the purchase; and in the case of credit card fraud, and
the law should protect you. Some credit card companies even offer extended warranties on
purchases. With debit cards, it can be more difficult to get your money back and you don’t want
your account to be drained while you’re sorting things out with your bank. 0T 0T

Another option savvy shoppers sometimes use is a one-time-use credit card, which includes a
randomly generated number that can be used for one transaction only. If the number is stolen it
cannot be used again. Using this type of credit card also ensures that a thief does not have access
to your real credit card number.
Online payment services, like PayPal also offers another way for you to pay for your online
purchases. These services let you pay with an account from the online payment service, without
having to share your bank or credit card information with e-tailors.
Do not use a public computer to shop online—Computers save or “cache” information to speed up
42T 42T

your Internet experience. And, if you are using a public computer, information such as your
browsing history and even your login information may be accessible to strangers who use the
computer after you. If you leave the computer without logging out of certain sites, others might be

Page 17 of 18
Computer Science 2210 (Notes)
Chapter: 1.4 Security

Topic: 1.4 Security


able to access your accounts. To protect yourself, do all of your online shopping from your secure
home computer.
Only use a secure connection when you place your order—Never shop using an unsecured wireless
42T 42T

network because hackers can access your payment information if the network is not protected.
0T 0T32U U0T32 0T 0T 0T

You also want to make sure that your computer is protected with comprehensive and up-to-date
security software such as McAfee Total Protection, which helps safeguard you from 0T 0T32U U32T

viruses, spyware, and other emerging threats. Additionally, it protects against


0T 0T32U U32T

"keylogger"malware on your machine, which is malicious software that records your keystrokes,
32TU U32T 32TU U0T32 0T

including when you type in your credit card numbers and other personal details that you type on
your keyboard.
Use strong passwords—Choose passwords that are difficult to guess and are at least 10
42T 42T 32TU U0T32 0T

characters long consisting of a combination of numbers, letters, and symbols. Remember to keep
your passwords private and don't set your computer to remember your credit card number or
password when you create an account on an online shopping site. 0T 0T

Also, don’t enter your personal information into popups or at any web page that asks for personal
details above and beyond standard requests. For example, you should never have to reveal your
Social Security number to an online shopping site.

Page 18 of 18
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics

Ethics can be explained as "moral principles that governs one or many people’s behaviors." Ethical
behavior is not necessarily related to the law. For example, just because something is not against the law
doesn't mean it is okay to do it.
It’s an area of study that deals with ideas about what is good and bad behavior, a branch of philosophy
dealing with what is morally right or wrong. Further we can put a word that Ethics is a belief that
something is very important.
The Theme of ethics comprises systematizing, defending, and recommending concepts of right and wrong
behavior. Philosophers today usually divide ethical theories into three general subject areas:

1) Met ethics
2) Normative ethics
3) Applied ethics

Met ethics investigates where our ethical principles come from, and what they mean. Are they
merely social inventions? Do they involve more than expressions of our individual emotions? Met
ethical answers to these questions focus on the issues of universal truths, the will of God, the role
of reason in ethical judgments, and the meaning of ethical terms themselves.

Normative ethics takes on a more practical task, which is to arrive at moral standards that
regulate right and wrong conduct. This may involve articulating the good habits that we should
acquire, the duties that we should follow, or the consequences of our behavior on others.

Finally, applied ethics involves examining specific controversial issues, such as abortion,
infanticide, animal rights, environmental concerns, homosexuality, capital punishment, or nuclear
war.

Page 1 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


ETHICS OF COMPUTER
Computer ethics is concerned with the procedures, values and practices that govern the process of
consuming computing technology and its respective disciplines without harming or violating the moral
values and beliefs of any personal, organization or entity.

Computer ethics is a perception in ethics that addresses the ethical issues and constraints that crop up
from the use of computers, and how they can be mitigated or barred
Computer ethics can be understood as that branch of applied ethics which studies and analyzes
social and ethical impact of information technology.

Ten Commandments dealing with computer ethics to steer to a responsible computer use

Thou shall not use a computer to harm other people.


Thou shall not interfere with other people's computer work.
Thou shall not snoop around in other people's computer files.
Thou shall not use a computer to steal.
Thou shall not use a computer to bear false witness (aka Lie).
Thou shall not copy or use proprietary software for which you have not paid.
Thou shall not use other people's computer resources without authorization or proper
compensation.
Thou shall not appropriate other people's intellectual output.
Thou shall think about the social consequences of the program you are writing or the system you
are designing.
Thou shall always use a computer in ways that ensure consideration and respect for your fellow
humans.

Copyright and plagiarism


Copyright laws (title 17, U. S. Code) provide protection to the authors of “original works of authorship,”
including literary, dramatic, musical, artistic, and certain other intellectual works. This protection is
available to both published and unpublished works. For complete copyright information, see the United
States Copyright Office's web page.
Under copyright law, if you don't own the copyright to a work, you cannot do the following without
permission from the copyright holder:

Reproduce copies of the work


Create derivative works based on the work
Distribute copies of the work
Perform the work publicly
Display the work publicly

Page 2 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics

However, under certain circumstances, using parts of copyrighted works is considered “fair use,” and
is allowable under the law. Courts consider these four factors in determining whether or not a particular
use is fair:
The purpose and character of the use, including whether such use is of commercial nature or is
for nonprofit educational purposes;
The nature of the copyrighted work;
Amount and substantiality of the portion used in relation to the copyrighted work as a whole
and the effect of the use upon the potential market for or value of the copyrighted work.

ESSENTIAL COMPONENTS OF A PERSONAL CODE OF COMPUTER ETHICS


Honesty
Respect
Confidentiality
Professionalism
Responsibility
Communication
Obeying the law

Plagiarism
Using someone else's thoughts or ideas as your own without properly giving credit is plagiarism. It is your
U U

responsibility to understand what plagiarism is and know how to avoid it.

Read the following very carefully: Plagiarism is a serious crime! Now, repeat it to yourself again. Why is
this so important? Plagiarism is something that students easily fall into, whether they mean to or
not. When you write a report and copy and paste from the Internet, you are committing plagiarism. So,
what exactly is plagiarism and how can you avoid it?

When someone publishes work, including books, music, photographs, movies, software, paintings, poetry,
articles, etc., they are granted copyright. Copyright is a set of rights given to the creator of the work
allowing them the sole right to copy and distribute the work. This means that only they can copy, use, or
sell the work. For example, a common myth is that when we buy a CD, we own the music. That is not
true! We have purchased the right to enjoy the music, but it is not ours to copy and then give to a
friend. That is a violation of copyright. The same goes for that example of writing a report. If you copy
and paste or write word for word someone else's work, you are violating copyright laws.

Let's get back to plagiarism. In a nutshell, plagiarism is taking credit for work that someone else did. The
Internet makes plagiarism very easy to do. However, the Internet also makes it very easy for a teacher to
check your work for plagiarism. Be smart and avoid plagiarism at all costs.

Page 3 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


Copyright V/s. Plagiarism

Copyright Plagiarism
One who violets copyright breaks laws that One who plagiarizes breaks a moral code by
protect the right of the creator of an original claiming credit for the work of someone else.
work.
Violation of copyright law may results in fines, Plagiarism may result in academic dismissal
imprisonment or both. or loss of job.

Piracy and Illicit Downloading

Another legal issue in computing is software piracy and illegal downloading. Piracy is the illegal use
and/or copying of software. This includes not only software used on the computer, but video games,
DVDs, CDs, and MP3 files. Notice that the terms “use” AND “copying” were used. Even if you aren't the
one who makes the copy, you are still breaking the law by using a "bootlegged" copy.

Think about it this way. Let's say that your friend just illegally downloaded the hottest new movie and
makes a copy for a few of his friends. You say to yourself, “no big deal...the actors in these movies are
filthy rich anyway”. However, this is wrong way of thinking. It isn't really the actors that you hurt when
you "steal" this way. Think about the people who produce the movie. Think about the people who run the
cameras. Think about the people who keep the studio clean. When you steal music, movies, and
software, you affect a lot of different people.

What is FREE SOFTWARE?

“Free software” means software that respects users' freedom and community. Roughly, it means that the
users have the freedom to run, copy, distribute, study, change and improve the software. Thus, “free
software” is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free
speech,” not as in “free beer”.

We campaign for these freedoms because everyone deserves them. With these freedoms, the users (both
individually and collectively) control the program and what it does for them. When users don't control the
program, we call it a “non-free” or “proprietary” program. The non-free program controls the users, and
the developer controls the program; this makes the program an instrument of unjust power

A program is free software if the program's users have the four essential freedoms:

The freedoms to run the program as you wish for any purpose (freedom 0).
The freedom to study how the program works and change it so it does your computing as per your
requirements (freedom 1). (Access to the source code is a precondition for this.)

Page 4 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


The freedom to redistribute copies so you can help your neighbor or your peers (freedom 2).
The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you
can give the whole community a chance to benefit from your changes.
(Access to the source code is a precondition for this.)

A program is free software if it gives users adequately all of these freedoms. Otherwise, it is not free. While
we can distinguish various non-free distribution schemes in terms of how far they fall short of being free,
we consider them all equally unethical.

The following clarifies certain points about what makes specific freedoms adequate or not.

Freedom to distribute (freedoms 2 and 3) means you are free to redistribute copies, either with or without
modifications, either gratis or charging a fee for distribution, to anyone anywhere. Being free to do these
things means (among other things) that you do not have to ask or pay for permission to do so.

You should also have the freedom to make modifications and use them privately in your own work or play,
without even mentioning that they exist. If you do publish your changes, you should not be required to
notify anyone in particular, or in any particular way.

The freedom to run the program means the freedom for any kind of person or organization to use it on any
kind of computer system, for any kind of overall job and purpose, without being required to communicate
about it with the developer or any other specific entity. In this freedom, it is the user's purpose that
matters, not the developer’s purpose; you as a user are free to run the program for your purposes, and if
you distribute it to someone else, then he/she is then free to run it for his/her purposes, but you are not
entitled to impose your purposes on her.

The freedom to run the program as you wish means that you are not forbidden or stopped from doing so.
It has nothing to do with what functionality the program has, or whether it is useful for what you want to
do.

The freedom to redistribute copies must include binary or executable forms of the program, as well as
source code, for both modified and unmodified versions. (Distributing programs in executable form is
necessary for conveniently running on operating systems.) It is OK if there is no way to produce a binary
or executable form for a certain program (since some languages don't support that feature), but you must
have the freedom to redistribute such forms should you find or develop a way to make them.

In order for freedoms 1 and 3 (the freedom to make changes and the freedom to publish the changed
versions) to be meaningful, you must have access to the source code of the program. Therefore,
accessibility of source code is a necessary condition for free software. Ambiguous “source code” is not
real source code and does not count as source code.

Page 5 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


Freedom 1 includes the freedom to use your changed version in place of the original. If the program is
delivered in a product designed to run someone else's modified versions but refuse to run yours — a
practice known as “tivoization” or “lockdown”, or (in its practitioners' perverse terminology) as “secure
boot” — freedom 1 becomes a theoretical fiction rather than a practical freedom. This is not sufficient. In
other words, these binaries are not free software even if the source code they are compiled from is free.

One important way to modify a program is by merging with available free subroutines and modules. If the
program's license says that you cannot merge in a suitably licensed existing module — for instance, if it
requires you to be the copyright holder of any code you add — then the license is too restrictive to qualify
as “free”.

Freedom 3 includes the freedom to release your modified versions as free software. A free license may
also permit other ways of releasing them; in other words, it does not have to be a copy left license.
However, a license that requires modified versions to be non-free does not qualify as a free license.

In order for these freedoms to be real, they must be permanent and irrevocable as long as you do nothing
wrong; if the developer of the software has the power to revoke the license, or retroactively add
restrictions to its terms, without your wrong doings, then the software is not free.

However, certain kinds of rules about the manner of distributing free software are acceptable, when they
don't conflict with the central freedoms. For example, copy left (very simply stated) is the rule that when
redistributing the program, you cannot add restrictions to deny other people the central freedoms. This
rule does not conflict with the central freedoms; rather it protects them.

Freeware Software:

Freeware is copyrighted software that is licensed to be copied and distributed without charges.

Freeware is free because the license says it is, but it’s still under the owner’s control.

Example:
Netscape
Internet Explorer

Page 6 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


Shareware Software:
The software is licensed for copying and sharing for a trial period, but payment must be made to the
owner for permanent use.

ETHICAL ISSSUES OF ELECTRONIC COMMUNICATION


There is little doubt that electronic communications, and in particular e-mail, have introduced a
paradigm shift in management, organizational and working methods, as well as in business performance,
as they have in the economy in general. While ICTs have dramatically improved business-to-business or
business-to-consumers communications, they have also significantly impacted our day-to-day personal
and professional lives. In particular, many organizations and their employees seem to have been
overwhelmed by a number of issues arising from the usage of electronic communications in the
professional environment.

HACKING
Hacking has always been a controversial issue. Whether people see it as a vigilante attempt at justice, an
attempt to keep authority in check or simply a way to cause mischief and potentially serious harm, it has
always had its pros and cons. 0T 0T

Hacking has been around for longer than the word itself. The original use of the word "hack" came from
the Massachusetts Institute of Technology, and it described a creative or witty way of doing almost
anything. This soon grew to include creative practical jokes that involved some degree of stealth whether
literal or simply in its implementation. Soon the word began to imply some degree of harm done to the
"victim." Many who call themselves hackers insist that if their actions are inflicting harm, then it is not
hacking, but "cracking."

The term "hacking" was originally used to describe ways to create, alter or improve software and
hardware. - A "hacker" is an extremely proficient programmer that could do tasks in 5 lines of code what
others would take several modules. 0T 0T

CRACKING
23T

"Cracking" is the illegal version of hacking, where existing software is reverse-engineered to remove
restrictions like trial periods. 0T 0T

These days, most people don't know the difference anymore, as the term "hacking" has also been used to
describe the action of "breaking into someone's system" 0T

Page 7 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


PRODUCTION OF MALWARE

Malware (short for “malicious software”) is any software designed to harm your computer, such as
viruses, worms, Trojan horses, and root kits.

A computer virus is a program that attaches itself to an application or "host file" and then spreads
40T 40T

by making copies of it. Some type of human action (e.g. opening an attachment) is always required
for a virus to take effect. Once a virus gets onto your computer it might modify, delete, or steal your
files, make your system crash, or take over your machine.

A computer worm is like a virus, but it infects other computers all by itself, without human action
40T 40T

and without a host file. It usually infects other computers by sending emails to all the names in
your email address book.

A Trojan horse is a program that tricks you into running it by appearing useful or harmless.
40T 40T

However, once it is run, it damages your computer, usually by providing "back door" access to the
computer. This allows hackers to control or use your computer, destroy or steal files, install
viruses or spyware, or run arbitrary programs.

A root kit is a program that allows an intruder to gain access to your system without your
40T 40T

knowledge by hiding what it is doing on the system. The intruder can then install difficult-to-detect
back doors into your system to seize control.

Protective Measures

Practices

Only perform file transfers from trusted sources: This reduces your risk of downloading files
40T 40T

infected with malware and introduces accountability, so that you have a better chance of getting a
response if you do have a problem.

Scan all files that you receive through file transfer: It is a good idea to scan the files that you
40T 40T

receive from P2P networks with your anti-virus software to detect malware. This may slow down
the transfer, but it will help keep your computer safe.

Check a corporate wireless network's security level before connecting: Many corporate networks
40T 40T

allow users to connect their wireless devices to the network. However, not all of these networks
are secured. In fact, it is quite easy for a user to connect his/her wireless device to a corporate
network without getting permission first. When this happens, the user may intentionally or
unintentionally transfer viruses onto the company network, putting everybody on the network at
risk. You should make sure your corporate network is secure before connecting your own device. If
users can connect to your company’s network without getting permission or a password, it’s
probably not a good idea to connect to that network at all.

Page 8 of 9
Computer Science 2210 (Notes)
Chapter: 1.5 Ethics

Topic: 1.5 Ethics


Make sure the public network you connect to is secure: Many public networks are not secure and
40T 40T

do not even require you to identify yourself with a password. Not only do you run the risk of being
infected by malware from other users on such a network, you may unintentionally transmit
malware to them as well. Make sure you only connect to secured networks that ask users for a
password.

Unfortunately, wireless cards and operating systems are set up to automatically connect to any network
in range. Disabling or modifying this setting requires a thorough understanding of your operating system,
so you should generally leave this setting alone. Your best option is to check the network every time you
connect and manually disconnect if the network is not secure.

A full field of malware creation tools has enabled attackers to transition from manually creating single-
use and easily defeated malware to developing an automated production line to develop an "army of
armored malware" to carry out attack campaigns and hence bring harm to you and your PC.

Page 9 of 9
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Top down/modular design

1. Advantages of designing a solution to a problem by splitting it up into smaller problems.


2. Produce and describe top-down/modular designs using appropriate techniques, including
structure diagrams, showing stepwise refinement

Definition: A Top-down design is when a problem is split into smaller sub-problems, which themselves
U U

are split into even smaller sub-problems until each is just one element of the final program.

Benefits and drawbacks of modular programs


U

Page 1 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Structure diagrams
A structure diagram is a pictorial representation of a modular system.

Stepwise refinement
Stepwise refinement is the process of developing a modular design by splitting a problem into smaller
sub-tasks, which themselves are repeatedly split into even smaller sub-tasks until each is just one
element of the final program.

Page 2 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


1. produce an algorithm for a given problem either in pseudocode form or the flowchart form
2. understand algorithms presented in the form of program flowcharts and pseudocode

What is an Algorithm?
An algorithm is a sequence of steps, which perform a specific task. In computing, algorithms are usually
represented as a program flowchart, or in pseudocode.

What is a program flowchart?


A program flowchart is a pictorial representation of an algorithm. Program flowcharts consist of special
symbols:

Page 3 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Here is an example of a flowchart to output the first five squared numbers:

Page 4 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


What is Pseudocode?
Pseudo-code is a simplified form of programming code that uses common programming terminologies,
but does not use the strict syntax rules of a programming language.
An example of a pseudocode algorithm:
{
BEGIN
INPUT CardNumber
REPEAT
INPUT PIN
IF PIN is wrong for this CardNumber THEN
OUTPUT “Wrong Pin”
END IF
UNTIL Pin is correct
INPUT Amount
IF there are enough funds THEN
Dispense Cash
Update customer’s balance
ELSE
OUTPUT “Sorry, insufficient funds”
END IF
END
}

Page 5 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Algorithms should be evaluated using the following criteria:
1. Efficiency
2. Correctness
3. Appropriateness

Efficiency
An algorithm’s efficiency can be judged in terms of:
Speed: How quick the algorithm produces the required output.
Memory requirements: How many lines of code the algorithm contains.

Correctness
Although an algorithm is expected to produce the correct outputs, correctness can still be measured in
terms of:
Accuracy : How many decimal places produce output with greater accuracy (e.g. more decimal
places)
Range: Will the algorithm work with the complete range of inputs? Or can it only deal with positive
numbers, whole numbers, numbers below 1 million, etc.
Reliability: Will the algorithm always produce correct output within the range that it is designed to
work? Or are there values which it will not accept
(e.g. zero).

Appropriateness
Appropriateness can be measured in terms of:
Length: If the problem is simple then a short algorithm would normally be expected.
Speed: if the output needs to be generated quickly, then the algorithm must be able to generate
output quick enough.
Memory requirements: An algorithm controlling a washing machine must not require a lot of
memory!

Page 6 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Flow Charts
This section covers the use of flow diagrams (charts) in the production of algorithms. This topic must not
be confused with “Systems flowcharts” as those are different and these are covered in a different section
(Systems analysis).
This section primarily covers four areas:
1. Common flow chart symbols
2. Writing flowcharts to solve problems
3. Dry running of flowcharts to determine its function and outputs
4. Exercises to test the above concepts
5. Topical past paper questions

Page 7 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Common flowchart symbols

Page 8 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Understand and use assignment statements

What is an Assignment?
An assignment is an instruction in a program that places a value into a specified variable.
Some typical assignments are:

TheLength  20.5
TheUsersName$  “Charlie”
TheArea  TheWidth * TheLength
TotalCost  LabelledCost + 15
Counter  Counter + 1

Note that the last example is a common method used to increment the value of a variable. It could be read
as:

(The new value of “Counter” is its existing value plus one)

Page 9 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Arithmetic operators including operators for integer

Addition, subtraction and multiplication

Powers

Division
A result of a division such as 17 ÷ 4 can be expressed either as a real (4.25) or as two integers
(4 remainder 1).

The integer method, in most programming languages, uses the operators DIV and MOD.

Page 10 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Relational operators, eg. =, <, <=, >, >= and <>

Relational operators are used in the format: [Expression] [Operator] [Expression] and will always return a
Boolean (True or False) value.

Relational operators are typically used with the “IF” selection and also within conditional loops
(REPEAT-UNTIL or WHILE-WEND).

In the following table, the variables “a” and “name$” have the following assignments:

a3+5
name$ “JAMES”

Page 11 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Boolean operators AND, OR and NOT

AND & OR
The AND & OR operators always return a Boolean result and are used in the format:

[Boolean] [Operator] [Boolean]

The following ‘truth’ table summarizes the result of the Boolean operations:

Values Results

NOT
The NOT operator reverses the result of the Boolean expression and is used in the format:

NOT [Boolean]

The following truth table summarizes the NOT operation:

Examples of Boolean ‘logic’


Consider the following algorithm, which is used to monitor a printer and display its output via an
LCD display in the front panel:

IF NOT(PaperTrayEmpty) AND (FilesWaiting > 0) THEN


OUTPUT “PRINTING…”
ELSE
OUTPUT “PLEASE ADD PAPER”
END IF

Page 12 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Validation

Validation checks ensure that data entered into the computer is sensible. Data is checked in accordance
with a set of rules. The computer's software can validate data while it is being entered into the computer.
The main purpose of data validation is to spot an error. This can be done quickly and easily as the process
is automated.

Range check. A mathematics exam is out of 100. A simple validation rule that the computer can apply to
any data that is input is that the mark must be between 0 and 100 inclusive. Consequently, a mark of 101
would be rejected by this check as being outside the acceptable range. Code can be added to check that a
particular control has a value between an allowed maximum and minimum:

The age that


Is
No Yes
you have
(Age)< 11 entered is
OR not within
(Age)> 70 the permitted
range

If Age < 11 OR Age > 70 Then


Print (“The age that you have entered is not within the permitted range”)
End

Character check. A person’s name will consist of letters of the alphabet and sometimes a hyphen or
apostrophe. This rule can be applied to input of a person’s name so that dav2d will immediately be
rejected as unacceptable.

Format check. A particular application is set up to accept a national insurance number. Each person has a
unique national insurance number, but they all have the same format of characters, 2 letters followed by 6
digits followed by a single letter. If the computer knows this rule then it knows what the format of a NI
number is and would reject ABC12345Z because it is in the wrong format, it breaks the rule.

Length check. A NI number has 9 characters, if more or fewer than 9 characters are keyed in then the data
cannot be accurate. Code can be added to check that a particular control has a value between an allowed
maximum and minimum:383

The password
No
Is
Len(Password)>
Yes that you have
entered is
12? too long

Page 13 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design

If Len(Password) > 12 Then


Print (“The password that you have entered is too long”)
End

Existence check. A bar code is read at a supermarket check-out till. The code is sent to the main computer
which will search for that code on the stock file. As the stock file contains details of all items held in stock,
if it is not there then the item cannot exist, which it obviously does, therefore the code must have been
wrongly read.

Presence check
Code can be added to check that a particular control has not been left empty or un-checked:

No
Is
Username = “”? Yes You have not
entered a
Username

If Username = “” Then
Print (“You have not entered a Username”)
End

Page 14 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Writing flowcharts to solve problems

The following five problems are also covered in section 3.2 where the algorithms are constructed using
pseudocode. Candidates may choose to answer questions using either flowcharts or pseudocode but a
working knowledge of both techniques is well advised.

2.1 Example 1
A town contains 5000 houses. Each house owner must pay tax based on the value of the house. Houses
over $200 000 pay 2% of their value in tax, houses over $100 000 pay 1.5% of their value in tax and houses
over $50 000 pay 1% of their value in tax. All others pay no tax. Write an algorithm to solve this problem in
the form of a flowchart.

2.2 Example 2
The following formula is used to calculate n: n = (x * x)/(1 – x). The value x = 0 is used to stop the
algorithm. The calculation is repeated using values of x until the value x = 0 is input. There is also a need
to check for error conditions. The values of n and x should be output. Write an algorithm to show this
repeated calculation in the form of a flowchart.

Page 15 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Answers to the Examples:

Page 16 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design

Page 17 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Dry running of flowcharts
Dry running of flowcharts is basically a technique to:
Determine the output for a known set of data to check it carries out the task correctly.
Check the logic of the algorithm.
Determine the function of the algorithm.
When dry running a flowchart it is advisable to draw up a trace table showing how variables
change their values at each stage in the algorithm.

The advantages of doing this are:


o If you make a mistake, it is easier to back track to where the error occurred rather than
starting from the beginning again
o There is less chance of an error being made
o Encourages a more logical approach
The following three examples show all stages in the dry running for the given set of input data:

Example 1
This algorithm inputs 3 numbers, each number goes through successive division by 10 until its value is
less than 1. An output is produced which contains the number input and a value generated by the
flowchart processing.
Data to be used: X = 85, 3190, -40

Example 2
This algorithm inputs 5 values and outputs how many input numbers were negative and how many were
positive.
Data to be used: N = 1, -5, 2, -8, -7

Example 3
This algorithm inputs the number of hours of sunshine recorded each day for a week (7 days). The output
is the highest value for hours of sunshine and the average (mean) value for the numbers of hours of
sunshine per day.
Data to be used: hours = 9.0, 7.8, 1.2, 4.5, 10.0, 6.4, 3.1

Page 18 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Answers to the Examples:

Page 19 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design

Page 20 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design

Page 21 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Questions 1 to 7 are problems which require an algorithm to be written in the form of a flowchart.
Questions 8 to 10 require a trace table to be written and find the expected output for the given set of data.
The answers to these questions can be found in booklet 6.

1. Regis lives in Brazil and often travels to USA, Europe and Japan. He wants to be able to convert
Brazilian Reais into US dollars, European euros and Japanese yen.

The conversion formula is: Currency value = number of Reais X conversion rate

For example, if Regis is going to USA and wants to take 1000 Reais (and the exchange rate is 0.48)
then he would input USA, 1000 and 0.48 and the output would be: 480 US dollars.
Write an algorithm, using a flowchart, which inputs the country he is visiting, the exchange rate and the
amount in Brazilian Reais he is taking. The output will be value in foreign currency and the name of the
currency.

2. As part of an experiment, a school measured the heights (in meters) of all its 500 students.

Write an algorithm, using a flowchart, which inputs the heights of all 500 students and outputs the
height of the tallest person and the shortest person in the school.

3. A geography class decide to measure daily temperatures and hours of sunshine per day over a 12
month period (365 days)

Write an algorithm, using a flowchart, which inputs the temperatures and hours of sunshine for all 365
days, and finally outputs the average (mean) temperature for the year and the average (mean) number
of hours per day over the year.

4. A small shop sells 280 different items. Each item is identified by a 3 – digit code. All items that start
with a zero (0) are cards, all items that start with a one (1) are sweets, all items that start with a two
(2) are stationery and all items that start with a three (3) are toys.

Write an algorithm, using a flowchart, which inputs the 3 – digit code for all 280 items and outputs the
number of cards, sweets, stationery and toys.

5. A company are carrying out a survey by observing traffic at a road junction. Each time a car, bus or
lorry passed by the road junction it was noted down.
10 000 vehicles were counted during the survey.
Write an algorithm, using an algorithm, which:
inputs all 10000 responses outputs the number of cars, buses and lorries that passed by the junction
during the survey outputs the number of vehicles that weren’t cars, buses or lorries during the survey.

Page 22 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


6. Speed cameras read the time a vehicle passes a point (A) on the road and then reads the time it
passes a second point (B) on the same road (points A and B are 100 metres apart).
The speed of the vehicle is calculated using:

The maximum allowed speed is 100 kilometres per hour. 500 vehicles were monitored using
these cameras over a 1 hour period.
Write an algorithm, using a flowchart, which:
inputs the start time and end time for the 500 vehicles that were monitored
calculate the speed for each vehicle using the formula above
outputs the speed for each vehicle and also a message if the speed exceeded 100 km/hour
output the highest speed of all the 500 vehicles monitored

7. There are ten stations on a railway line:


1 ------ 2 ------ 3 ------ 4 ------ 5 ------ 6 ------ 7 ------ 8 ------ 9 ------ 10
The train travels in both directions (i.e. from 1 to 10 and then from 10 to 1). The fare between each
station is $2.
A passenger inputs the number of the station at the start of his journey and the number of the
destination station and the fare is calculated (e.g if a passenger gets on a station 3 and his
destination is station 9 his fare will be $12). The calculation must take into account the direction of
the train (e.g. a passenger getting on at station 7 and getting off at station 1 will also pay $12 and
not a negative value!!).
A discount of 10% is given if 3 or more passengers are travelling together.

Write an algorithm, using a flowchart, which:


inputs the number of passengers travelling
inputs the station number of the starting point and the station number of the destination
calculates the total fare taking into account the direction of travel
calculates any discount due
outputs the cost of the tickets and prints the tickets

Page 23 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


8. Draw the trace table and determine the output from the following flowchart using the following
data:

number = 45, -2, 20.5

Page 24 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


9. Draw the trace table and determine the output from the following flowchart using the following
data (NOTE: input of the word “end” stops the program and outputs results of the survey):

vehicle = car, car, lorry, bus, van, van, car, car, bus, car, end

Page 25 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


10. Draw the trace table and determine the output from the following flowchart using the following
data:

X = 5, -3, 0, -3, 7, 0, 6, -11, -7, 12

Page 26 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


Questions:
Modular Design/Top-down design:

May/June 2006
5. (a) Programs can be designed in modular form.
Discuss the advantages and disadvantages of designing programs in modular form. [5]

(b) A program is to be written which will update the records in a sequential file and then
produce a backup copy.

Describe, using a diagram, the way that this problem can be split into modules to prepare it
for coding. [5]

May/June 2009
A company specialises in creating websites for customers.
8. (a) As part of the process of designing a site, the company will use diagrams in order to make
understanding easier.
Describe two types of diagram that may be used by the company. [4]

May/June 2011. P23

1. (a) Draw a suitable layout for the screen. [5]

3. Kris has written a program that will work out the wages for her staff. The main steps for each
employee are: to work out the hours worked, work out the total earnings, work out tax and finally
print out how much will be taken home.

(a) Complete the structure diagram to show the modules that will be needed.

[3]

Page 27 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


(b) The printout will be different for those staff who receive cash and those who have their
earnings paid directly to a bank account. Add the next level to the print module.

Oct/NOV 2011 P23


1 Nathan is designing a software solution for stock control in a computer shop. He has a colleague,
called Andre, who will help him write the program. Nathan decides to modularise the solution.
(a) State why modularisation is a good idea. [1]
(b) As the first step in his design he splits the solution into the following main areas:
Initialisation, StockOrdering, Sales, SalesReport.
Complete the following structure diagram.

[1]
(c) SalesReport is made up of two modules, MonthlySalesReport and AnnualSalesReport.
Add them to the structure diagram in (b). [2]

Oct/NOV 2012 P21

1 Soni works for a software house which has been asked to design software for a cycle hire
company, Super Bikes.
Soni decides on the main tasks:
collecting the information about new bikes
entering details of repairs
entering details of hirer
entering details of payment
(a) Complete the structure diagram showing these tasks.

[2]
Page 28 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.1 Problem-solving and design


(b) The collection of information about repairs has three subtasks:
input the repair needed
input the parts list
input the cost of the repair
Add these to the structure diagram in part (a). [1]
(c) State two reasons for dividing the main task into smaller tasks. [2]

Page 29 of 29
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts

Introduction to Pseudocode
U

This section covers the use of pseudocode in the production of algorithms. Students should use standard
computing text books to find out information on the features of programming languages (high level and
low level), interpreters, compilers, assemblers, user documentation and technical documentation.

No specific programming language is referred to; development of algorithms using pseudocode uses
generic descriptions of looping, branching, data manipulation, input/output, totaling and counting
techniques.

The section is broken down into four areas:

1. Description of common pseudocode terms


2. Writing algorithms using pseudocode
3. Finding errors in sections of pseudocode
4. Exercises

Understand and use assignment statements


U

Assignment
An assignment is an instruction in a program that places a value into a specified variable.
Some typical assignments are:

TheLength  20.5
TheUsersName$  “Charlie”
TheArea  TheWidth * TheLength
TotalCost  LabelledCost + 15
Counter  Counter + 1

Note that the last example is a common method used to increment the value of a variable. It could be read
as:

“The new value of Counter is its existing value plus one”

What is an algorithm?

It is a procedure for solving a problem in terms of the actions to be executed and the order in which those
0T 0T

actions are to be executed. An algorithm is merely the sequence of steps taken to solve a problem. The
steps are normally "sequence," "selection,” "iteration," and a case-type statement.

Page 1 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


The "selection" is the " if ….. then ….. else ….. endif" statement, and the iteration is satisfied by a number of
statements, such as the " for … to … next, while … endwhile and repeat … until " while the case-type
statement is satisfied by the “case of ….. otherwise …... endcase" statement.
Relational operators, e.g. =, <, <=, >, >= and <>
U

Relational operators are used in the format: [Expression] [Operator] [Expression] and will always return a
Boolean (True or False) value.

Relational operators are typically used with the IF selection and also within conditional loops
(REPEAT-UNTIL or WHILE-WEND).

In the following table, the variables a and name$ have the following assignments:

a3+5
name$ “JAMES”

Page 2 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


Boolean operators AND, OR and NOT

AND and OR
The AND and OR operators always return a Boolean result and are used in the format:

[Boolean] [Operator] [Boolean]

The following ‘truth’ table summarises the result of the Boolean operations:

Values Results

NOT
The NOT operator reverses the result of the Boolean expression and is used in the format:

NOT [Boolean]

The following truth table summarises the NOT operation:

Examples of Boolean ‘logic’


Consider the following algorithm, which is used to monitor a printer and display its output via an
LCD display in the front panel:

IF NOT(PaperTrayEmpty) AND (FilesWaiting > 0) THEN


OUTPUT “PRINTING…”
ELSE
OUTPUT “PLEASE ADD PAPER”
END IF

Page 3 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


Branching
There are two common ways of branching:
1. case of ….. otherwise …... endcase
2. if ….. then ….. else ….. endif

case of if … then
case number of if number = 1 then x  x + 1
1: x  x + 1 else if
2: y  y + 1 number = 2 then y  y + 1
otherwise print “error” else print “error”
endcase endif
endif

SELECT-CASE
This selection method is used if there are MORE THAN TWO possible outcomes to a test:
Creating a Select-Case statement is simple to do. The next program will prompt the user to select the key
A-D and the program will respond by telling the user what key was entered.

We will create a Select-Case statement for the A-D keys entered.

DIM KeyPressed AS STRING

CLS

PRINT
PRINT

INPUT "Please Enter A Key (A,B,C,D): ", KeyPressed

KeyPressed = UCASE$(KeyPressed)

PRINT

SELECT CASE KeyPressed


CASE "A"
PRINT "A Was Entered"
CASE "B"
PRINT "B Was Entered"
CASE "C"
PRINT "C Was Entered"
CASE "D"
PRINT "D Was Entered"

Page 4 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


CASE ELSE
PRINT "Some Other Key Was Entered"
END SELECT

DIM Score AS INTEGER

CLS

PRINT
PRINT
INPUT "Enter The Test Score: ", Score

PRINT

SELECT CASE Score


CASE IS >= 97
PRINT "Grade A+"
CASE 93 TO 96
PRINT "Grade A"
CASE 90 TO 92
PRINT "Grade A-"
CASE 87 TO 89
PRINT "Grade B+"
CASE 83 TO 86
PRINT "Grade B"
CASE 80 TO 82
PRINT "Grade B-"
CASE 77 TO 79
PRINT "Grade C+"
CASE 73 TO 76
PRINT "Grade C"
CASE 70 TO 72
PRINT "Grade C-"
CASE 67 TO 69
PRINT "Grade D+"
CASE 63 TO 66
PRINT "Grade D"
CASE 60 TO 62
PRINT "Grade D-"
CASE ELSE
PRINT "Fail"
END SELECT

Page 5 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


IF-THEN-ELSE-ENDIF
This selection method is used if there are TWO possible outcomes to a test:
| IF { conditional statement } THEN |
| { statement 1 } |
| ELSE |
| { statement 2 } |
| ENDIF |

Example:
| if X > 10 then |
| PRINT X; " is > 10" |
| else |
| PRINT X; " is <= 10" |
| endif |

Dim count As Integer = 0


Dim message As String

If count = 0 Then
message = "There are no items."
ElseIf count = 1 Then
message = "There is 1 item."
Else
message = "There are " & count & " items."
End If

Page 6 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


Loops

Iteration
Iteration is a control structure in which a group of statements is executed repeatedly – either a set
number of times or until a specific condition is True.
There are three common ways of performing a looping function:

1. for … to … next,
2. while … endwhile
3. repeat … until

The following example input 100 numbers and finds the total of the 100 numbers and outputs this total.
All three looping techniques are shown:

for … to while … endwhile repeat … until


for count  1 to 100 while count < 101 repeat
input number input number input number
total total + number total  total+ number total  total+number
next count  count + 1 count  count+1
print total endwhile until count=100
print total

FOR-NEXT
This is an unconditional loop in which the number of repetitions is set at the beginning.
FOR X = 1 TO 5
Answer = X*3
OUTPUT X, Answer
NEXT

Sample code:
|10 sum = 0 |
|20 FOR x = 1 to 10 |
|30 print x |
|40 input "enter a number";n |
|50 sum = sum + n |
|60 NEXT x |
|70 print "The sum of the numbers you gave is";sum |

Page 7 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


WHILE-ENDWHILE
This is a conditional loop, which has a test at the start and repeats until the condition is false:
X = 0
WHILE X < 6 DO
X = X + 1
Answer = X*3
OUTPUT X, Answer
ENDWHILE
Sample code:

| 10 sum = 0 |
| 20 x = 1 |
| 30 WHILE x < 11 |
| 40 print x |
| 50 input "enter a number";n |

| 60 sum = sum + n |
| 70 x = x + 1 |
| 80 WEND |
| 90 print "The sum of the numbers you gave is";sum |

REPEAT-UNTIL
This is a conditional loop, which has a test at the end and repeats until the condition is true:

X = 0
REPEAT
X = X + 1
Answer = X*3
OUTPUT X, Answer
UNTIL X > 4

Common pseudocode terms:

1.1) Counting

Counting in 1s is quite simple; use of the statement count  count + 1 will enable counting to be done
(e.g. in controlling a repeat loop). The statement literally means: the (new) count =the (old) count + 1.

It is possible to count in any increments just by altering the numerical value in the statement (e.g. count
 count – 1) will count backwards.

Page 8 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts

1.2) Totaling

To add up a series numbers the following type of statement should be used:

total  total + number

This literally means (new) total = (old) total + value of number.

1.3) Input/output

Input and output indicated by the use of the terms READ number, PRINT total, PRINT “result is” x and so
on.

Writing algorithms using pseudocode

The following five examples use the above pseudocode terms. These are the same problems discussed in
section 3.1 using flow charts – both methods are acceptable ways of representing an algorithm.

2.1 Example 1
A town contains 5000 houses. Each house owner must pay tax based on the value of the house. Houses
over $200 000 pay 2% of their value in tax, houses over $100 000 pay 1.5% of their value in tax and houses
over $50 000 pay 1% of their value in tax. All others pay no tax.
Write an algorithm to solve the problem using pseudocode.

for count  1 to 5000


input house
if house > 50 000 then tax  house * 0.010
else if house > 100 000 then tax  house * 0.015
else if house > 200 000 then tax  house * 0.020
else tax  0
print tax
next

Notes:
(1) a while loop or a repeat loop would have worked just as well
(2) the use of endif isn’t essential in the pseudocode

Page 9 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


For example,
count  0
while count < 5001
input house
if house > 50000 then tax  house * 0.010
else if house > 100 000 then tax  house * 0.015
else if house > 200 000 then tax  house * 0.020
else tax  0
endif
endif
endif
print tax
count  count + 1
endwhile

EXERCISE: Re-write the above algorithm using a repeat loop and modify the if … then … else statements to
include both parts of the house price range.
(e.g. if house > 50000 and house <= 100000 then tax = house * 0.01)

2.2 Example 2

The following formula is used to calculate n: n = x * x/(1 – x)


The value x = 0 is used to stop the algorithm. The calculation is repeated using values of x until the value x
= 0 is input. There is also a need to check for error conditions. The values of n and x should be output.

Write an algorithm to show this repeated calculation using pseudocode.

NOTE: It is much easier in this example to input x first and then loop round doing the calculation until
eventually x = 0. Because of this, it would be necessary to input x twice (i.e. inside the loop and outside the
loop). If input x occurred only once it would lead to a more complicated algorithm.

(Also note in the algorithm that <> is used to represent ≠ “not equals to” ).

A while loop is used here, but a repeat loop would work just as well.

input x
while x <> 0 do
if x = 1 then print “error”
else n  (x * x)/(1 – x)
print n, x
endif
input x
endwhile

Page 10 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


2.3 Example 3
Write an algorithm using pseudocode which takes temperatures input over a 100 day period (once per
day) and output the number of days when the temperature was below 20C and the number of days when
the temperature was 20C or above.

(NOTE: since the number of inputs is known, a for … to loop can be used. However, a while loop or a repeat
loop would work just as well).

total1  0 : total2  0
for days  1 to 100
input temperature
if temperature < 20 then total1  total1 + 1
else total2  total2 + 1
endif
next
print total1, total2

This is a good example of an algorithm that could be written using the case construct rather than if … then
… else. The following section of code replaces the statements if temperature < 20 then …… endif:
case temperature of
1: total1 = total1 + 1
2: total2 = total2 + 1
endcase

Page 11 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


2.4 Example 4
Write an algorithm using pseudocode which:

inputs the top speeds of 5000 cars


outputs the fastest speed and the slowest speed
outputs the average speed of all the 5000 cars

(NOTE: Again since the actual number of data items to be input is known any one of the three loop
structures could be used. It is necessary to set values for the fastest (usually set at zero) and the slowest
(usually set at an unusually high value) so that each input can be compared. Every time a value is input
which > the value stored in fastest then this input value replaces the existing value in fastest; and similarly
for slowest).

fastest  0: count  0
slowest  1000
repeat
input top_speed
total  total + top_speed
if top_speed > fastest then fastest  top_speed
if top_speed < slowest then slowest  top_speed
endif
endif
count  count + 1
until count = 5000
average  total * 100/5000
print fastest, slowest, average

Page 12 of 13
Computer Science 2210 (Notes)
Chapter: 2.1 Algorithm design and
problem-solving

Topic: 2.1.2 Pseudocode and flowcharts


2.5 Example 5
A shop sells books, maps and magazines. Each item is identified by a unique 4 – digit code. All books
have a code starting with a 1, all maps have a code starting with a 2 and all magazines have a code
beginning with a 3. The code 9999 is used to end the program.

Write an algorithm using pseudocode which input the codes for all items in stock and outputs the number
of books, maps and magazine in stock. Include any validation checks necessary.

(NOTE: A 4-digit code implies all books have a code lying between 1000 and 1999, all maps have a code
lying between 2000 and 2999 and all magazines a code lying between 3000 and 3999. Anything outside
this range is an error)

books  0: maps  0: mags  0


repeat
input code
if code > 999 and code < 2000 then books  books + 1
else if code > 1999 and code < 3000 then maps  maps + 1
else if code > 2999 and code < 4000 then mags  mags + 1
else print “error in input”
endif:endif:endif
until code = 9999
print books, maps, mags

(NOTE: A function called INT(X) is useful in questions like this. This returns the integer (whole number)
part of X e.g. if X = 1.657 then INT(X) = 1; if X = 6.014 then INT(X) = 6 etc. Using this function allows us to
use the case statement to answer this question:

books  0: maps  0: mags  0


repeat
input code
x  INT(code/1000) * divides code by 1000 to give a
case x of * number between 0 and 9
1: books  books + 1
2: maps  maps + 1
3: mags  mags + 1
otherwise print “error”
endcase
until code = 9999
print books, maps, mags

(This is probably a more elegant but more complex solution to the problem)

Page 13 of 13
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Declare and use variables and constants
U

Variable
U

A variable is a value that can change during the execution of a program.

Constant
U

A constant is a value that is set when the program initializes and does not change throughout the
program’s execution.

Declaration
U

A declaration is a statement in a program that gives the compiler or the interpreter information about a
variable or constant that is to be used within a program.
A declaration ensures that sufficient memory is reserved in which to store the values and also states the
variables’ data type. Reserved words/keywords cannot be used as identifier names as this generates a
compiler error and comes under the category of syntax error.

Declaration of local variables


DIM MyCounter AS Integer
DIM FirstName, LastName AS String (declares two variables)
DIM TheLength AS Single
DIM DOB AS Date
DIM OverDueFlag AS Boolean
Scope
U

Scope indicates whether a variable can be used by all parts of a program or only within limited sections of
the program – for example, within a subroutine.

Global variable
U

A global variable is one that is declared at the start of the main program and is visible (useable)
everywhere in the program and exists for the lifetime of the program.
Note that if one procedure changes the value of a global variable, then the next procedure that uses the
variable will be given this changed value – this is a common cause of errors.

Local variable
U

A local variable is one that is only visible inside the procedure or function in which it is declared.

Note that a local variable cannot be referenced from outside the procedure. In fact a local variable does
not exist until the procedure starts executing and it disappears when the procedure stops executing. Thus
any value that is held by a local variable is only stored temporarily.
The lifetime of a local variable is the lifetime of the procedure in which the local variable is declared.
The advantage of using local variables rather than global variables is that the same variable names can be
used in several different procedures without any chance of values being confused.

Page 1 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts

Features of variables:

Holds data in memory


Are assigned a data type
The data can change throughout the program’s operation
The data input must be the same data type as assigned to that variable

Variables are assigned a name that holds the data. That name is used to distinguish it from the other
variables in your program. The name must not start with a number or character that is not a letter. Also,
the name of the variable must not be a reserved word like PRINT, INPUT, LET, ABS, BEEP, etc.

There are two ways to declare a variable in Basic.

The first is to put a data type symbol after the name

$ String
% Integer
! Single
# Double

Examples:

MyName$
Num1%
Num2!
Answer!

Sample Code:

CLS
Header$ = "This is an example program"
Num1% = 5
Num2% = 6
Num5! = 4.5
Num6! = 6.75
Num7# = 56000.25
Num8# = 89000.34
CLS
PRINT Header$
PRINT Num1% + Num2%
PRINT Num6! / Num5!

Page 2 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


PRINT Num8# + Num2%

The second way is the preferred way since Visual Basic uses this method. DIM is used to make variables
of a data type.

DIM [Variable Name] As Data Type

DIM [Variable Name] AS STRING


DIM [Variable Name] AS INTEGER
DIM [Variable Name] AS LONG
DIM [Variable Name] AS SINGLE
DIM [Variable Name] AS DOUBLE

Examples:
DIM MyName AS STRING
DIM Num1 AS INTEGER
DIM Num2 AS SINGLE
DIM Answer AS SINGLE

Code:
DIM Num1 AS INTEGER
DIM Num2 AS LONG
DIM Num3 AS SINGLE
DIM Num4 AS DOUBLE
DIM Header AS STRING
CLS
Header = "This is another example"
Num1 = 5
Num2 = 56000
Num3 = 45.635
Num4 = 66000.5634#

PRINT Header
PRINT Num1 + Num2 + Num3 + Num4

Remember that selecting the right data type for the variable is very important to make the program run
properly.

Page 3 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Using declared constants
Constants will be declared at the start of the main program. The following shows the declaration of
constants for Pi and the Value added tax rate.
CONST Pi = 3.14159
CONST VatRate = 0.175

Declaring constants at the start of a program means that maintenance is made easier for two reasons:
If the value of a constant changes, it only has to be changed in the one part of the program
where it has been declared, rather than in each part of the program in which it is used;

the code is easier to interpret:

For example:
Total=VatRate*CostPrice
Total=0.175*CostPrice

In the first statement, one can easily understand that the Total is the product of 2 variables

whereas; the VATRate was manually entered in the second statement creating ambiguity and a chance
that the VAT could be entered incorrectly.

Understand and use basic data types

Define and use different data types e.g. integer, real, boolean, character and string

A data type is a method of interpreting a pattern of bits.

Data types and data structures


Intrinsic data types
Intrinsic data types are the data types that are defined within a particular programming language.
There are numerous different data types. They are used to make the storage and processing of data easier
and more efficient. Different databases and programming systems have their own set of intrinsic data
types, but the main ones are:
Integer;
Real;
Boolean;
String;
Character;
Container

Page 4 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts

Integer
An integer is a positive or negative number that does not contain a fractional part. Integers are held in
pure binary for processing and storage. Note that some programming languages differentiate between
short and long integers (more bytes being used to store long integers).

Real
A real is a number that contains a decimal point. In many systems, real numbers are referred to as singles
and doubles, depending upon the number of bytes in which they are stored.

Boolean
A Boolean is a data-type that can store one of only two values – usually these values are True or False.
Booleans are stored in one byte – True being stored as 11111111 and False as 00000000.

String
A string is a series of alphanumeric characters enclosed in quotation marks. A string is sometimes just
referred to as ‘text’. Any type of alphabetic or numeric data can be stored as a string: “Birmingham City”,
“3/10/03” and “36.85” are all examples of strings. Each character within a string will be stored in one byte
using its ASCII code; modern systems might store each character in two bytes using its Unicode. The
maximum length of a string is limited only by the available memory.

Dates
In most computer systems dates are stored as a ‘serial’ number that equates to the number of seconds
since January 1st, 1904 (thus they also contain the time). Although the serial numbers are used for
processing purposes, the results are usually presented in one of several ‘standard’ date formats – for
example, dd/mm/yyyy, or dd MonthName, yyyy. Dates usually take 8 bytes of storage.

Notes:
if dates or numbers are stored as strings then they will not be sorted correctly; they will be sorted
according to the ASCII codes of the characters – “23” will be placed before “9”;
Telephone numbers must be stored as strings or the leading zero will be lost.

Character
A character is any letter, number, punctuation mark or space, which takes up a single unit of storage
(usually a byte).

Page 5 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Comparison of the common data types:

Program construct in Basic:

1.1) Counting
Counting in 1s is quite simple; use of the statement count = count + 1 will enable counting to be done (e.g. in
controlling a repeat loop).
The statement literally means: the (new) count = the (old) count + 1

It is possible to count in any increments just by altering the numerical value in the statement (e.g. count = count – 1)
will counts backwards.

1.2) Totaling
To add up a series numbers the following type of statement should be used:

total = total + number

This literally means (new) total = (old) total + value of number


| 10 x = 1 |
| 20 sum = 0 |
| 30 print x |
| 40 input "enter a number";n |
| 50 sum = sum + n |
| 60 x = x + 1 |
| 70 if x < 11 then goto 30 |
| 80 print "The sum of the numbers you gave is";sum |

Page 6 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Sequence: Execution of the program usually following the order in which the steps are written.

Selection: A decision between alternative routes through the program that involves at least one condition.

Repetition: A step or sequence of steps repeated within the program as an iteration or loop.

The structure of procedural programs

Statement, subroutine, procedure, function, parameter, loop

Procedural programs are ones in which instructions are executed in the order defined by the programmer.

Procedural languages are often referred to as third generation languages and include FORTRAN, ALGOL,
COBOL, BASIC, and PASCAL.

Statement
A statement is a single instruction in a program, which can be converted into machine code and executed.

In most languages a statement is written on a single line, but some languages allow multiple lines for
single statements.

Examples of statements are:

DIM name As String


A=X*X
While x < 10

Procedure
A procedure is a subroutine that performs a specific task without returning a value to the part of the
program from which it was called.

Function
A function is a subroutine that performs a specific task and returns a value to the part of the program
from which it was called.

Note that a function is ‘called’ by writing it on the right hand side of an assignment statement.

Page 7 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Parameter
A parameter is a value that is ‘received’ in a subroutine (procedure or function).

The subroutine uses the value of the parameter within its execution. The action of the subroutine will be
different depending upon the parameters that it is passed.

Parameters are placed in parenthesis after the subroutine name. For example:
Square (5) ‘passes the parameter 5 – returns 25
Square (8) ‘passes the parameter 8 – returns 64

Square(x) ‘passes the value of the variable x


Understand, create and use subroutines (procedures and functions), including the passing of parameters
and the appropriate use of the return value of functions

Use subroutines to modularize the solution to a problem

Subroutine/sub-program
A subroutine is a self-contained section of program code which performs a specific task and is referenced
by a name.
A subroutine resembles a standard program in that it will contain its own local variables, data types, labels
and constant declarations.

There are two types of subroutine. These are procedures and functions.

Procedures are subroutines that input, output or manipulate data in some way
Functions are subroutines that return a value to the main program.

A subroutine is executed whenever its name is encountered in the executable part of the main program.
The execution of a subroutine by referencing its name in the main program is termed ‘calling’ the
subroutine.

The advantage of using procedures and functions are that:


The same lines of code are re-used whenever they are needed – they do not have to be repeated in
different sections of the program.
A procedure or function can be tested/improved/rewritten independently of other procedures or
functions.
It is easy to share procedures and functions with other programs – they can be incorporated into
library files which are then ‘linked’ to the main program;

A programmer can create their own routines that can be called in the same way as any built-in
command.

Page 8 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Sub Statement (Visual Basic)
Declares the name, parameters, and code that define a Sub procedure. 0T 0T31 0T31 0T

Sub name [ (Of typeparamlist) ] [ (parameterlist) ]


[ statements ]
[ Exit Sub ]
[ statements ]
End Sub

All executable code must be inside a procedure. Use a Sub procedure when you don't want to return a value to the
0T 0T31 0T31 0T

calling code. Use a Function procedure when you want to return a value.
0T 0T31 0T31 0T

Sample Code:

Sub computeArea(ByVal length As Double, ByVal width As Double)


' Declare local variable.
Dim area As Double
If length = 0 Or width = 0 Then
' If either argument = 0 then exit Sub immediately.
Exit Sub
End If
' Calculate area of rectangle.
area = length * width
' Print area to Immediate window.
Debug.WriteLine(area)
End Sub

Function Statement (Visual Basic)


Declares the name, parameters, and code that define a Function procedure.

Function name [ (Of typeparamlist) ] [ (parameterlist) ] [ As returntype ]


[ statements ]
[ Exit Function ]
[ statements ]
End Function

Sample Code:

Function myFunction(ByVal j As Integer) As Double


Return 3.87 * j
End Function

Page 9 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Convert following pseudocode into programs using any high level language:

The following five examples use the above pseudocode terms. These are the same problems discussed in
section 3.1 using flow charts – both methods are acceptable ways of representing an algorithm.

2.1 Example 1
A town contains 5000 houses. Each house owner must pay tax based on the value of the house. Houses
over $200 000 pay 2% of their value in tax, houses over $100 000 pay 1.5% of their value in tax and houses
over $50 000 pay 1% of their value in tax. All others pay no tax.
Write an algorithm to solve the problem using pseudocode.

for count  1 to 5000


input house
if house > 50 000 then tax  house * 0.01
else if house > 100 000 then tax  house * 0.015
else if house > 200 000 then tax  house * 0.02
else tax  0
print tax
next

For example,
count  0
while count < 5001
input house
if house > 50000 then tax  house * 0.01
else if house > 100 000 then tax  house * 0.015
else if house > 200 000 then tax  house * 0.02
else tax  0
endif
endif
endif
print tax
count = count + 1
endwhile

EXERCISE: Re-write the above algorithm using a repeat loop and modify the if … then … else statements to include
both parts of the house price range.
(e.g. if house > 50000 and house <= 100000 then tax = house * 0.01)

Page 10 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts

2.2 Example 2
The following formula is used to calculate n: n = x * x/(1 – x)
The value x = 0 is used to stop the algorithm. The calculation is repeated using values of x until the value x
= 0 is input. There is also a need to check for error conditions. The values of n and x should be output.

Write an algorithm to show this repeated calculation using pseudocode.

NOTE: It is much easier in this example to input x first and then loop round doing the calculation until
eventually x = 0. Because of this, it would be necessary to input x twice (i.e. inside the loop and outside the
loop). If input x occurred only once it would lead to a more complicated algorithm.

(Also note in the algorithm that <> is used to represent ≠ ).

A while loop is used here, but a repeat loop would work just as well.

input x
while x <> 0 do
if x = 1 then print “error”
else n = (x * x)/(1 – x)
print n, x
endif
input x
endwhile

2.3 Example 3
Write an algorithm using pseudocode which takes temperatures input over a 100 day period (once per day) and
output the number of days when the temperature was below 20C and the number of days when the temperature was
20C or above.

(NOTE: since the number of inputs is known, a for … to loop can be used. However, a while loop or a repeat loop
would work just as well).

total1 = 0 : total2 = 0
for days = 1 to 100
input temperature
if temperature < 20 then total1 = total1 + 1
else total2 = total2 + 1
endif
next
print total1, total2

Page 11 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


This is a good example of an algorithm that could be written using the case construct rather than if … then … else.
The following section of code replaces the statements if temperature < 20 then …… endif:
case temperature of
1: total1 = total1 + 1
2: total2 = total2 + 1
endcase

2.4 Example 4
Write an algorithm using pseudocode which:

inputs the top speeds of 5000 cars


outputs the fastest speed and the slowest speed
outputs the average speed of all the 5000 cars

(NOTE: Again since the actual number of data items to be input is known any one of the three loop
structures could be used. It is necessary to set values for the fastest (usually set at zero) and the slowest
(usually set at an unusually high value) so that each input can be compared. Every time a value is input
which > the value stored in fastest then this input value replaces the existing value in fastest; and similarly
for slowest).

fastest = 0: count = 0
slowest = 1000
repeat
input top_speed
total = total + top_speed
if top_speed > fastest then fastest = top_speed
if top_speed < slowest then slowest = top_speed
endif
endif
count + count + 1
until count = 5000
average = total * 100/5000
print fastest, slowest, average

Page 12 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


2.5 Example 5
A shop sells books, maps and magazines. Each item is identified by a unique 4 – digit code. All books
have a code starting with a 1, all maps have a code starting with a 2 and all magazines have a code
beginning with a 3. The code 9999 is used to end the program.

Write an algorithm using pseudocode which input the codes for all items in stock and outputs the number
of books, maps and magazine in stock. Include any validation checks necessary.

(NOTE: A 4-digit code implies all books have a code lying between 1000 and 1999, all maps have a code
lying between 2000 and 2999 and all magazines a code lying between 3000 and 3999. Anything outside
this range is an error)

books = 0: maps = 0: mags = 0


repeat
input code
if code > 999 and code < 2000 then books = books + 1
else if code > 1999 and code < 3000 then maps = maps + 1
else if code > 2999 and code < 4000 then mags = mags + 1
else print “error in input”
endif:endif:endif
until code = 9999
print books, maps, mags

(NOTE: A function called INT(X) is useful in questions like this. This returns the integer (whole number)
part of X e.g. if X = 1.657 then INT(X) = 1; if X = 6.014 then INT(X) = 6 etc. Using this function allows us to
use the case statement to answer this question:

books = 0: maps = 0: mags = 0


repeat
input code
x = INT(code/1000) * divides code by 1000 to give a
case x of * number between 0 and 9
1: books = books + 1
2: maps = maps + 1
3: mags = mags + 1
otherwise print “error”
endcase
until code = 9999
print books, maps, mags

(This is probably a more elegant but more complex solution to the problem)

Page 13 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


Questions:

May/June 2006 P1
(a) Give two benefits of using a high-level language for writing programs. [2]
(b) State one type of program that would be written in a low-level language rather than a high-level
language and give a reason why. [2]

Oct/Nov 2007 P1
Give two differences between high level languages and low level languages.

Oct/Nov 2009 P1
Give two advantages of using high level languages when writing new computer software rather than using
low level languages

May/June 2010 P11


10 (a) Compilers and interpreters translate high-level languages. Give two differences between compilers
and interpreters.
(b) Programs can be written using high-level or low-level languages.
Give one advantage of using each method.
High-level language advantage
Low-level language advantage
(c) What is meant by top-down design when developing new software?

May/June 2011 P12

1 h = 0
2 c = 0
3 REPEAT
4 READ x
5 IF x > h THEN x = h
6 c = c + 1
7 PRINT h
8 UNTIL c < 20
The above code is an example of a high-level language.
Give TWO features of a high-level language. [2]
(c) The code is to be interpreted rather than compiled.
Give ONE difference between these two methods. [1]

Page 14 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.1 Programming concepts


May/June 2012 P12

Look at these two pieces of code:

(a) Which of these pieces of code is written in a high-level language? [1]


(b) Give one benefit of writing code in a high-level language. [1]
(c) Give one benefit of writing code in a low-level language. [1]
(d) High-level languages can be compiled or interpreted.
Give two differences between a compiler and an interpreter. [2]

Page 15 of 15
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.2 Data structures; arrays


Define and use arrays (one- and two-dimensional) for solving simple problems (this should include
initializing arrays, reading data into arrays and performing a simple serial search on a one-dimensional
array)

A data structure is a collection of different data items that are stored together in a clearly defined way.
Two common data structures are arrays and records.

Array
U

An array is a data structure, which allows a set of items of identical data type to be stored together using
the same identifier name.

Arrays are declared in a similar way to standard variables, except that the array size and dimensions are
included. For example, the following declares an array that reserves five locations in memory and labels
these as ‘Names’:

DIM Names(4) As String

The five individual locations are Names(0), Names(1), Names(2), Names(3), Names(4).

Each data item is called an element of the array. To reference a particular element a programmer must
use the appropriate index. For example, the following statement assigns data to the 5th element:
P P

Names(4) = “John”

Arrays simplify the processing of similar data. An algorithm for getting five names from the user and
storing them in the array Names is shown below:

Dim Names(4) As String


Dim name As String

For i=0 to 4

Input name

Names(i)=name

Next i

Page 1 of 2
Computer Science 2210 (Notes)
Chapter: 2.2 Programming

Topic: 2.2.2 Data structures; arrays


One-dimensional arrays
A one-dimensional array is a data structure in which the array is declared using a single index and can be
visually represented as a list.

The following diagram shows the visual representation of the array Names(4):

Questions:
Write and test a program to complete the three tasks.

TASK 1
Input and store the names and marks for 30 students who have sat three computer science tests.
Test 1 is out of 20 marks, Test 2 is out of 25 marks, Test 3 is out of 35 marks. You must store the names
in a one-dimensional array and the marks and total score for each student in one-dimensional arrays. All
the marks must be validated on entry and any invalid marks rejected. You may assume that the students’
names are unique.

TASK 2
Calculate and store the total score for each student and calculate the average score for the whole class.
Output each student’s name followed by their total score, then output the average score for the class.

TASK 3
Select the student with the highest score and output their name and score.
Your program must include appropriate prompts for the entry of data. Error messages and other output
need to be set out clearly and understandably. All variables, constants and other identifiers must have
meaningful names. Each task must be fully tested.

Page 2 of 2
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases

A database is a way of storing information in a structured, logical way. They are used to collect and
organize information such as customer details for a business, medical records at a surgery, or stock items
at a warehouse.

Database content is easy to manage and information can be accessed and updated quickly and
efficiently. A database can store and handle vast amounts of data. A user can sort and search a database
to find any desired data.

Most databases have the following properties:

1. Tables
Data is stored in rows and columns (similar to a spreadsheet – the main difference is HOW the data is
organized). Each row in a table is called a record which is made up of a number of fields (columns in the
U U U U

table). The data type in the fields is usually either text, numeric or date/time. Most databases contain a
number of tables which are usually linked together in some way.

2. Records
A record is a collection of fields that contains data about a single object – it is a row within a table.

3. Fields
A field is a single category of data within a database, which appears in all the records of a table – it is a
column within a table.

Key fields
A key field is used to identify the records within a database. There are two types of keys:
Primary key;
Secondary key.

Primary key
U

The Primary key is a unique field that identifies a single record. This prevents any records from having
U

the same value.


Some ‘natural’ primary keys are:
CarRegistrationNumber;
ISBN – a 10-digit code that uniquely identifies a book;
MAC number – a 6-part number that uniquely identifies a network card
National Insurance Number – can uniquely identify employees of a company (not usable for
under 16s or for non-British nationalists!)
Secondary key
U

A Secondary key is a non-unique field, used in a search that does not always produce only one
matching record.

Some typical secondary keys are:


LastName;
PostCode;
DateOfBirth;

Page 1 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
The following terms are used to describe parts of a database:
Key Field

Record structure

Before setting up a database, the record structure must be decided to make better use of the memory and
backing store, and to make searching and report creation easier.
For example, a car showroom wants to record details of the cars it sells. Before setting up the database,
the following attributes need to be decided:

Field Name
Field type
Field size
Format
Input Mask
Validation Rule

Page 2 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
Record structure
Field name Field type Format
Registration number Alphanumeric Up to 7 characters - the key field
Make Alphanumeric Up to 15 characters
Model Alphanumeric Up to 15 characters
Date first registered Date DDMMYY
Price Currency Up to 5 numbers
Taxed Yes/No (Boolean) 1 character Y/N
Etc…

When designing a database it is important to choose the correct field type. This ensures that the data
stored is usable and it makes validation easier. For example, if the price paid for goods was stored in a
text field, then the database wouldn’t be able to add each individual figure to produce a total.

Page 3 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
Following is the list of common data types:

Page 4 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
Coding of data:

Any system will need to have data collected, entered and stored.

One method of storing data is to assign codes to it. This usually means shortening the original data in an
agreed manner. The agreement is between the users of the system. This coding scheme could be part of
the training of how to use the system, and it could also be documented within the system for new users.

If the coding is completely obvious then there is no such need for formal documentation. For example if a
field called 'Gender' has only two values 'M' and 'F'. It should be obvious from the field name that this
refers to Male and Female.
Example 1
Original data: Monday; Tuesday; Wednesday; Thursday; Friday

Coded data: Mon; Tues; Wed; Thurs; Fri


Example 2
Original data: Extra Large; Large; Medium; Small

Coded data: XL; L; M; S

Advantages of coding Disadvantages of coding

Data entry can be faster Coarsening of data

Data entry can be more accurate Meaning of data can be obscured

Validation can further improve accuracy Value judgments are difficult to code

Less storage space required If people don't know the code it can slow down
data entry

Faster searching for data If codes are complicated they might be entered
incorrectly

Coded data can be more secure if people don't know Might run out of code combinations
what it means

Page 5 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases

Estimate the size of a file from its structure and the number of records

The basic formula for estimating the size of a file is:

If we consider a file with 200 records, which stores the details of an organisation’s customers:

CUSTOMER(RefCode, Name, PostCode, Telephone, DoB, Age)

We can estimate the size of the record as follows:

Thus 200 records would require:

Note that to determine the maximum field length, an extreme case was considered and several bytes
added to play safe.

Page 6 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
Database Management System:

We have discussed the structure of a database as consisting of one or more tables, each of which
contains records and fields of various data types.

The next requirement is to have a system in place that can act upon that data as well as creating and
maintaining the database itself.

This is the role of the 'database management system' usually referred to as a DBMS.

A DBMS is an application designed to control all aspects of a database.

The DBMS will have a command language. This includes command statements for:

Creating an empty database


Deleting an entire database
Creating and deleting tables
Inserting new records into tables
Updating and deleting records
Being able to extract data sets
Being able to produce reports that summarizes the data
Being able to process the data to create new data

There are many database management systems that are either commercial products or free open source
applications.

Examples include
Name Comment
MySQL A very popular, free open source system, widely used on web sites
Access Included in some versions of the Microsoft Office suite
Base Part of the free Open Office suite
Oracle A multi-user enterprise level database management system. Widely
used in industry

Page 7 of 8
Computer Science 2210 (Notes)
Chapter: 2.3 Databases

Topic: Databases
Queries

Queries most commonly allow information to be retrieved from tables. Since the information is often
spread across several tables, queries allow it to be viewed as one single datasheet. They also allow
filtering so only the records required are seen. Queries can be either results seen directly on the screen or
the output to another form or report. Example of a query: (house > 200 000) OR (no_of_rooms < 4).

Points to note: (1) there are 10 records in this section of the database
(2) Each record has 4 fields
(3) Sample queries:
(Smallest size (microns) < 1) OR (Toxic = “yes”)
Would output records 4, 7, 8 and 9
(Largest size (microns) > 99) AND (Toxic = “no”)
Would output records 1, 2, 3, 6 and 10

The query should match up with the field titles to ensure a correct search is carried out. Search engines
on the Internet work in a similar way; the clever part is how the information is stored on the databases so
that the time to do the search (based on key words) and the effectiveness of the search itself results in a
very powerful and very useful tool.

Page 8 of 8

You might also like