Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
176 views244 pages

Olevels Computer Science Chapter 3

This document provides an overview of computer hardware, specifically focusing on CPU architecture and components. It discusses: 1) The central processing unit (CPU) and its main components - the control unit, arithmetic logic unit, and registers like the program counter, memory address register, and memory data register. 2) The von Neumann architecture model which introduced the concept of stored programs and a centralized processing/memory system. It described the basic flow of instructions and data through the CPU and memory. 3) The roles and purposes of the main components within the CPU, including describing read and write operations between registers and memory.

Uploaded by

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

Olevels Computer Science Chapter 3

This document provides an overview of computer hardware, specifically focusing on CPU architecture and components. It discusses: 1) The central processing unit (CPU) and its main components - the control unit, arithmetic logic unit, and registers like the program counter, memory address register, and memory data register. 2) The von Neumann architecture model which introduced the concept of stored programs and a centralized processing/memory system. It described the basic flow of instructions and data through the CPU and memory. 3) The roles and purposes of the main components within the CPU, including describing read and write operations between registers and memory.

Uploaded by

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

Hardware

(Chapter 3)
Syllabus Content:

1
Syllabus Content:

2
Syllabus Content:

3
Syllabus Content:

4
3 Hardware

3.1 | Computer Architecture


3.1.1 Central Processing Unit (CPU):
The central processing unit (CPU) processes instructions and data that are input into the
computer so that the result can be output.
The CPU (also known as microprocessor or processor) is central to all modern computer
systems including tablets & smartphones.
Microprocessor:
A microprocessor is a type of integrated circuit on a single chip.
The CPU (processor) consists of the following components:
Control Unit (CU)
Arithmetic & Logic Unit (ALU)
Registers & Buses

3.1.2 Von Neumann Architecture:


In early years, computers were not able to store programs until 1945; John von Neumann developed
the concept of the stored program computer, referred to as Von Neumann Architecture concept.
He designed 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 von Neumann architecture had the following main features:
The concept of a central processing unit (CPU or processor)
The CPU was able to access the memory directly
The computer memories could store programs as well as data
The stored programs were made up of instructions which could be executed in sequential
order.

5
The following diagram is a simple representation of von Neumann CPU architecture:

Components of the Central Processing Unit (CPU):


There are different purposes of components in a CPU, in a computer that has a Von Neumann
architecture. Those components include:

1) Units:
– arithmetic logic unit (ALU)
– control unit (CU) including system clock
2) Registers:
– program counter (PC)
– memory address register (MAR)
– memory data register (MDR) // memory buffer register (MBR)
– current instruction register (CIR)
– accumulator (ACC)
3) Buses:
– address bus
– data bus
– control bus

6
The Von Neumann model for a computer system has several components other than the CPU
and those within the CPU.
These components include:
1. Immediate Access Store (IAS)
2. Main Memory (RAM)
3. Input Device
4. Output Device
5. Secondary Storage Device

Immediate Access Store (IAS):


It temporarily holds data and instructions waiting to be processed after they are loaded from
the main memory.
It is used because read/write operations carried out using the IAS are considerably faster and
so any key data needed by an application will be stored temporarily in IAS to speed up
operations.
The Immediate Access Store (IAS) is another name for primary main memory (RAM).

Main Memory (RAM):


What is main memory and how it is used in the Von Neumann model for a computer system:
The main memory means the primary memory or RAM.
It is a volatile memory.
It is used to hold data/instructions that are currently in use.
It is directly accessed by the central processing unit (CPU).
Stored Program Concept when applied to the Von Neumann Model:
The program is stored on a secondary storage device.
The data and instructions are moved to main memory/RAM.
The data and instructions are stored in the same memory/RAM.
The data and instructions are moved to registers to be executed.
The instructions are fetched and executed in a sequence, one after another..

Input & Output Devices:


It is used to allow interaction with the computer.
Input device allows data to be entered into a computer system (e.g. keyboard, touch screen
& microphone etc.).
Output device allows the user to view/hear the data that has been entered into a computer
system (e.g. printer, monitor & loudspeaker etc.).

7
The main components of the CPU (processor) are the arithmetic logic unit (ALU), the control unit
(CU) and the system clock.

Units:
Arithmetic & Logic Unit (ALU):
It is the component within the CPU that carries out calculations.
It performs arithmetic operations such as addition, subtraction, multiplication, division and
logical operations/comparisons such as AND, OR, NOT etc.
It holds temporary values during calculations in a register called the accumulator (ACC).

Control Unit (CU):


It is the component within the CPU that controls the flow of data and manages operations
between the components of the CPU (processor).
It sends/receives control signals that manage the transfer of data and execution of
instructions within the CPU.
It decodes an instruction using an instruction set.
It fetches instructions from memory, decodes them and synchronizes the operations before
sending signals to other components of the computer telling them “what to do”.
A system clock is used to generate the timing signals on the control bus to synchronize all
the components on the motherboard.
It controls the operations of memory, processor, and input/output.

Registers:
A register is a small piece of fast memory.
It is a temporary storage of data and instructions which is about to be or has been processed.
It is part of the processor.
A register can be general or special purpose.

Special Purpose Registers:

Memory Address Register (MAR):


It holds the address of the next/current instruction to be fetched/processed.
It holds the memory address of where the data needs to be stored.
It uses the address bus to send an address to another component.

Memory Data/Buffer Register (MDR):


It holds data or an instruction that are in use and has been fetched from the memory/the
address stored in MAR.
It is temporary storage of data between the CPU and primary memory.

8
Program Counter (PC):
It holds the address of the next/current instruction to be fetched/processed/executed.
It uses the address bus to send an address to another component.
It increments to point to the address of the next instruction to be fetched and so stores the
number of processes that have been completed.

Current Instruction Register (CIR):


It holds the data received from the MDR.
It holds the current instruction that is to be executed/being processed.

Accumulator (ACC):
It is built into the arithmetic logic unit (ALU).
It temporarily holds the result of a calculation OR temporarily holds the data that is currently
being used in a calculation.

Memory:
The computer memory is made up of a number of partitions; each consisting of an address
and its contents.
The address uniquely identifies each location in the memory and the content is the binary
value stored in each location.

The following is a section of computer memory:

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

9
Let us now consider two examples of how the MAR & MDR registers can be used when carrying out
a read and write operation to and from memory:

READ & WRITE Operations:


READ operation:

We will use the memory section shown below. Suppose we want to READ the contents of
memory location 1111 0001. We will use this address and its content:

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

The address of location 1111 0001 to be READ from is first WRITTEN into the MAR (memory
address register):

MAR 1 1 1 1 0 0 0 1

A read signal is sent to the computer memory using the control bus.
Then the contents of the memory location 1111 0001 are put into the MDR (memory data
register):

MDR 0 1 0 1 1 0 1 1

10
WRITE operation:

We will again use the memory section shown below. Suppose we want to show how the value
1001 0101 was WRITTEN into the memory location 1111 1101.

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

The data to be stored is first WRITTEN into MDR (memory data register):

MDR 1 0 0 1 0 1 0 1

This data has to be WRITTEN into memory location with the address 1111 1101; so, this
address is now written into MAR (memory address register):

MAR 1 1 1 1 1 1 0 1

Finally, a write signal is sent to the computer memory using the control bus and the value
1001 0101 will then be written into the correct memory location.

11
Examination Question Tips:
The examiner will give you a table of memory section like the ones above.
You will be asked to perform either READ or WRITE or maybe both operations.

In the part of READ operation:


The examiner will tell you that the content of a memory location e.g. 1111 0000 is to be READ
and then ask you to show contents of MAR and MDR during this READ operation.
There will be two registers given to you, one for MAR and one for MDR.
Now you simply have to write the address which is to be read e.g. 1111 0000 in the MAR
register.
The content value given in the table at this address will be simply copied and written into the
MDR register.

In the part of WRITE operation:


The examiner will tell you that the value e.g. 1100 1100 is to be written into memory location
e.g. 0011 1111 and then again ask you to show contents of MAR and MDR during this WRITE
operation.
There will be two registers given to you, one for MAR and one for MDR.
Now you simply have to write the value (content) which is to be written e.g. 1100 1100 in the
MDR register.
The memory location in which this value is to be written e.g. 0011 1111 will be simply written
in MAR register.

In the end:
The examiner may ask you to state or show any changes to the memory following the read
and write operations.
In this case, just look at the table of memory sections. Look at the two addresses used in both
parts of the questions.
If you find that any address has the value of its content missing, just state that value over
there which was given to you in any of the both parts depending upon which parts content
value is missing.

12
Exam Style Questions:
Question 1:

13
14
Answer:

15
Question 2:

Answer:

(a)(i) 10010
(a)(ii) 11110001

16
The following diagram shows how buses are used to connect the CPU to the memory and to
input/output devices:

Buses:
They are used to connect together the internal components of the CPU and provide a pathway
for transmitting data and instructions.
The data, address and control buses connect the processor, memory, and I/O controllers.
They essentially move data around the computer and send out control signals to ensure
everything is properly synchronized.

There are three common buses used in the Von Neumann architecture given below:
Address Bus:
It is a unidirectional bus (signals travel in one direction only).
It carries signals relating to addresses between the CPU/processor and the memory of the
next item to be fetched.

Width of Address Bus:

The width of the address bus determines the number of directly accessible memory locations.
Increasing the width of address bus significantly increases the number of directly
accessible/addressable memory locations.

17
Benefit of increasing the address bus width from 16 bits to 32 bits:

A bus width of 16 bits can address 216 memory locations whereas a bus width of 32 bits allows
232 memory locations to be simultaneously accessed.

Data Bus:
It is a bi-directional bus (data can travel in both directions).
It sends data between the processor, the memory unit and the input/output devices that is
currently being processed.
The data can be an address, an instruction, or a numerical value.

Width of Data Bus:

The width of the data bus determines the number of bits that can be simultaneously
transferred.
Increasing the width of data bus increases the number of bits/amount of data that can be
moved at one time.
It improves processing speed and computer performance as fewer transfers are needed.
For example, double the width of the data bus moves 2x data per clock pulse.

Control Bus:
It is a bi-directional bus (signals can travel in both directions).
It carries control signals around the CPU and transmits timing signals to control all the
components.
It carries signals to synchronize the fetch-execute cycle.

It is usually 8-bits wide as there is no need for it to be any wider since it only carries control signals.

18
Fetch–Decode–Execute Cycle:
The processor firstly fetches some data and instructions from memory and stores them in
suitable registers.
Both the address bus and data bus are used in this process.
Each instruction is then decoded before finally being executed.
This is known as the Fetch–Decode–Execute cycle.
To process an instruction, a central processing unit (CPU) goes through a cycle that has three
main stages:
Stage 1 → Fetch
Stage 2 → Decode
Stage 3 → Execute
How an instruction is fetched in a computer based on the Von Neumann model:
The program counter (PC) holds the address of the instruction.
The address held in the program counter (PC) is sent to memory address register (MAR).
The address is sent using the address bus.
The program counter (PC) is incremented.
The instruction is sent from the address in memory to memory data register (MDR).
The instruction is transferred using the data bus.
The instruction is sent to the current instruction register (CIR).
The component of the CPU that is responsible for decoding instructions:
Control Unit (CU)
How an instruction is executed in a computer based on the Von Neumann model:
The CPU passes the decoded instruction as a set of control signals using the control bus to
the appropriate components within the computer system.
This allows each instruction to be carried out in its logical sequence.

19
The following diagram shows how the Fetch–Decode–Execute cycle is carried out in the Von
Neumann computer model:

20
Exam Style Questions:
Question 1:

21
Answer:

Question 2:

22
Answer:

Question 3:

23
Answer:

Question 4:

Answer:

24
Question 5:

25
Answer:

Question 6:

26
Answer:

Question 7:

27
Answer:

Question 8:

28
Answer:

Question 9:

29
Answer:

30
Question 10:

31
Answer:

32
3.1.3 Core, Cache & Clock:

NOTE: Core, Cache, & Clock are newly added topics in the Computer Science (2210)
syllabus for the session 2023–2025.

We need to understand the meaning of the core, cache, and clock in a CPU. The number of cores,
size of the cache and speed of the clock can affect the performance of a CPU.

System Clock:
The control unit sends the signals on the control bus to coordinate events based on the pulses
of the system clock.
The system clock generates the timing signals and clock pulses are used to synchronize all
components on the motherboard.
It determines the number of cycles the CPU can execute per second as the clock sends out a
number of pulses in a given time interval (clock speed).
Clock Speed:
It is a factor that affects the performance of a PC.
Each instruction is executed on a clock pulse e.g., one F-E cycle is run on each clock pulse.
So, the clock speed dictates the number of instructions that can be run per second.
Increasing the clock speed increases the number of instructions/number of fetch-execute
cycles that can be run per second.
The higher the clock frequency, the shorter the execution time for the instruction so
increasing the clock frequency improves performance.

However, there is a limit on clock speed because the heat generated by higher clock speeds
cannot be removed fast enough.

Overclocking: The clock speed can be changed by accessing the BIOS (Basic Input/Output
System) and altering the settings.

Using clock speed higher than the computer was designed for can lead to problems, such as:

1. The execution of instructions outside design limits, which can lead to seriously
unsynchronized operations (in other words, an instruction is unable to complete in time
before the next one is due to be executed) and the computer would frequently crash
and become unstable.
2. It can cause serious overheating of the CPU leading to unreliable performance.

33
Computer Performance:
As discussed earlier, by increasing the clock speed the processing speed of the computer is also
increased. However, it is not possible to say that a computer’s overall performance is necessarily
increased by using a higher clock speed.

Four other factors need to be considered:

1. The width of the address bus and data bus can affect computer performance.

Increasing the width of buses allows more memory locations to be directly accessed and
allows the transfer of more data per clock pulse. It improves processing speed and computer
performance.

2. Overclocking: using a clock speed higher than the computer was designed for can lead
to problems, such as:

1) The execution of instructions outside design limits, which can lead to seriously
unsynchronized operations (in other words, an instruction is unable to complete in
time before the next one is due to be executed) and the computer would frequently
crash and become unstable
2) It can cause serious overheating of the CPU leading to unreliable performance.

3. The use of cache memory can also improve CPU performance.

Cache memory is located within the CPU, and it uses SRAM so cache memories will have
faster access times, since there is no need to keep refreshing, which slows down access time.
Cache memory stores frequently used instructions and data that need to be accessed faster.
The larger the cache memory size, the more frequency used instructions it can store for fast
access and better the CPU performance.

4. The use of a different number of cores can improve computer performance (one core
is made up of an ALU, a CU and the registers).

Many computers are dual core (the CPU is made up of two cores) or quad core (the CPU is
made up of four cores).
Each core processes one instruction per clock pulse. More/multiple cores mean that sequence
of instructions can be split between them and so more than one instruction is executed per
clock pulse and more sequence of instructions can be run at the same time.
Therefore, more cores decrease the time taken to complete task and improves CPU
performance.

34
Potential Problem:

However, doubling the number of cores does not necessarily double the computer’s
performance since CPU needs to communicate with each core and this will reduce overall
performance.
For example:
The dual core has one channel and needs the CPU to communicate with both cores
using one channel, reducing some of the potential increase in its performance.
The quad core has six channels and needs the CPU to communicate with all four cores
using six channels, considerably reducing potential performance.

Summary of factors affecting computer performance:

1. Clock Speed: higher clock speed means more Fetch—Decode—Execute cycles per second.
2. Number of Cores: more cores mean more instructions can be carried out simultaneously.
3. Bus Width: increasing width allows transfer of more data each time and allows more memory
location to be directly accessed.
4. Cache: the higher the capacity of cache memory, the more frequently used instructions it can
store for fast access.

35
Exam Style Questions:
Question 1:

Answer:

Question 2:

36
Answer:

Question 3:

37
Answer:

Question 4:

Answer:

38
Question 5:

Answer:

39
3.1.4 Instruction Set:

NOTE: Instruction Set is a newly added topic in the Computer Science (2210) syllabus for
the session 2023–2025.

An instruction set is a list of all the commands that can be processed by a CPU and the commands
are machine code.
The instructions are a set of operations which are decoded in a sequence by CPU using the sequence
of steps of Fetch–Decode–Execute cycle to process each instruction in sequence.
The Current Instruction Register (CIR) holds the op code and operand of an instruction ready for it
to be decoded.
Operations:
Each operation will instruct the Arithmetic Logic Unit (ALU) & Control Unit (CU) which are part
of the Central Processing Unit (CPU).
An operation is made up of an opcode & operand.
Some examples of instruction set operations include ADD, JMP, LDA, and so on.
Opcode & Operand:
The opcode informs the CPU what operation needs to be done.
The operand is the data which needs to be acted on or it can refer to a register in the memory.
Example of Instruction Set:
An example of an instruction set is the X86, a common CPU standard used in many modern
computers.
If the computer is based on the X86 CPU then all designs will share almost identical instruction
sets despite different electronic designs.
Differences between Program Code & Instruction Set:
The instruction set is machine code instructions that instruct the CPU about how to carry out
an operation.
The program code needs interpreters or compilers to convert the code into the instruction
set understood by the computer.
Therefore, instruction sets must not be confused with program code.

40
3.1.5 Embedded System:

NOTE: Embedded System is a newly added topic in the Computer Science (2210) syllabus
for the session 2023–2025.

An embedded system is used to perform a dedicated function.


It has a microprocessor/microcontroller within a larger system that performs one specific task.
These functions include domestic appliances, cars, security systems, lighting system or
vending machines.
An embedded system is different to a general purpose computer that is used to perform
many different functions, e.g. a personal computer (PC) or a laptop.
The embedded system is built into/integrated into the device and this enables operations to
be controlled in a more efficient way.
The devices such as cookers, refrigerators and central heating systems can now all be
activated by a web-enabled device (such as a mobile phone, computer or tablet).

Microcontroller:

This has a CPU in addition to some RAM and ROM and other peripherals all embedded onto
one single chip and together they can carry out a specific task.

Microprocessor:

It is an integrated/embedded circuit which only has a CPU on a one single chip.


It does not have RAM, ROM or other peripherals – these need to be added.

The following diagram summarizes how Embedded Systems work in general:

41
Working of Embedded Systems:
When an embedded system is installed in a device, either an operator can input data manually
(e.g., select a temperature from a keypad or turn a dial on an oven control panel) or the data
will come from an automatic source, such as a sensor.
This sensor input will be analogue or digital in nature (e.g. inputs such as oxygen levels or
fuel pressure in a car’s engine management system).
The output will then carry out the function of the embedded system by sending signals to
the components that are being controlled (e.g. increase the power to the heating elements
in an oven or reduce fuel levels in the engine).
The embedded system is dedicated to a specific set of tasks therefore engineers can optimize their
designs to reduce the physical size and cost of the devices.
Programming of Embedded Systems:
The embedded systems are either programmable or non-programmable depending on the device
in which they are used.
The non-programmable devices need to be replaced if they require a software upgrade.
The programmable devices allow upgrading by two methods:
1. Connecting the device to a computer and allowing the download of updates to the
software (e.g. this is used to update the maps on a GPS system used in a vehicle).
2. Automatic updates via a Wi-Fi, satellite or cellular (mobile phone network) link (e.g. many
modern cars allow updates to engine management systems and other components via
satellite link).
Controlling of Embedded Systems:
The embedded systems can be controlled remotely using a smartphone or computer due to
their internet connectivity.
The central heating system can be set to switch on or off while the user is away from home
and the set top box can be instructed remotely to record a television programme.

General Purpose Computers & Embedded Systems:


The personal computer (PC) and laptop is not an example of an embedded system.
An embedded system is used to perform a dedicated function/one specific task.
The computers/laptops are multi-functional that is they can carry out many different tasks
which can be varied by using different software and so they cannot be classified as embedded
systems.

42
Benefits & Drawbacks of Embedded Systems:
Benefits of Embedded Systems:
1. They are small in size and therefore easy to fit into devices.
2. They are relatively low cost to make.
3. They are usually dedicated to one task allowing simple interfaces and often no requirement
for an operating system.
4. They consume very little power.
5. They can be controlled remotely using a mobile phone.
6. They have a very fast reaction to changing input as they operate in real time and are feedback
orientated.
7. The mass production of embedded systems bring reliability.
Drawbacks of Embedded Systems:
1. It can be difficult to upgrade some devices to the latest technology.
2. The troubleshooting faults in the device becomes a specialist task.
3. The interface can appear to be more simple (e.g. a single knob) but in reality it can be more
confusing (e.g. changing the time on a cooker clock can require several steps).
4. They are always susceptible to cyber hacking & viruses as they are accessed over the internet.
5. The devices are often just thrown away rather than being repaired which is very wasteful due
to difficulty in upgrading and finding faults.
6. It can lead to an increase in the ‘throw away’ society if devices are discarded after they have
become out-of-date.

Applications of Embedded Systems:


The range of applications are vast, ranging from a single microcontroller (e.g. in an MP3 player) to a
complex array of multiple units (e.g. in a medical imaging system).

1) Cars:
The modern cars have many parts that rely on embedded systems to function correctly. The
following components are some of the many that are controlled in this way:
1. GPS system
2. Lane detection system
3. Airbags
4. In-car entertainment system
5. Fuel injection system
6. ABS braking
7. Vehicle security
8. Traction control
9. Exhaust emission

43
Lane Detection System:
This system monitors the lines on either side of the lane. If the car gets too close to one line,
the system automatically moves the car away from the line.
Why the lane detection system is an example of an Embedded System:
The lane detection system is built into/integrated into the car.
The lane detection system only performs one task.
The lane detection system is not easily changed/updated by the car owner.

2) Set-top Box:
It uses an embedded system to allow recording and playback of television programmes.
This can be operated remotely by the user when not at home using an internet-enabled
device or by using the interface panel when at home.
The embedded system will look after many of the functions involving inputs from a number
of sources such as a Solid State Device (SSD) or a satellite signal.
The SSD stores or retrieves television programmes.
The satellite signal will decode the incoming signal.
The following diagram shows the Embedded System found in a set-top box:

3) Security Systems:
The security code is set in RAM and the alarm is activated or deactivated using the keypad.
The data from the sensors is sent to the controller which checks against values stored on the
SSD (these settings are on SSD rather than RAM in case the sensitivity needs to be adjusted).
An output can be a signal to flash lights, sound an alarm or send a message to the user via
their mobile phone.
The user can also interface with the system remotely if necessary.

44
The following diagram shows the Embedded Systems used in many security devices:

4) Lighting Systems:
The embedded systems are used in modern sophisticated lighting systems. We will consider the
lighting system used in a large office.
The system needs to control the lighting according to:
1. The time of the day or day of the week:
The time of the day or day of the week is important data in an office environment since energy
is saved if the system switches to low lighting levels when unoccupied.

2. Whether the room is occupied or empty:


If there is movement in the office then correct lighting levels be automatically restored.

3. The brightness of the natural light:


On a very bright sunny day, the system could automatically dim the lights, only increasing the
light output if natural light levels fall below a set value.

An embedded system can automatically control the lighting using a number of inputs (such as light
sensors) and key data stored in memory.
There are many internal and external lighting systems that could be controlled by embedded
system such as fountain light display or a light show on a building to celebrate a special
occasion.
They are also used to trigger emergency lighting.
Lighting Bulbs:
Some lighting systems use Bluetooth light bulbs.
This allows the embedded system to control each bulb independently.
Many of the bulbs available today use LEDs and many come in a number of colors to change
the mood.

45
5) Vending Systems:
The vending machines usually use microcontrollers to control a number of functions that are
associated with them.
The following diagram shows the Embedded Systems used in a vending machine:

The embedded system is in the form of a microcontroller.


The inputs to this system come from the keypad (item selection) and from sensors (used to
count the coins inserted by the customer, the temperature inside the machine and a ‘tilt
sensor’ for security purposes).
The outputs are:
1) The actuators to operate the motors, which control the helixes (coil) to give the customers
their selected items.
2) The signals to operate the cooling system if the temperature is too high.
3) The item description and any change due is shown on an LCD display panel.
4) The data sent back to the vending machine company so that they can remotely check sales
activity including the instructions to refill the machine without having to visit each machine.

46
All of this is controlled by an embedded system which makes the whole operation automatic but
also gives immediate sales analysis which would otherwise be very time consuming.

6) Washing Machines:
Many large electrical goods used domestically such as refrigerators, washing machines,
microwave ovens, and so on (called white goods) are controlled by embedded systems.
They all come with a keypad or dials that are used to select the temperature, wash cycle or
cooking duration.
This data forms the input to the embedded system, which then carries out the required task
without any further human intervention.
These devices can also be operated remotely using an internet-enabled smartphone or
computer.
Meaning of an Embedded System using the washing machine as an example:
An embedded system in washing machine only controls the programs for the washing cycle.
It is part of the washing machine but does not perform any other function within it.
The washing machine’s embedded system makes use of both Random Access Memory (RAM)
and Read Only Memory (ROM).
Purpose of RAM within the washing machine’s Embedded System:
1. It stores the choices/wash program the user has entered.
2. It stores the data read from the sensors.
3. It stores the time left in the program
Purpose of ROM within the washing machine’s Embedded System:
1. It stores the start-up instructions for the washing cycles.

47
Exam Style Questions:
Question 1:

48
Answer:

Question 2:

49
Answer:

50
3 Hardware

3.2 | Input & Output Devices


3.2.1 Input Devices:
A device that allows the data to be entered into a computer system.
The input devices included in our syllabus are:

1. barcode scanner
2. digital camera
3. keyboard
4. microphone
5. optical mouse
6. QR code scanner
7. touch screen (resistive, capacitive & infra-red)
8. two-dimensional (2D) scanner
9. three-dimensional (3D) scanner

51
Barcode Scanners (Readers):
They are automatic data capture devices which means that they can save and collect data with no
actual need for human interaction. They can often be built into an Electronic Point of Sale (EPOS)
terminal, for example, a supermarket checkout.

Barcode Scanners Barcodes

The barcodes are a series of vertical black and white parallel lines with varying thicknesses.
The barcode is one-dimensional (1D).
The digits from 0 to 9 are each represented by a unique series of lines.
The normal barcodes can hold up to 30 digits.
The actual left-hand and right-hand sides of the barcode are separated using guard bars.

Remember:
The width of lines representing each digit is the same, thus speed of scanning is also same.
The arrangement of bars on left and right side allows a barcode to be scanned in any
direction.

How Barcode is read:


A barcode reader/scanner is used.
The reader shines a red laser or red LED at barcode.
The light is reflected back off the barcode (black lines reflect little or no light at all and hence,
the black and white areas are determined).
The reflected light is read by sensors (photoelectric cells).
As the laser or red LED light is scanned across the barcode, it generates a black-and-white
pattern due to different reflections.
The different reflections pattern is then converted to different binary values.
A microprocessor then interprets the data, and it uses check digit error checking method.

52
Binary values of:
Binary value of light area = 0
Binary value of dark area = 1

Binary numbers that would be produced from this Barcode:

Binary Number A Binary Number B

Binary Number A = 1 1 1 0 0 1 0 Binary Number B = 1 0 0 1 1 1 0

How the Barcode system could help the supermarket manage its stock:
The barcode can be used to look up product in a stock database.
The data about stock levels can be stored on a system.
The stock levels for the product can be automatically deducted from the system.
The stock can be automatically re-ordered if at or below a certain level.
A flag is put to stop re-ordering every time until the stock has arrived and when the stock is
re-ordered, the flag is reset.
It automatically updates the new stock level in the database once the new stock items arrive.

How the price of the product is found using Barcode at a supermarket checkout:

The database stores data about barcodes, products & prices.


The barcode value is transmitted to the database system and searched in the database.
The price is found and then displayed.

How the stock control system automatically keeps the stock levels above a minimum level:
The stock control system has a database of stock items.
Each product has a unique barcode.
The barcode is scanned, and the product is looked up in a database.
The stock levels for the product are reduced by 1.
The stock is checked against the minimum level.
If the stock is at or below the minimum level, an order is placed.
A flag is put to stop re-ordering every time until the stock has arrived.
When the stock is re-ordered, the flag is reset.

53
Advantages of Barcodes to the management:
1. It is easier and faster to change the price on stock items.
2. It provides more updated sales information.
3. There is no need to price every stock item on the shelves (which saves time and cost).
4. It allows for automatic stock control.
5. It is possible to analyze customer buying habits more easily by linking barcodes to loyalty
cards.

Advantages of Barcodes to the customers:


1. The queues are faster as the staff doesn’t need to remember prices.
2. The errors in charging customers are reduced.
3. The customer is given an itemized bill.
4. The cost savings can be passed on to the customer.
5. It allows a better track of ‘sales-by-dates’; so, food should be fresher.

Input and output devices found at the checkout in supermarkets along with Barcode Scanners:

Input/output device How it is used

Keypad To key in the number of same items bought; to key in a weight.

Screen/monitor To show the cost of an item and other information.

To make a beeping sound every time a barcode is read correctly; or


Speaker
another sound if there is an error when reading the barcode.

Printer To print out a receipt/bill.

Magnetic stripe reader To read the customer’s credit/debit card.

Touchscreen To select items by touching an icon; or to select payment method.

54
Applications of Barcode Scanners:

1) Barcode scanners are used in supermarket checkouts:


They are used to find the prices and descriptions.
They allow for automatic stock control.

2) Barcode scanners are used in library systems:


They can track books on loan.
They allow for linking books to borrowers using barcoded cards.

3) Barcode scanners are used at airport check-ins:


They are placed on luggage to track its whereabouts.

Benefits of using Barcodes:


1. It is quicker to scan rather than type into a system.
2. There are fewer errors as no human input is required.

55
Quick Response (QR) Codes:

QR Codes

It is another type of barcode.


It is two-dimensional (2D) and contain squares.
It is made up of a matrix of filled-in dark squares on a light background.
These codes can hold up to 7000 digits.
The QR code can be read from any angle and are faster to scan.
These codes are more error tolerant.
Working of QR codes:
The Quick Response (QR) code is scanned using a camera on a mobile device.
It is then processed by an appropriate QR code reading application on the phone.
The three large squares are used for alignment & the corners of code are used for orientation.
It uses position and alignment markers for orientation when scanning.
The squares reflect light differently; black squares reflect less light than white squares which
enables the squares to be read.
Each small square is converted to a binary value.
The data is then decoded.
The user is redirected to a specific web page or opens a document.
The QR code can be saved for future reference.
Uses of QR codes:
1. These are used for redirecting devices to specific web pages after these codes are scanned.
2. They are used in shopping malls and on public transport for advertising products.
3. They are used in giving automatic access to a website or contact telephone number.
4. They are used for storing boarding passes electronically at airports and train stations.

56
Benefits of QR codes:
1. There is no need for the user to manually write down or key in a website address; scanning
the QR code does this automatically.
2. QR codes can store website addresses/URLs that appear in magazines, trains, buses or even
on business cards, giving a very effective method of advertising.
Advantages of QR codes compared to traditional Barcodes:
1. They can hold much more data/information.
2. The QR codes are more error tolerant as the higher capacity of the QR code allows the use of
built-in error-checking systems.
3. The QR code can be read from any angle whereas some barcode readers have to be lined up
with the barcode.
4. The QR codes are faster to scan than barcodes.
5. The QR codes are easier to read as they don’t need expensive laser or LED scanners like
barcodes because they can be read by the cameras on smartphones or tablets.
6. It is easy to transmit QR codes either as text messages or images.
7. It is also possible to encrypt QR codes which gives them greater protection than traditional
barcodes.
Disadvantages of QR codes compared to traditional Barcodes:
1. There is more than one QR format available.
2. QR codes can be used to transmit malicious code known as attagging.
It is relatively easy to write malicious code and embed this within the QR code as there are a
large number of free apps available to any user for generating QR code.
When the code is scanned, it is possible the creator of the malicious code could gain access
to everything on user’s phones such as photographs, stored passwords, address book and so
on.
The user could also be sent to a fake website or even a virus could be downloaded.
The QR code is scanned at the entrance to the venue. A person can only enter the venue with
a valid QR code that allows entry. When a person enters, a count is incremented to show how
many people have entered the venue.
How the system scans the QR code, checks if a person can enter and counts how many people
have entered:
The Quick Response (QR) code is scanned using a camera on a mobile device.
The three large squares are used for alignment & the corners of code are used for orientation.
The squares reflect light differently; black squares reflect less light than white squares which
enables the squares to be read.
Each small square is converted to a binary value and digital data is sent to microprocessor.
There is a database of valid QR codes and data is compared to stored values of valid QR
codes.
If the data matches, entry is granted is raised and count is incremented.
If data does not match, entry is denied.

57
Differences between a Barcode and a Quick Response (QR) code:
1. The barcode is one-dimensional (1D) and QR code is two-dimensional (2D).
2. The barcodes contain vertical lines and QR codes contain squares.
3. The QR code can hold more data than a barcode.
4. The QR code can be read from any angle whereas some barcode readers have to be lined up
with the barcode.
5. The QR codes are more error tolerant and faster to scan than barcodes.
6. The barcodes are frequently used at checkouts/libraries whereas QR codes are used for
advertising or frequently used by mobile phones to obtain certain information.

Frame QR Codes:
The newer codes called frame QR codes are now being used because of the increased ability
to add advertising logo.
The frame QR codes come with a canvas area where it is possible to include graphics or
images inside the code itself.
Unlike normal QR codes, software to do this is not usually free.

Frame QR Codes

58
Digital Cameras:

Digital Cameras

A digital camera is similar to a traditional film-based camera, but it captures images digitally.
When you take a picture with a digital camera, the image is recorded by a sensor, called a
charged coupled device (CCD).
Some digital cameras have built-in memory, but most use an SD or Compact Flash card.

Linkage of Digital Cameras:


Modern digital cameras simply link to a computer system via a USB port or by using
Bluetooth.

Working of Digital Cameras:


A button is pushed to take a photograph.
An aperture opens at the front of the camera to allow light to stream in through the lens.
This is captured by a sensor called a charge-coupled device.
The analogue-to-digital converter then converts each pixel into a digital binary value.
The number of pixels determines the size of the file used to store the photograph.

How the images captured by the camera are converted to digital photo files.
The image is converted from analogue to digital using ADC (analogue-to-digital converter).
It is then turned into pixels.
Each pixel is given a binary value and has a color.
The pixels form a grid to create the image.
The pixels are then stored in sequence in a file.
It is stored in a suitable photo file format e.g. JPEG.

59
Uses of Digital Cameras:
1. The digital cameras are used for digital photographic art.
2. They are used to record a meeting or an event.
3. They are used to capture objects for presentation.
4. They are used for virtual reality tours of houses, shopping malls etc.:
Photos are taken from a single point and the camera is rotated around the room. The images
are "stitched" together using software, resized and configured for Internet use.
Advantages of Digital Cameras:
1. It requires no film processing.
2. It doesn't run out of film and saves the cost of buying film as well.
3. It allows seeing photographs instantaneously.
4. Digital camera won’t need manual emptying.

Functions of Digital Cameras:


These cameras are controlled by an embedded system which can automatically carry out the
following tasks:
1. Adjust the shutter speed.
2. Focus the image automatically.
3. Operate the flash automatically.
4. Adjust the aperture size.
5. Adjust the size of the image.
6. Remove 'red eye' when the flash has been used.

The quality of the photograph depends on factors such as:


1. The type of lens used (how good the camera lens is and how good the sensor array is).
2. The number of pixels (the more pixels used, the better the image).
3. The lighting/levels of light.
4. The storage format of image (JPEG, raw file and so on).

Pixels (picture element):


It is the smallest controllable element of a picture represented on the screen.

Advantages of buying a camera with a higher resolution:


1. It results in higher quality photos.
2. When the image is enlarged/magnified, it is less likely for photo to pixelate.

Disadvantages of buying a camera with a higher resolution:


1. It uses up more memory on the card.
2. It takes longer to upload or download a photo.
3. The file size will be greater.

60
Keyboards:

Keyboard Ergonomic Keyboard

Keyboards are by far the most common method used for data entry.
They are used as input devices on computers, tablets, mobile phones etc.

Connection of Keyboards:
The keyboard is connected to the computer by using USB connection or a wireless
connection.
The keyboard is virtual or type of touch screen technology in tablets and mobile phones.

Working of Keyboards:
A keyboard has a key matrix underneath the keys.
When a key is pressed, it presses a switch that completes a circuit.
This allows the current to flow.
The location of the key pressed is calculated.
The location of the key pressed is compared to a character map to find the binary value for
the key that has been pressed.
How key presses on a Keyboard are processed by the computer.
A matrix/membrane or a circuit board is present at the base of keys.
A key is pressed that presses a switch.
When a key is pressed it completes the circuit changing the current in it.
The location of the key pressed is calculated.
An index of characters is searched to find the corresponding key presses.
Each character has an ASCII value (which in turn has a binary value).
The binary value can then be processed by the CPU to action the key press.

Quite simply, each character on a keyboard has an ASCII value. Each character pressed on a keyboard
is converted into a digital signal, which the computer interprets.

61
Advantages of Keyboards:
1. It is the easiest way to enter text into a computer.

Disadvantages of Keyboards:
1. It is a relatively slow method of data entry hence takes a lot of time.
2. It is also prone to errors hence easier to make mistakes.

Possible injury & solution:


Frequent use of these devices can lead to injuries such as repetitive strain injury (RSI) in the
hands and wrist.
Ergonomic keyboard can help to overcome this problem as they have keys arranged
differently.
They are designed to provide more support to hands and wrist when doing a lot of typing.

Applications of Keyboards:
1. It is used for typing messages for communication (e.g. typing a mail).
2. It is used for using shortcuts in a computer system (e.g. pressing ALT and F4 together).
3. It is used for writing data manually in word processor, spreadsheet, database etc. for purposes
such as report writing.
4. It is used for keying in data manually in a control room interface for purposes such as flow
speed of liquid.

62
Concept Keyboard:

Concept Keyboard

A concept keyboard is a specialized keyboard with no preset keys.


It is a flat board that contains a grid of buttons.
Each button can be programmed with a wide range of different functions for the users to do
whatever they want.
An overlay sheet with pictures or symbols is placed on the grid so that the user can tell what
pressing on different areas will do.

A restaurant has a concept keyboard that is overlaid with images of food items available from
their menu. Staff can click on an image to add the food item to a customer order.
Benefits of using a concept keyboard:
1. It has fewer typing errors because only one button is pressed to order an item.
2. It speeds up the time to enter an order because fewer buttons are pressed to complete the
order.
3. It requires less training of staff because it is easier to identify an order item from its image
rather than typing it.

63
Microphones:

Microphones

A microphone, colloquially named mic is a device that converts sound into an electrical signal.
These are used to input sound into a computer for purposes such as:
1. Doing a ‘voice over’ in a presentation.
2. Part of a speech recognition system.
3. Part of a voice recognition system.
4. Enabling a disabled person to communicate with computer.
Connection of Microphones:
They are either built into the computer or external devices connected through USB
port/wireless connectivity.
Working of Microphones:
The microphone has a diaphragm.
The incoming sound waves cause vibrations of the diaphragm causing a coil to move past a
magnet.
The coil cuts through the magnetic field around the permanent magnet, producing an
electrical signal.
The electrical signal is then either amplified or sent to a recording device.
The electrical signal output from the microphone can also be sent to a computer where a
sound card converts the analogue current into a digital value using analogue-to-digital
converter (ADC) which can then be stored in the computer.

64
Advantages of Microphones:
1. It is faster to provide voice as input using microphone than to type text using keyboard.
2. Sound waves can be manipulated in real time.
3. It can help in improving safety and security of drivers and riders when used with voice
activation systems e.g. switching on radio, keeping phone in speaker mode etc.
4. They are inexpensive in general.
5. Most of the microphones tolerate extreme high sound pressure levels.
6. It does not require power supply except few.
Disadvantages of Microphones:
1. Sound files require large memory for storage for further processing and use.
2. Voice recognition software is not as accurate as manual typing. For example, it cannot
distinguish between "there" and "their".
3. Sound signals are required to be amplified for proper reconstruction. Hence amplifiers are
needed.
4. It has reduced performance at high frequencies.
Uses of Microphones:
1. It is used in multimedia presentations and allows voice-overs on presentations.
2. It is used in voice recognition system that allows a computer to recognize spoken words and
use them as input to, e.g., a word processor.
3. It is used in video conferencing/VoIP and allows the users to speak to each other.
4. It is used in sound and music recording.
5. It is used in radio and television broadcasting.
6. It is used in computers for recording voice.
7. It is used in speech recognition.

Voice Recognition:
If the microphone is being used in a voice recognition system, the user’s voice is detected
and then converted into digital.
A few words spoken produce a digital wave pattern.
A software compares this wave pattern to wave patterns stored in memory to see if they
match.
Use of Voice Recognition:
1. This technology can be used in security systems (e.g. a user may be asked to say their name
and if the user’s voice is identified then he/she is given access).
Speech Recognition:
It is a different and more complex technology.
It uses a microphone to input words spoken by a user.
The spoken words are recognized and shown on a screen, input into a word processor or
used in other application.

65
Example of Speech Recognition:

Sound wave Digital value

1. Suppose a person says any word; the sound card in the computer will convert the sound wave
into a digital form.
2. The software takes the digital image and breaks it up into phonemes (these are the smallest
elements that make up a language).
3. These phonemes are compared with words found in the built-in dictionary.
4. That word would then be suggested by the software in whatever application is being run.
Why is this technology complex?
It is a complex technology since computer is unable to differentiate between similar sounding
words (e.g., their and there) due to different dialects and accents of human beings.
Uses of Speech Recognition:
1. This technology can be used in phones for giving commands such as “open camera”.
2. This technology can be used in cars for giving commands such as “switch on GPS”.

Difference between Speech Recognition and Speech Synthesis:


Speech recognition:
The speech recognition is a form of input.
It requires a microphone.
It is an example of an expert system (artificial intelligence).
Speech synthesis:
The speech synthesis is a form of output.
It requires speakers.
In speech synthesis, words are chosen from a database.

66
Optical Mouse:

Optical Mouse

An optical mouse is an example of a pointing device.


It uses rolling ball, optical sensor, and red laser to detect motion in the x—y direction.
The movement is echoed on screen and curser/pointer is moved on screen.
It has scroll wheel and buttons to allow data input.
They can use either a USB wired connection or a wireless Bluetooth connectivity to the
computer.
Advantages of wired Mouse:
1. There is no signal loss since there is a constant signal pathway (wire).
2. It is cheaper to operate as no need to buy new batteries or charge batteries.
3. There are fewer environmental issues as no need to dispose of old batteries.
Working of Optical Mouse:

An optical mouse shines a red light from a Light-Emitting Diode (LED) from the bottom of
the mouse onto a surface.
The light reflects back from the surface into a photoelectric cell (CMOS sensor) through a
lens.
The lens magnifies the reflected light to allow detection of smaller movements.
When a button on the mouse is clicked, a microswitch is pressed.
The reflection of light is converted to a binary value that is transmitted to the computer.
The computer then determines the direction and speed of the movement.
The coordinates are calculated, and the computer moves the cursor on the screen based on
the coordinates received from the mouse.

67
Advantages of Optical Mouse:
1. It has no moving parts which mean less wear and a lower chance of failure, so it is more
reliable.
2. There’s no way for dirt to get trapped in the mouse and interfere with the tracking
sensors/mechanical components.
3. It allows for an increased tracking resolution meaning smoother response.
4. It does not require a special surface, such as a mouse pad.

68
2D & 3D Scanners:

2D Scanner 3D Scanner

Scanners are either two-dimensional (2D) or three-dimensional (3D):

Two-Dimensional (2D) Scanners:


The 2D scanners are the most common form of scanners.
They are generally used to input hard-copy (paper) documents.
The scanned image is converted into an electronic form which can be stored on computer.

Working of a 2D Scanner:
The scanner shines light onto the surface of a document.
The light source is automatically moved across the document.
An image of document is produced as reflected light is captured using a series of mirrors and
sent to the lens.
The lens focuses the image which falls onto a charge couple device (CCD).
Each light-sensitive pixel of CCD creates an electric charge when light falls on it.
An electronic form is produced which is finally converted to a 2D digital image.

Charge Couple device (CCD):


It consists of integrated circuits etched into silicon.
It is made up of thousands of light-sensitive pixels.

After scanning:
Computers equipped with optical character recognition (OCR) software can convert the
scanned text into a text file format.
Otherwise, if the scanned document was a photograph, then it forms an image file such as
JPEG.

69
Application of 2D Scanners at an airport:
1) They are used at airports to scan and then read passports:
OCR technology is used to produce digital images of passport pages.
Due to OCR, these images can be manipulated.
Example: OCR software is able to review these images, select the text part and then
automatically put the text into correct fields of an existing database.

2) They are used at airports to scan 2D photograph in passport:


It is stored as jpeg image.
The passengers face is then photographed using a digital camera.
The two digital images are compared using face recognition/detection software.
Key parts of the face are compared such as:

1. Distance between eyes


2. Width of the nose
3. Shape of the cheekbones
4. Length of the jaw line
5. Shape of the eyebrows

It is done to ensure that the two images represent the same face and for security clearance
purposes.

70
Meaning of Terms:
Optical Character Recognition (OCR):
Optical character recognition (OCR) is a technology that enables you to convert different
types of documents, such as scanned paper documents, PDF files or images captured by a
digital camera into editable and searchable data.
It simply allows scanned text from a document to be converted into text file format for
manipulation and editing.

Optical Mark Recognition (OMR):


Optical mark recognition (OMR) is the process of capturing human-marked data from
document forms such as surveys and tests.
They are used to read questionnaires, multiple choice examination papers in the form of lines
or shaded areas.
It is simply a system that reads pencil or pen marks on a piece of paper in pre-determined
positions.

Facial Recognition Software:


A facial recognition system uses biometrics to map facial features from a photograph or
video.
It compares the information with a database of known faces to find a match.
Key parts of the face such as distance between eyes, width of nose etc. are compared.
It can help verify personal identity.

71
Three-Dimensional (3D) Scanners:
The 3D scanners scan solid objects and produce a three-dimensional image.
They scan the x, y and z coordinates taking images at several points which produces a digital
image that represents the solid object formed.
The scanned images can be used in computer aided design (CAD) or sent to a 3D printer to
produce a working model of the scanned image.
Technologies used are lasers, magnetic resonance, and white light etc.

Working of a 3D Scanner:
The scanner shines a laser or light source over the surface of a 3D object.
It scans the shape and appearance of an objecting recording the measurements of the
dimensions of the object such as the width, height, and depth.
Then the measurements are converted into digital file.
Hence, it produces a 3D digital model.

Application of 3D Scanners:
1) Computed tomographic (CT) scanners are used to create a 3D image of a solid object.
This is based on tomography technology (shown below) which basically builds up an image
of the solid object through a series of very thin slices.
These 2D slices together make up a representation of the 3D solid object.
Each slice is built up by use of X-rays, radio frequencies or gamma imaging.
Each slice is then stored as a digital image in computer memory. The whole of solid object is
represented digitally in the computer memory.

Tomographic scanners can have different names depending on technology used:

1. X rays technology 2. Radio frequencies technology 3. Gamma rays technology

CT scanners (computerized SPECT (single photon emission


MRI (magnetic resonance imaging)
tomography) computed tomography)

72
An airport has a security system that uses:
• Computers
• Scanners
• Digital cameras
Each passenger must have a passport or ID card which contains a recent photograph and other
personal data.
• The passenger places their passport or ID card on a scanner that reads machine-
readable characters and scans the photograph.
• Look toward the camera that takes an image of the passengers face.
How a computer checks whether the image just taken by the camera matches the scanned
photograph:

A facial recognition software is used to scan the face.


The captured image of face is converted to digital data by the camera.
The scanned photo stored in a passport is converted into digital data.
The key features of the face are compared in both images such as distance between the eyes,
width of the nose etc.

73
Touch Screens:

Touchscreens

It is now a very common form of input.


It allows users to interact with devices just by touching the screen.

There are 3 types of touch screens technologies:


1. Capacitive
2. Infra-red
3. Resistive

Uses of Touch Screens:


1. The touch screens are used in mobile phones, tablets etc. because it is an easy method to
input data and icons are used for application selection.
2. They are used in laptop displays.
3. They are used in control room interface because it is a faster/easier method to input data into
system and fewer chances of error since number of choices are limited.
4. They are used in ticket kiosks and information kiosks because it is an easy method for the
public to enter data as it limits the number of options available for ease of use.

Benefits of using a Touch Screen:


1. It does not require peripherals (mouse or keyboard).
2. It has a menu driven interface as the number of possible inputs is limited.
3. There is a less chance of input error.
4. It is resistant to weather in indoor places.

74
Capacitive:
Working of Capacitive Touch Screen:
An electrostatic field is created across the screen as current flows out from all 4 corners of the
screen.
The sensors are located around the screen which is used to read the electrostatic field.
When finger touches screen, the conductive/capacitive properties of a user cause current
changes in the field as the electrostatic charge is transferred to the user’s finger.
The coordinates of touch are calculated by an onboard microprocessor.

Advantages of Capacitive Touch Screen:


1. It is a medium cost technology.
2. The screen visibility is good even in strong sunlight.
3. The screen is very durable with high scratch resistance; it takes a major impact to break the
glass.
4. It allows multi-touch capability.
Disadvantages of Capacitive Touch Screen:
1. It cannot be used when wearing gloves as it allows only the use of bare fingers for input.

Why gloves cannot be used in capacitive technology?


The gloves are not conductive.
They block current from finger and hence stop electrostatic field being changed.

How to use capacitive technology with gloves:


Use a conductive stylus as they allow charge to be disturbed/changed.
Use capacitive gloves as they allow charge to disturbed/changed.

Types of Capacitive Touch Screens:


There are presently two main types of capacitive touch screens:
1. Surface
2. Projective
Surface Capacitive Screens:
An electrostatic field is created across the screen as current flows out from all 4 corners of the
screen.
The sensors are located around the screen which are used to read the electrostatic field.
When finger touches screen, the conductive/capacitive properties of a user cause current
changes in the field as the electrostatic charge is transferred to the user’s finger.
The coordinates of touch are calculated by an onboard microprocessor.
This system only works with a bare finger or stylus.

75
Projective Capacitive Screens:
The transparent conductive layer is in the form of an X—Y matrix pattern.
A three-dimensional (3D) electrostatic field is created across the screen as current flows out
from all 4 corners of the screen.
The sensors are located around the screen which are used to read the electrostatic field.
When finger touches screen, the conductive/capacitive properties of a user cause current
changes in the 3D electrostatic field as the electrostatic charge is transferred to the user’s
finger.
The coordinates of touch are calculated by an onboard microprocessor.
This system works with bare fingers, stylus and thin surgical or cotton gloves.

Infra-Red:
Working of Infra-Red Touch Screen:
Infrared rays are sent across screen from the edges.
It has sensors around edges.
Infrared rays form an invisible grid across the screen.
Infrared ray is broken by a finger blocking a beam.
Calculation is made on where beam is broken to locate the ‘touch’.

Heat-Sensitive Infra-Red system:


It uses glass as the screen material and needs a warm object (e.g. fingers) to carry out an
input operation.

Optical Infra-Red system:


It uses glass as the screen material and uses an array (group) of sensors in the form of a gird;
the point of contact is based on which grid coordinate is touched.

Advantages of Infra-Red Touch Screen:


1. The screen is very durable; it takes a major impact to break the glass.
2. It allows multi-touch capability.
3. Optical system allows use of bare fingers, gloved fingers or stylus for input.
Disadvantages of Infra-Red Touch Screen:
1. It is an expensive technology.
2. It is sensitive to water, moisture, and dust/dirt.
3. It is possible for accidental activation to take place if infrared beams are disturbed in any way.
4. Heat-sensitive system only allows use of bare fingers for input.

76
Resistive:
Working of Resistive Touch Screen:
It uses an upper layer of polyester (type of plastic) and a bottom layer of glass that transmit
electric currents.
When the top polyester layer is touched, the top and bottom layer complete a circuit.
As a result, the electric current changes and signals are sent out.
They are interpreted by a microprocessor and calculation is carried out on where layers are
connected to determine the coordinates of the touch.

Advantages of Resistive Touch Screen:


1. It is cheaper to manufacture/inexpensive technology.
2. It allows use of bare fingers, gloved fingers, or stylus for input.
3. It has good resistance to dust and water.
Disadvantages of Resistive Touch Screen:
1. The screen visibility is poor in strong sunlight.
2. It does not allow multi-touch capability.
3. It has low touch sensitivity.
4. The screen is vulnerable to scratches and wears out through time.

77
The following tables compare capacitive and resistive technologies:

(i) Table 1:

Resistive Capacitive
Statement
(✓) (✓)

This touch screen has multi-touch capabilities ✓

This touch screen cannot be used whilst wearing gloves ✓

This touch screen is made up of two layers with a small space in



between

This touch screen uses the electrical properties of the human body ✓

This touch screen is normally cheaper to manufacture ✓

This touch screen has a quicker response time ✓

(ii) Table 2:

Capacitive Resistive
Statement
(✓) (✓)

Needs pressure to be applied to create a circuit ✓

May not register a touch if the user is wearing gloves ✓

More commonly used in smartphones ✓

More responsive to a touch ✓

Needs an electrical field to be changed to register a touch ✓

Cheaper to manufacture ✓

78
Exam Style Questions:
Question 1:

79
Answer:

80
Question 2:

81
Answer:

Question 3:

82
Answer:

Question 4:

83
Answer:

Question 5:

84
Answer:

Question 6:

85
Answer:

Question 7:

86
Answer:

Question 8:

87
Answer:

Question 9:

88
Answer:

89
Question 10:

90
Answer:

Question 11:

91
Answer:

Question 12:

Answer:

92
Question 13:

93
Answer:

Question 14:

94
Answer:

Question 15:

95
Answer:

96
3.2.2 Output Devices:
A device that allows the user to view/hear the data that has been entered into a computer
system.
The output devices included in our syllabus are:

1. actuator
2. digital light processing (DLP) projector
3. inkjet printer
4. laser printer
5. light emitting diode (LED) screen
6. liquid crystal display (LCD) projector
7. liquid crystal display (LCD) screen
8. speaker
9. 3D printer

97
Actuators:

Actuators

It is an electromechanical device such as a relay, solenoid, or motor.


It is operated by signals to cause physical movement.
It controls the movement of a machine, e.g., electric door locks in automobiles.
It is a component of a machine that is responsible for powering and moving a motor in
machinery, such as a robot arm in a factory.
An actuator requires a control signal and a source of power/energy to convert the signal into
mechanical motion.

Uses of Actuators:
1. It is mainly used in many control applications involving sensors and devices such as ADC and
DAC.
2. It is used in control devices such as a conveyer belt to start and stop the conveyer belt.
3. It is used in control devices such as a valve to open and close the valve.

Examples of Actuators:
1. Electric motor.
2. Comb drive.
3. Digital micro mirror device.
4. Hydraulic cylinder.
5. Screw jack.

98
Light Projectors:

Projectors

There are two common types of light projector:


1. Digital light projector (DLP)
2. Liquid crystal display (LCD) projector

Projectors are used to project computer output onto larger screens, walls or even onto interactive
whiteboards. They are often used in presentations and in multimedia applications.

Digital Light Projectors (DLP):


It uses thousands of tiny mirrors that can move very quickly to create an image.

Working of DLP:
It uses a large number of tiny mirrors.
The mirrors are laid out in a grid/matrix.
Each mirror creates a pixel in the image.
The mirror can tilt toward or away from the light source which creates a light or dark pixel of
projection screen.
The mirrors reflect light toward a projection lens.
The color is produced using a color wheel.
The light passes through color wheel, and it is filtered into red, green, and blue.
It can be used to display an image on a wall/screen.

99
Features of DLP:
The DLP projector can create over 16 million different colors.
The tilting of each tiny mirror towards or away from the light source is linked with colors from
the color wheel to produce the different colored images.

Advantages of DLP:
1. It has a higher contrast ratio.
2. It has higher reliability/longevity.
3. It is smaller and lighter than an LCD projector and easily portable.
4. It is better suited to dusty or smoky atmospheres than an LCD projector.

Disadvantages of DLP:
1. The image tends to suffer from shadows when showing a moving image.
2. It has more moving parts and therefore produces more heat.
3. It does not have grey components in the image.
4. It produces poorer reds and yellows color when running at full power.
5. The color definition is poorer than LCD projectors because the color saturation is not as good.

100
Liquid Crystal Display (LCD) Projectors:
It is an older technology than DLP.
It uses a high intensity beam of light shone through three layers of changing pixels.

Working of LCD Projectors:


A powerful beam of white light is generated from a bulb or LED inside the projector body.
This beam of light is then sent to a group of chromatic-coated mirrors which reflect the light
back at different wavelengths corresponding to red, green, and blue light components.
These three different colored light components pass through three LCD screens and a red,
green, and blue version of the grey image emerges.
These images are then combined using a special prism to produce a full color image which
consists of millions of colors.
Finally, the image passes through the projector lens onto a screen.

Advantages of LCD Projectors:


1. It has a higher resolution and more visible pixels.
2. It has higher color contrast in ambient lightning and more vivid colors.
3. It uses less power and produces less heat, so it is more efficient in their use of energy than
DLP projector.
4. It runs quieter than a DLP projector.
5. It has better color saturation than DLP projector and it does not give the rainbow effect the
DLP projector often gives.

Disadvantages of LCD Projectors:


1. It has a poorer contrast ratio than DLP projector.
2. It has a limited life and longevity is not as good as DLP projector.
3. It is bulkier and not very convenient for portability.

101
A projector is needed to watch high-definition (HD) films. The projector will be attached to
the ceiling at home. Why an LCD projector would be more appropriate for this purpose as
compared to DLP projector?
1. It has a higher resolution and more visible pixels.
2. It has higher color contrast in ambient lightning and more vivid colors.
3. The colors are often more accurate.
4. The image usually appears brighter with same wattage.
5. The projector will be stationary, so it does not need the portability and compactness of the
DLP projector.
6. The cost of purchase is usually less.
7. It runs quieter than a DLP projector and any surface can be used as a display.
8. It uses less power and produces less heat.
9. It does not give the rainbow effect the DLP projector often gives.

102
Inkjet Printers:

Inkjet Printers

They consist of:


A print head which consists of nozzles that spray droplets of ink on to the paper to form
characters.
An ink cartridge or cartridges/liquid ink.
A stepper motor and belt which moves the print head assembly across the page from side to
side.
A paper feed which automatically feeds the printer with pages as they are required.

It has a small ink cartridge and small paper tray.


Working of Inkjet Printers:
It uses rollers which move the paper through the printer.
It makes use of thermal bubble or piezoelectric technology.
The nozzles spray droplets of ink onto the paper.
A print head moves across the paper to distribute the ink.
The different color inks are mixed to create required colors.

It is suitable for low volume and high-quality output e.g., a photograph.

103
The droplets of ink are propelled onto paper using either thermal bubble or piezoelectric
technology:
Thermal Bubble:
The tiny resistors create localized heat which makes the ink vaporize.
The ink forms a tiny bubble and as it expands some of the ink is ejected from print head onto
the paper.
Then the bubble collapses and a small vacuum is created which allows fresh ink to be drawn
into the print head.

Piezoelectric:
A crystal is located at the back of the ink reservoir for each nozzle.
The crystal is given a tiny electrical charge which makes it vibrate.
This vibration forces droplets of ink to be ejected onto paper through the nozzle.

Advantages of Inkjet Printers:


1. The printing may be of higher quality.
2. It can be used in larger paper sizes.
3. It can print onto different media.
4. It is more reliable.
5. It does not need warm-up time.
Disadvantages of Inkjet Printers:
1. The ink is more expensive so printing cost per page is high.
2. The printing will be slower.
3. The ink can be smeared if ink is not smudging proof.
Applications of Inkjet Printers:
1. It is used for the production of one-off photographs of very good quality.
2. It is used when only a few pages of good quality, color printing is needed.
3. It is used when small quantities of documents are to be printed.

104
Sequence of events during printing of Inkjet Printers:

Stage in
Description of what happens
process

1 The data from the document is sent to a printer driver.

The printer driver ensures that the data is in a format that the chosen printer can
2
understand.

A check is made by the printer driver to ensure that the chosen printer is available
3
to print (e.g. is it busy, is it off line, is it out of ink, and so on).

The data is then sent to the printer and it is stored in a temporary memory known
4
as a printer buffer.

A sheet of paper is then fed into the main body of the printer; a sensor detects
5 whether paper is available in the paper feed tray – if it is out of paper (or the paper
is jammed) then an error message is sent back to the computer.

As the sheet of paper is fed through the printer, the print head moves from side
6 to side across the paper printing the text or image; the four ink colors are sprayed
in their exact amounts to produce the desired final color.

At the end of each full pass of the print head, the paper is advanced very slightly
7 to allow the next line to be printed; this continues until the whole page has been
printed.

If there is more data in the printer buffer, then the whole process from stage 5 is
8
repeated until the buffer is finally empty.

Once the printer buffer is empty, the printer sends an interrupt to the processor
9 in the computer; this is a request for more data to be sent to the printer; the whole
process continues until the whole of the document has been printed.

105
Laser Printers:

Laser Printers

It has a large toner cartridge and large paper tray. It uses powdered toner and rotating drum to
transfer the image to the paper.
Working of Laser Printers:
It makes use of the properties of static electricity.
It uses dry powdered ink/toner cartridges.
A laser beam removes positive charges in certain areas.
It then uses positive and negative charged rotating drums.
The paper then goes through a fuser which melts the ink onto the paper making it permanent.
Then a discharge lamp removes all electric charges from drum making it ready to print further
pages, if any.
It does not have any moving head.

It is suitable for high volume and high-quality output e.g., leaflets.

Advantages of Laser Printers:


1. It has faster speed of printing.
2. It can print on both sides/duplex.
3. It prints text at a high quality.
4. It has a cheaper printing cost per page as many pages can be printed from one toner
cartridge.
5. It can print in high volumes.

106
Disadvantages of Laser Printers:
1. It is expensive to purchase.
2. The toner cartridge is expensive.
3. It prints images at a lower quality.
4. It needs more time to warm-up
5. It can be quite large in size.
Application of Laser Printers:
1. It is used for producing a large number (e.g., 2000) of high quality flyers, leaflets, magazines
and posters for advertising.
2. It is used when large quantities of documents are to be printed.

107
Sequence of events during printing of Laser Printers:

Stage in
Description of what happens
process

1 The data from the document is sent to a printer driver.

The printer driver ensures that the data is in a format that the chosen printer can
2
understand.

A check is made by the printer driver to ensure that the chosen printer is available
3
to print (e.g., is it busy, is it offline, is it out of ink, and so on).

The data is then sent to the printer, and it is stored in a temporary memory known
4
as a printer buffer.

The start of the printing process involves a printing drum being given a positive
charge; as this drum rotates, a laser beam is scanned across it removing the
5
positive charge in certain areas; this leaves negatively charged areas which exactly
match the text/images of the page to be printed.

The drum is then coated with positively charged TONER (powdered ink); since the
6 toner is positively charged, it only sticks to the negatively charged parts of the
drum.

7 A negatively charged sheet of paper is then rolled over the drum.

The toner on the drum now sticks to the paper to produce an exact copy of the
8
page sent to the printer.

To prevent the paper sticking to the drum, the electric charge on the paper is
9
removed after one rotation of the drum.

The paper finally goes through a fuser which is a set of heated rollers; the heat
10
melts the ink so that it fixes permanently to the paper.

At the very end, a discharge lamp removes all the electric charge from the drum
11
making it ready to print the next page.

108
3D Printers:

3D Printers

It produces/outputs a solid, physical, three-dimensional (3D) product/object/prototype.


They are primarily used in computer aided design (CAD) applications.

The software used to create the computerized designs for 3D printing:

Computer Aided Design (CAD)

Working of 3D Printer:
It makes use of tomography/slices of an object.
The solid object is built up layer by layer using materials such as powdered resin, powdered
metal, plastic, paper or ceramic powder.
They use additive manufacturing.
Additive manufacturing is a process that adds successive layers of material to create an object
(e.g. building up the object layer by layer).

The more traditional method is: Subtractive Manufacturing

It involves removing sections or portions of a material by machining or cutting it away to


make it into any shape we want, for making the object.
Similarly, CNC machining removes metal to form an object; hence it uses subtractive
manufacturing method.

An example to show the difference between Additive and Subtractive manufacturing:


If we have to make a statue using 3D printing, additive method will involve building it up layer
by layer using powdered stone until the final object is formed.
The subtractive method would involve carving the statue out of solid stone (e.g., removing
the stone not required) until the final item is produced.

*Be very clear that additive manufacturing (building up layer by layer) is called 3D printing.
Subtractive manufacturing s not 3D printing or any method of 3D printing*

109
There are two technologies of 3D Printing:
Direct 3D Printing:
It uses inkjet technology.
A print head can move from left to right as in a normal printer.
A print head can also move up and down to build up the layers of an object.

Binder 3D Printing:
It is similar to direct 3D printing.
However, this method uses two passes for each of the layers.
The first pass sprays dry powder.
The second pass sprays a binder (type of glue) to form a solid layer.

However, the newer technologies are using lasers and UV light.

The following are the steps involved in 3D Printing:

A design is made using computer-aided design (CAD) software.

The finalized drawing is imported into some special software that prepares it in a format
which is understood by the 3D printer.

The 3D printer is set up to allow the solid object to be made.

The solid object is built up layer by layer (often only 0.1 mm thick); this can take several
hours, depending on the thickness of the layers, the material used and the size of the final
object.

The object is removed from the printer and is then prepared; for example, some use a jelly-
like support which needs to be washed away by immersion in water, some require the
removal of excess plastic powder and others require the cutting away of unused material; in
many cases, the object has to be left to ‘cure’ for a few hours.

110
Uses of 3D Printing:

1. A physical model can be made from a blueprint.


2. It is used to make prosthetic limbs that exactly fit the recipient.
3. It is used to make items that allow precision reconstructive surgery.
4. It is used in aerospace; wings and other parts are made due to precision and lightweight.
5. It is used for making suspension parts for a vintage car that are no longer in production.

111
The following tables compare inkjet, laser, and 3D printers:

(i) Table 1:

3D Inkjet Laser
Statement
(✓) (✓) (✓)

Uses a moving print head ✓ ✓

Uses liquid ink ✓

Produces output using materials such as plastic and resin ✓

Uses piezoelectric or thermal technology (✓) ✓

Uses a rotating drum to transfer the image to the paper ✓

Uses layer upon layer of material to create the output ✓

(ii) Table 2:

Inkjet Laser
Statement
(✓) (✓)

Uses a rotating drum to transfer the image to the paper ✓

Uses powdered toner ✓

Uses nozzles to spray droplets on to the paper ✓

Uses a print head mechanism that moves side to side ✓

112
(iii) Table 3:

Inkjet Laser
Statement
(✓) (✓)

Can print in color ✓ ✓

Uses a charged drum to create the printed item ✓

Uses powdered toner ✓

Creates output line by line using a print head ✓

113
Light Emitting Diode (LED):

LCD/LED

Working/Operation of LED:
It is a flat panel display that uses an array of light-emitting diodes as pixels.
The display is made of up pixels that are arranged together as a matrix.
Each pixel is formed of three light emitting diodes (LEDs)/filters.
The shades of color are achieved by mixing red, green, and blue diodes.
The screen can be back-lit/edge-lit.
It is used in mobile devices such as smartphones and tablets.

Benefits of LED technology:

1. It has low power consumption/energy efficient.


2. It has greater longevity (long lasting).
3. It has a focused beam and less light strays from the beam.
4. It has brighter/vivid colors.
5. It has high resolution image and there is fewer pixel failure.
6. It does not suffer flicker issues.
7. The display is thinner.
8. It is mercury free technology so environmentally friendly.
9. It has increased viewing in sunlight.

114
Liquid Crystal Display (LCD):
Working/Operation of LCD:
It is a flat panel display that uses the light modulating properties of liquid crystals.
The display of an LCD screen is made up of pixels that are arranged together as a matrix.
The screen is backlit using some form of technology such as CCFL or LED.
Each pixel has three filters red, blue, and green.
The different shades of color are achieved by mixing red, blue, and green.
The light is shone through the liquid crystals, and the crystals can be turned between opaque
and transparent to allow light to pass.

Backlighting of LCD:
LCD doesn’t emit any light; some form of backlit technology needs to be used.
Modern LCD monitors are backlit using light emitting diode (LED) technology which gives the
image better contrast and brightness.
When LEDs are used, a matrix of tiny LEDs is used behind the LCD screen.
Before the use of LEDs, LCD monitors used a cold cathode fluorescent lamp (CCFL) as the
backlighting method.
Essentially, CCFL uses two fluorescent tubes behind the LCD screen which supplies the light
source.

Benefits of LCD technology:

1. It has low power consumption.


2. It runs at cool temperature.
3. It does not suffer image burn.
4. It does not suffer flicker issues.
5. It has bright image/colors.
6. It has high resolution image.
7. It is cheaper to purchase than e.g., an LED screen.

Advantages of using LED back-lit technology compared to the older cold cathode fluorescent
lamp (CCFL) in LCD monitors & televisions:
1. LED’s do not need to warm up and reach maximum brightness immediately.
2. LED gives a whiter tint which makes colors appear more vivid and brighter.
3. LED provides a higher resolution display/good color definition.
4. LED allows for much thinner screens with lighter weights.
5. LED is a more reliable technology and longer lasting.
6. LED uses much less power, and it is more efficient.

115
Organic Light Emitting Diode (OLED):
Future LED technology is making use of organic light emitting diodes (OLEDS).
These use organic materials (made up of carbon compounds) to create semi-conductors
which are very flexible.
The organic films are sandwiched between charged metallic cathode and a glass anode.
When an electric field is supplied to the electrodes, they give off light.
This means that no form of backlighting is required.
It also removes the need to use LCD technology, since OLED is a self-contained system.

Advantages of using OLED compared with existing LEDs and LCDs:


1. The plastic, organic layers of an OLED are thinner, lighter and more flexible than the crystal
structures used in LEDs or LCDs.
2. The light-emitting layers of an OLED are lighter and these layers can be made from plastic
rather than the glass used in LED and LCD screens.
3. OLEDs give a brighter light than LEDs.
4. OLEDs do not require backlighting like LCD screens as they generate their own light.
5. They use much less power than LCD screens as no backlighting is required (this is very useful
in battery-operated devices such as mobile phones).
6. OLEDs are essentially plastics and so they can be made into large, thin sheets (this means
they could be used on large advertising boards in airports, subways, and so on).
7. OLEDs have a very large field of view, about 170 degrees, which makes them ideal for use in
television sets and for advertising screens.

Uses of these technologies:


They are used in:
1. television screens
2. computer monitors
3. portable systems with touchscreens
4. smartphones
5. tablets
6. handheld game consoles

116
Speakers:

Speakers

Components of Speakers:
1. Diaphragm/cone
2. Coil of wire
3. Spider/suspension
4. Permanent magnet
5. Basket
6. Dust cap
7. Outer frame
Working of Speakers:
It takes an electrical signal and translates it into physical vibrations to create sound waves by
passing the digital data (binary values) through a digital-to-analogue converter (DAC).
An electric current in the coil creates an electro-magnetic field.
The changes in the audio signal causes the direction of the electric current to change.
The direction of the current determines the polarity of the electro-magnet.
The electro-magnet is repelled by or attracted to the permanent magnet.
This causes the coil to vibrate.
The movement of the coil causes the diaphragm/cone to vibrate.
The vibration is transmitted to the air in front of the diaphragm/cone as sound waves.
The amount of movement will determine the frequency and amplitude of the sound wave
produced.

117
Exam Style Questions:
Question 1:

118
Answer:

Question 2:

119
Answer:

Question 3:

Answer:

120
Question 4:

121
Answer:

122
Question 5:

Answer:

123
Question 6:

124
Answer:

Question 7:

125
Answer:

Question 8:

Answer:

126
Question 9:

Answer:

127
Question 10:

Answer:

128
Question 11:

Answer:

129
Question 12:

130
Answer:

131
3.2.3 Sensors:
It is an input device.
It measures/takes physical readings of the surrounding environment (e.g. temperature) and
records, indicates, or otherwise responds to it.
A system can be developed using sensors, converters, a feedback cycle, and a control system.
Analogue Data:
It is a continuous data.
It is non-discrete.
Example: data such as a sound wave.

Digital Data:
It is discrete data that has only two values.
Example: binary data 1’s and 0’s.

ADC & DAC:


ADC is analogue-to-digital converter and DAC is digital-to-analogue converter.
Why is there a need for ADC & DAC?
Computers cannot make any sense of physical quantities.
The data needs to be converted into a digital format (binary values) so that the computer can
understand.
This is usually achieved by an analogue-to-digital converter.
This device converts physical values into discrete binary/digital values.
When the computer is used to control devices such as a motor or a valve, it is necessary to
use a digital-to-analogue converter since these devices need analogue data to operate in
many cases.
Actuators are used in such control applications.

Examples of Sensors:

1) acoustic (sound) sensor 6) infra-red sensor 11) pH sensor

2) accelerometer sensor 7) level sensor 12) pressure sensor

3) flow (rate) sensor 8) light sensor 13) proximity sensor

4) gas sensor 9) magnetic field sensor 14) temperature sensor

5) humidity sensor 10) moisture sensor

132
Sensors, Description & Example Applications:

Sensor Description Example Applications

It measures temperature of the 1) control a central heating system


surrounding by sending signals; 2) control/monitor a chemical process
Temperature
these signals will change as the 3) control/monitor temperature in a
temperature changes greenhouse

It measures water levels in, for 1) control/monitor moisture levels in


example, soil (it is based on the soil in a greenhouse
Moisture
electrical resistance of the 2) monitor the moisture levels in a
sample being monitored) food processing factory

It is slightly different to
1) monitor humidity levels in a
moisture; it measures amount
building
of water vapor in, for example,
2) monitor humidity levels in a factory
Humidity a sample of air (based on the
manufacturing microchips
fact that the conductivity of air
3) monitor/control humidity levels in
will change depending on the
the air in a green house
amount of water present)

It uses photoelectric cells that 1) switching streetlights on or off


produce an output (in the form depending on light levels
Light
of electric current) depending 2) switch on car headlights
on the brightness of the light automatically when it gets dark

Active Infrared: It uses an


invisible beam of infrared 1) turn on car windscreen wipers
radiation picked up by a automatically when it detects rain
detector; if the beam is broken, on the windscreen
then there will be a change in 2) security alarm system (intruder
the amount of radiation breaks the infra-red beam)
Infra-red reaching the detector (sensor)

Passive Infrared: It measures


1) security alarm system (detects body
the heat radiation given off by
heat of intruder)
an object, for example, the
2) monitor the temperature inside an
temperature of an intruder or
industrial freezer or chiller unit
the temperature in a fridge

133
Sensor Description Example Applications

It is a transducer and generates 1) weighing of lorries at a weighting


different electric currents station
Pressure
depending on the pressure 2) measure the gas pressure in a
applied nuclear reactor

1) pick up the noise of footsteps in a


It is basically a microphone that
security system
Acoustic (sound) converts detected sound into
2) detect the sound of liquids dripping
electric signals/pulses
at a faulty pipe joint

It uses various methods to


1) monitor pollution levels in the air at
detect the gas being monitored
an airport
and produce outputs that vary
2) monitor oxygen and carbon dioxide
Gas with gas levels such as oxygen
levels in a greenhouse
& carbon dioxide gas sensors;
3) monitor oxygen levels in a car
they monitor oxygen or carbon
exhaust
dioxide levels present

1) monitor/control acidity levels in the


It measures acidity through
soil in a greenhouse
pH changes in voltages in, for
2) control acidity levels in a chemical
example, soil
process

It measures changes in 1) detect magnetic field changes (e.g.,


magnetic field – the signal in mobile phones & CD players)
Magnetic field
output will depend on how the 2) used in anti-lock braking systems
magnetic field changes (ABS) in cars

It measures acceleration and 1) used in cars to measure rapid


motion of an application i.e., deceleration and apply air bags in a
the change in velocity (a crash
Accelerometer
piezoelectric cell is used whose 2) used by mobile phones to change
output varies according to the between portrait and landscape
change in velocity) mode

1) detect when a face is close to a


It detects the presence of a
Proximity mobile phone screen and switches
nearby object
off screen when held to the ear

134
Sensor Description Example Applications

It measures the flow rate of a


1) used in respiratory devices and
moving liquid or gas and
inhalers in hospitals
Flow (rate) produce an output based on
2) measure gas flows in pipes (for
the amount of liquid or gas
example, natural gas)
passing over the sensor

It uses ultrasonics (to detect


1) monitor levels in a petrol tank in a
changing liquid levels in, for
car
example, a tank) or
2) in a pharmaceutical process where
capacitance/conductivity (to
Level powder levels in tablet production
measure static levels, for
need to be monitored
example, height of water in a
3) leak detection in refrigerant (air
river) – level sensors can also be
conditioning)
optical or mechanical in nature

Benefits of using Sensors to monitor the manufacture of plastic pipes by measuring pressure,
temperature, and speed of production:

1. They can work continuously.


2. They avoid human error.
3. It could be a dangerous environment and they will avoid human risk.
4. They detect errors instantly.
5. They maintain consistent and correct conditions.

135
NOTE: 11 different examples have been given on the following pages for you to understand
the questions asked regarding sensors in terms of:
sensors and their applications
sensors to be used for certain scenarios
sensors to be used for certain tasks
and how each sensor could be used in a given system

Example 1:
Identify two sensors that the security system could use to detect intruders. Describe how each
sensor could be used in the security system.
1) Infrared sensor:
It receives infrared rays/heat.
It sends data to a microprocessor.
1. It can be placed in the corner of a room.
2. It is used to detect the heat of an intruder.

2) Pressure sensor:
It receives current if the circuit is created and stops receiving current if circuit is broken.
It sends data to a microprocessor.
1. It can be placed on a window or a door.
2. It is used to detect a change in pressure.

Example 2:
Identify four sensors that could be used in the washing machine. State what each sensor could
be used for.

Sensor Example of use

Temperature It could be used to monitor the temperature of the water.

Pressure It could be used to monitor the level of the water in the washing machine.

Motion It could be used to monitor whether the drum is still in motion.

pH It could be used to monitor the level of detergent present in the water.

136
Example 3:
Identify four sensors that could be used on a farm that grows fruit. State what each sensor
could be used for.

Sensor Example of use

It could be used to measure the temperature of the environment.


Temperature
It can alert when it is too hot/too cold for the fruit to grow.

It could be used to measure the brightness of the environment.


Light
It can alert when the fruit has too little/too much light.

It could be used to measure the water content of the soil.


Moisture
It can alert when the soil is too dry or too wet.

It could be used to measure how acidic/alkaline the soil is.


pH
It can alert when there is something polluting the soil.

Example 4:
The processes in a chemical factory are monitored by sensors connected to a microprocessor.
Identify two different sensors used in this application. Give an example of how each sensor
could be used in the chemical factory.

Sensor Example of use

To measure the levels of oxygen/carbon dioxide/nitrogen in the factory


Gas
to make sure they are not too high or low.

To measure the temperature of the chemicals to make sure it is not too


Temperature
high or low.

Motion/Infra-red To detect any persons in an unauthorized area of the factory.

To measure the pressure of chemicals flowing through pipes to check that


Pressure
levels are not too high or low.

To measure the pH to make sure the acidity/alkalinity of the chemicals is


pH
correct.

137
Sensor Example of use

To measure the level of light to make sure it remains at a constant level


Light
for the chemical process.

Example 5:
Sensors are used at the finish line of long-distance running to identify the number of
competitors who finish the race. Identify two different sensors that could be used to identify
the number of competitors.
1) Pressure sensor
2) Light sensor
3) Motion sensor
4) Magnetic field sensor (can be used if competitors are wearing a compatible chip)

Example 6:

Sensor Application

Light Control the switching off and on of street lighting

Moisture Monitor the amount of water left in clothes in a drier

Gas Monitoring the pollution levels in a river

pH Monitor acidity levels in the soil in a greenhouse

Pressure Detection of intruders breaking into a building

Example 7:

Sensor Application

Light controlling streetlights

Gas, pH, temperature, light monitoring a river for pollution

Pressure, magnetic field controlling traffic lights

138
Example 8:

Sensor Application

Pressure Weighing a baby in a hospital

Temperature Turning off a kettle when it boils

Infrared/Light/Pressure Controlling an automatic door

Oxygen/Gas/Humidity Monitoring the air quality in an aero plane

Pressure/Infrared/Magnetic Field Counting cars crossing a bridge

Example 9:

Sensor Scenario

Detecting when a person is approaching an automatic


Pressure/Motion/Infrared
door system

pH/Light Monitoring the pollution level in a river

Temperature Checking if a tropical aquarium is 25 degrees Celsius

Magnetic Field/Pressure/Motion
Counting the number of cars that cross a bridge
/Infrared

Example 10: Car Parking System

Sensor Task

Infrared/Light Check if a vehicle is too high

Magnetic Field/Pressure Count the vehicles entering the car park

Pressure/Magnetic Field/Infrared/Light Check if a vehicle is parked in a parking space

139
Example 11: Washing Machine

Sensor Task

Temperature Checking the water is 30oC

pH Checking the water acidity level after detergent is added

Checking the weight of the clothes to make sure that the washing
Pressure
machine is not overloaded

140
Uses of Sensors:
Sensors are used in both monitoring and control applications:
Examples of monitoring include:
1. monitoring a patient in a hospital for vital signs such as heart rate, temperature, etc.
2. monitoring of intruders in a burglar alarm system.
3. checking the temperature levels in a car engine.
4. monitoring pollution levels in a river.

Examples of control include:


1. turning streetlights on at night and turning them off again during daylight.
2. controlling the temperature in a central heating/air conditioning system.
3. chemical process control (for example, maintaining temperature and pH of process)
4. operating anti-lock brakes on a car when necessary.
5. controlling the environment in a greenhouse.

Standard working procedure of Sensors in monitoring application:


1. The sensor sends data/signals to the microprocessor.
2. The analogue data/signals are converted from analogue to digital using ADC (analogue-to-
digital converter).
3. The microprocessor compares the data received to a stored/pre-set/pre-determined value.
4. If the value is outside the acceptable range, a signal is sent by the microprocessor to display
a warning message on a monitor or activate an alarm.
5. If the value is within an acceptable range, no action is taken.
6. The whole process is a continuous loop.

Standard working procedure of Sensors in controlling application:


1. The sensor sends data/signal to the microprocessor.
2. The analogue data/signals are converted from analogue to digital using ADC (analogue-to-
digital converter).
3. The microprocessor compares the data received to a stored/pre-set/pre-determined value.
4. If the value is outside the acceptable range, a signal is sent by the microprocessor to actuator,
control valves, motors etc. to cause an action to occur.
5. If the value is within an acceptable range, no action is taken.
6. The whole process is a continuous loop.

141
NOTE: The topic ‘sensors’ from input and output devices is the most frequently asked topic in
computer science exams since the highest number of questions ever asked are from sensors.

A question from sensor is asked in almost every paper, every year.


It is asked for 4 to 8 marks.
The answer to each question related to sensor is very similar and consists of statements
and same keywords in a sequence.
Just memorizing the standard procedures stated on previous page and writing them in
exams will help you earn complete marks.

However, the situation would change, and the examiner can give you any scenario and question
about the functioning of any sensor accordingly.

The procedures stated on previous page will always be the same; you only need to make
slight changes in answer according to question statement and the scenario asked.

18 complete questions of sensors (worth 5-8 marks) that have been asked in recent years are
given below with their answers so that you can realize the pattern of answering and understand
how to make changes in your answer according to question statement and the scenario asked.

Sensors Working Related Questions:


Q1. A security light is controlled by sensors and a microprocessor.
Describe how the sensors and microprocessor interact to switch on the security light when an
intruder is detected. [6]
An infrared/motion/pressure sensor is used.
When the sensor detects movement, it continuously sends signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the value is outside the acceptable range, a signal is sent by the microprocessor to switch
on the light and keep it on for a period of 30 seconds.
If the value is within an acceptable range, no action is taken.
The process is a continuous loop.

142
Q2. A cold store is kept at a constant low temperature using a sensor, a microprocessor, and
a cooling unit.
Explain how the sensor and the microprocessor will maintain a constant low temperature. [6]
A temperature sensor is used.
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the temperature value is too high or low, a signal is sent by the microprocessor to turn on
or off the cooling unit.
An actuator is used to turn the cooling unit on or off.
If the temperature matches the stored value, no action is taken.
The process is a continuous loop.

Q3. A factory uses a security system to control a security light. The system uses a sensor and
a microprocessor.
Explain how the security system makes use of the sensor and the microprocessor to control
the security light. [6]
An infrared/motion sensor is used.
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the value is outside the acceptable range, a signal is sent by the microprocessor to turn the
security light on and wait for a suitable period.
If no motion is detected, lights are turned off.
If the value is within an acceptable range, no action is taken.
The process is a continuous loop.

Q4. A sports stadium uses a pressure sensor and a microprocessor to monitor the number of
people entering the sports stadium. For the counter to increment the weight on the pressure
sensor must exceed 5 kg.

Explain how the system uses the pressure sensor and the microprocessor to monitor the
number of people entering. [5]

The sensor sends data to the microprocessor.


The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to a stored value of 5 kg.
If the value is greater than 5 kg, a counter is incremented.
The whole process is a continuous loop.

143
Q5. An underground car park has a system. Each parking space has a red and a green light
above it. If a car is parked in the parking space only the red light is on, otherwise only the
green light is on. Sensors and a microprocessor are used to control the system.

Describe how the sensor and the microprocessor are used to display the red or green light
above the parking space. [6]

The sensor sends data to the microprocessor.


The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored value.
If the data is greater than the stored value, a signal is sent by the microprocessor to actuator
to turn red light on and the green light off.
If the data is less than the stored value, a signal is sent by the microprocessor to actuator to
turn the green light on and the red light off.
If the data is within an acceptable range, no action is taken.
The actuator is used to turn on and off the lights.
The whole process is a continuous loop.

Q6. A system uses pH sensors and a microprocessor to help monitor pollution in a river. The
pH of the water should be between 6 and 8. The system outputs and alert if the pH of the
water is not in this range.
Explain how the system uses the pH sensors and the microprocessor to help monitor the
pollution. [5]
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the reading is > 8 or < 6, a signal is sent by the microprocessor to display a warning message
on a monitor or activate an alarm.
If the value is within an acceptable range, no action is taken.
The process is a continuous loop.

144
Q7. An elevator (lift) has a maximum weight limit of 2400 kg. The weight carried is monitored
by a sensor and a microprocessor.
Describe how the sensor and the microprocessor are used to make sure the maximum weight
limit is not exceeded. [6]
A pressure sensor is used.
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the value is > 2400 kg, a signal is sent by the microprocessor to display a warning message
to passengers and signal sent to actuator for stopping the lift from operating.
If the value is <= 2400 kg, no action is taken.
The process is a continuous loop.

Q8. An office has an automated lighting system. When movement is detected in the office the
lights are switched on. If movement is not detected for a period of 2 minutes the lights are
switched off. The system uses a sensor and a microprocessor.
Describe how the automated lighting system uses a sensor and a microprocessor. [6]
A motion sensor is used.
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/pre-determined/stored value.
If the value is outside the acceptable range, a signal is sent by the microprocessor to actuator
for switching lights on.
A timer is set for 2 minutes and every time a movement is detected, the timer is reset.
If the value is within an acceptable range, no action is taken.
The process is a continuous loop.

Q9. A sensor and a microprocessor are used to monitor the pH of the cleaning products. The
system records each reading that is taken. If the reading is greater than 7 a waning message
is displayed on a monitor.
Explain how the sensor and microprocessor are used in the system. [6]
The sensor sends a signal to the microprocessor.
The analogue signals are converted from analogue to digital using ADC.
The microprocessor compares the data received to a pre-set/stored value of 7.
If the value is > 7, a signal is sent by the microprocessor to display a warning message on a
monitor or activate an alarm.
If the value is within an acceptable range, no action is taken.
The process is a continuous loop.

145
Q10. A business wants to use a biometric security system to control entry to the office. The
system will use a biometric device and a microprocessor.
Explain how the biometric security system will make use of the biometric device and the
microprocessor to control entry to the office. [6]
A fingerprint scanner can be used. User will place their finger on touchscreen device so their
finger gets scanned.
The sensor in the fingerprint scanner will take readings of user.
The readings are converted from analogue to digital using ADC.
The readings are sent to the microprocessor.
The readings are compared to stored values.
If readings match, the user can enter.
If readings do not match, then user is declined entry and alarm may sound to alert the
security.

Q11. A theme park has a game where a player tries to run from the start to the finish without
getting wet. The system for the game uses sensors and a microprocessor to spray water at a
player as they run past each sensor.
Describe how the sensors and the microprocessor are used in this system. [6]
A motion sensor/pressure sensor is used.
The sensor sends data to the microprocessor.
The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored data.
If the value is outside the acceptable range, a signal is sent by the microprocessor to actuator
to spray water.
If the value is within an acceptable range, no action is taken.
The whole process is a continuous loop.

Q12. A long-distance running race uses an electronic counter that counts each competitor
who finished the race. The sensors are used with a microprocessor to count how many
competitors finish the race.

Explain how the sensor and the microprocessor are used. [6]

The sensor sends signal to the microprocessor.


The analogue signal is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored value.
If the data is out of range, the counter is incremented by 1.
The whole process is a continuous loop.

146
Q13. Jamelia has a greenhouse that she uses to grow fruit and vegetables. She needs to make
sure the temperature in the greenhouse stays between 25oC and 30oC (inclusive).
A system that has a temperature sensor and a microprocessor is used to maintain the
temperature in the greenhouse. The system will:
• open a window and turn a heater off if it gets too hot
• close a window and turn a heater on if it gets too cold
Describe how the system uses the temperature sensor and the microprocessor to maintain the
temperature in the greenhouse. [8]
The sensor sends data/readings/signals to the microprocessor.
The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored values/range of values.
If the data is greater than 30, a signal is sent by the microprocessor to actuator to open
window and to turn heater off.
If the data is below 25, a signal is sent by the microprocessor to actuator to close window and
to turn on heater.
If the data is between 25 and 30, no action is taken.
The actuator is used to operate heater and windows.
The whole process is a continuous loop.

Q14. A security light system is used by a factory. The light only comes on when it is dark and
when movement is detected. The light will stay on for 1 minute before switching off. Sensors
and a microprocessor are used to control the security light system.
Describe how the sensors and the microprocessor control the security light system. [8]
A light sensor and infra-red/motion sensor are used.
The sensor sends data to the microprocessor.
The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored values.
If one value or both values are within range, no action is taken.
If both values are out of range, a signal is sent by the microprocessor to actuator to switch
the light on.
The 1-minute timer is started.
When the timer reaches 1 minute, a signal is sent by the microprocessor to actuator to switch
the light off.
The actuator is used to switch on and off the light.
The whole process is a continuous loop.

147
Q15. An electronic game has three square mats that are colored red, green and blue.
The player will see a color displayed on a screen and has 1 second to hit the mat that matches
the color. If the player hits the correct mat, within 1 second, a counter is incremented. When
a player hits an incorrect mat, the game ends.
The game uses sensors and a microprocessor to determine if the player hits the correct mat
within 1 second.
Explain how the game uses sensors and a microprocessor to count the number of times a
player hits a correct mat within 1 second. [7]
A pressure sensor is used within each mat and a timer is started.
The sensor sends data to the microprocessor.
The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored values.
If the data is out of range, the microprocessor stops the timer and checks if the data has come
from the correct color mat sensor.
If the data is out of range, the microprocessor checks to see if timer is stopped at less than 1
second and increments the counter if timer is less than 1 second and the color mat is correct.
If the correct color mat is hit, the timer is reset and the whole process is repeated.
If the data has not come from the correct color mat sensor, the game ends.

Q16. A washing machine uses sensors and a microprocessor to control the washing cycle of
clothes.

Describe how the sensor and the microprocessor are used to make sure the water remains at
30oC. [6]

The sensor sends data to the microprocessor.


The analogue data is converted from analogue to digital using ADC.
The microprocessor compares the data received to stored value of 30.
If the data is below 30 then a signal is sent by the microprocessor to actuator to turn the
heater on to heat the water up or add hot water.
If the data is above 30 then a signal is sent by the microprocessor to actuator to turn the
heater off to allow the water to cool down or add cool water.
The actuator is used to turn headset on/off or to add water.
If the data is 30, no action is taken.
The whole process is a continuous loop.

148
Q17. A room has an automatic lighting system. Electric lights are automatically turned on
when a person enters the room and the natural light in the room is 10 or less.

Explain how sensors and a microprocessor are used to control electric lights in the room. [7]

A light sensor and infra-red/motion/pressure sensor are used.


The sensor sends data to the microprocessor.
The analogue data is converted from analogue to digital using ADC.
The microprocessor compares both values received to stored values.
If the motion value is out of range, the light value is checked.
If the light value is <= 10, a signal is sent by the microprocessor to actuator to turn the lights
on.
If the motion value is within an acceptable range, the light value is checked.
If the light value is > 10, a signal is sent by the microprocessor to actuator to turn the lights
off.
The actuator is used to turn on and off the light.
The whole process is a continuous loop.

Q18. A business uses a closed-circuit television (CCTV) system that starts recording when
motion is detected. It stops recording after two minutes if no further motion is detected. The
system uses a motion sensor and a microprocessor.

Describe how the motion sensor and microprocessor work together to control the CCTV
system. [7]

The motion sensor sends signals to the microprocessor.


The analogue signal is converted from analogue to digital using ADC.
The microprocessor compares signal values received to stored value.
If the motion value is out of range (and if camera is not recording), a signal is sent by the
microprocessor to camera to start recording.
If the motion value is within acceptable range, the microprocessor starts/resets the timer.
When the timer reaches 2 minutes, a signal is sent by the microprocessor to camera to stop
recording.
The whole process is a continuous loop.

149
3 Hardware

3.3 | Data Storage


The memory and storage devices can be split up into two distinct groups:
1. Primary Storage
2. Secondary Storage (External & Internal)

3.3.1 Primary Storage:


The primary storage is the main memory that is directly accessed by the CPU.
It is internal to the computer (inside a computer).
It has faster access speed.
It stores boot-up instructions and can hold data whilst being processed.
It has both volatile and non-volatile.

Examples: Random Access Memory (RAM) and Read Only Memory (ROM).

The RAM stores programs and data that are currently in use and ROM stores boot-up
instructions.
The RAM is volatile, and ROM is non-volatile.

The primary memory consists of random access memory (RAM) and read only memory (ROM):

Random Access Memory (RAM):


Features of RAM:
It is volatile/temporary memory (the contents of the memory are lost when the power to the
RAM is turned off).
It is used to store instructions, programs, data, and parts of the operating system that are
currently in use.
The data can be written to or read from RAM & the contents of the memory can be changed.
The RAM is much faster to write to or read from than other types of memory.
The RAM normally has a larger capacity than ROM.

The buffers use RAM since they need to be a fast memory and the data only needs to be held
temporarily.

150
Why does RAM get slower and its solution?
*Note: RAM never runs out of memory*

As the RAM becomes full, it becomes slower since the processor has to continually access the
hard disk drive to overwrite old data on RAM with new data.
By increasing the RAM size, the number of times this access operation is carried out is
reduced, resolving this issue, and making the computer run faster.

There are currently two types of RAM technology:


1. Dynamic RAM (DRAM)
2. Static RAM (SRAM).

1) Dynamic RAM (DRAM):


It has to be refreshed periodically.
It uses a single transistor and capacitor.
It stores each bit as a charge.
It has less complex circuitry.
It requires higher power consumption under low levels of access, which is significant when
used in battery-powered devices because it requires more circuitry for refreshing.
It is less expensive to purchase as it requires fewer transistors.
It has slower access time/speed because it needs to be refreshed.
It can have higher storage/data density.
It is used in main memory
Advantages of DRAM:
1. DRAMs are much less expensive to manufacture than SRAM.
2. They have a higher storage capacity than SRAM.

Use of DRAM:
1. DRAM is the most common type of RAM used in computers except for high-speed areas.

2) Static RAM (SRAM):


It does not require a refresh.
It uses more than one transistor.
It stores each bit using a flip-flop/latch.
It has more complex circuitry.
It uses less power as there is no need to refresh.
It is more expensive to purchase as it requires more transistors.
It has faster access time/speed.
It has lower storage/data density.
It is used in cache memory.

151
Advantages of SRAM:
1. It is much faster than DRAM when it comes to data access as typical access time for SRAM is
25 nanoseconds and for DRAM is 60 nanoseconds.
2. It has lower power consumption.

Uses of SRAM:
1. SRAM is the most used technology in areas where absolute speed is essential.
For example, the processor’s memory cache is the high-speed portion of the memory.

By keeping most of the data and instructions in SRAM, the computer avoids having to access the
slower DRAM.

The following tables compare DRAM & SRAM technologies:

(i) Table 1:

DRAM SRAM
Statement
(✓) (✓)

Does not need to be refreshed as the circuit holds the data while

the power supply is on

Mainly used in cache memory of processors where speed is



important

Has less complex circuitry ✓

Requires higher power consumption under low levels of access,



which is significant when used in battery-powered devices

Required data to be refreshed occasionally so it retains the data ✓

(ii) Table 2:

SRAM DRAM
Statement
(✓) (✓)

More expensive to make ✓

Requires refreshing (recharging) ✓

Made from flip-flops ✓

152
(iii) Table 3:

DRAM SRAM
Statement
(✓) (✓)

Is less expensive to manufacture ✓

Needs to be refreshed ✓

Has more complex circuitry ✓

Is often used as cache ✓

Has faster access time ✓

Read Only Memory (ROM):


Features of ROM:
It is non-volatile/permanent memory (the contents of the memory remain even when the
power to the ROM is turned off).
It is used to store the start-up instructions when the computer is first switched on (e.g., BIOS
(basic input/output system).
The data of a ROM chip can only be read and not written to; the contents of the memory
cannot be changed.
The ROM normally has a smaller capacity than RAM.

Main Differences between RAM & ROM:


The RAM is volatile whereas ROM is non-volatile.
The RAM is temporary whereas ROM is permanent.
The RAM normally has a larger capacity than ROM.
The RAM can be edited while ROM cannot be edited.
The ROM is read only memory while RAM can have read and write operations.
The ROM holds instructions for boot up whereas RAM holds files, data, and instructions
currently in use.

153
Applications of RAM & ROM:

Example 1:
A remote-controlled toy car has a circuitry which contains both RAM and ROM chips. The
remote control is a hand-held device.
The functions of:
ROM: It stores factory settings such as remote-control frequencies.
It stores the ‘start-up’ routines when the toy car is first switched on.
It stores the set routines (e.g., how the buttons on the hand-held device control turning
left, acceleration, stopping, and so on).

RAM: It stores routines that the user may wish to program.


It stores new instructions given by the user.
It stores the data/instructions received from the remote-control unit.

Example 2:
A mobile device uses RAM, ROM and an SSD.
What the RAM, ROM and SSD are used for:
RAM: To store the data/instructions/parts of OS that are currently in use.
ROM: To store the firmware/bootup instructions/BIOS.
SSD: To store the files/software.

Example 3:
A smartphone needs both RAM and ROM.
Why a smartphone needs RAM and ROM:
It needs RAM to store the data and programs currently in use.
It needs ROM to permanently store the boot up instructions.

Example 4:
The software for the stock control system is stored on a central computer. The computer is a
Von Neumann model computer system with a central processing unit (CPU) that uses random
access memory (RAM), read only memory (ROM) and a hard disk drive (HDD).
Purpose of the RAM, ROM, and HDD in the central computer:
It has RAM to store the data/programs currently in use.
It has ROM to permanently store the boot up instructions.
It has HDD to store the stock database/software/OS.

154
3.3.2 Secondary Storage:
The secondary storage is persistent memory that is not directly accessed by the CPU.
It is necessary for more permanent storage of data.
It can be internal or external to the computer.
It has a slower access speed.
It stores files, data, operating system, and softwares etc. that can be accessed at a later stage.
It is non-volatile only.

Examples: Hard Disk Drive (HDD) and Solid State Drive (SSD).

NOTE: The Secondary storage can be divided into two categories:


internal to the computer
external to the computer (removable)
The Secondary storage that is internal to the computer include Hard Disk Drive (HDD) & Solid
State Drive (SSD).
The Secondary storage that is external to the computer (removeable) is known as Off-line
storage.
The Off-line storage include CD, DVD, Blu-ray discs, USB flash memory/memory sticks,
external/removeable Hard Disk Drives (HDD).

Off-line Storage:
The off-line storage is not directly accessed by the CPU.
It is necessary for more permanent storage of data.
It is external to the computer (removeable from a computer) // not internal to the computer.
It is used to store files as a backup.
It is non-volatile memory that can be removed from a computer system.

Examples: CD, DVD, Blu-ray, USB flash memory/memory sticks, external HDD

155
Exam Style Questions:
Question 1:

Answer:

156
Question 2:

Answer:

157
Question 3:

Answer:

Question 4:

158
Answer:

Question 5:

159
Answer:

Question 6:

Answer:

160
Question 7:

Answer:

161
Question 8:

Answer:

162
Question 9:

163
Answer:

164
3.3.3 Magnetic, Optical & Solid-State Storage:
The secondary (and off-line) storage can be divided into three categories according to the
technology used. The technologies are:
1. Magnetic
2. Solid-State
3. Optical

Secondary Storage

Internal Secondary Storage Off-line (External) Secondary Storage

Magnetic Solid-State Magnetic Optical Solid-State


Storage Storage Storage Storage Storage

CD Disk

USB Flash
Hard Disk Solid State External HDD
DVD Disk Memory/Memory
Drive (HDD) Drive (SSD) (Hard Disk Drive)
Stick

Blu-ray Disc

Is an internal Solid State Drive (SSD) an example of primary, secondary or off-line storage?
Justify your choice.
It is an example of secondary storage because it is non-volatile storage.
It is not directly accessed by the CPU.

Basic Operation

Magnetic Storage Optical Storage Solid-State Storage

It uses platters which are It uses lasers to create It uses NAND technology or
divided into tracks & sectors. and read pits and lands. NOR technology.
The data is read and written The transistors are used as
using electromagnets. control gates & floating gates

165
Magnetic Storage:
How a Magnetic Storage Device stores data:
The storage device has platters and data is stored on platters.
The platters are divided into tracks and sectors.
The storage platter is spun.
It has a read and write arm that moves across storage media.
It reads data from and writes the data to the platters using electromagnets.
It uses magnetic fields to control magnetic dots of data.
The magnetic field determines the binary value.
Advantages of Magnetic Storage Devices compared to Solid State Storage devices:
1. The magnetic storage is cheaper per unit of data.
2. The magnetic storage has more longevity, and it can perform more read/write cycles.

NOTE: The operation and characteristics of a magnetic storage device is applicable to both
Hard Disk Drive (HDD) and external Hard Disk Drive (external HDD) because they are both
magnetic storage devices.
The operation of HDD and external HDD and how they store the data along with advantages
and disadvantages of each are exactly same as they are both magnetic storage devices.

The magnetic storage devices are following:


1. Hard Disk Drive (HDD)
2. External Hard Disk Drive (external HDD)

1) Hard Disk Drive (HDD):


It is a magnetic storage device.
It has moving parts.
It is non-volatile storage.
It uses magnetic properties to store data.
The data is read and written using electromagnets.
It has the slowest read and write speed compared to solid-state storage.
It can be used as an external storage device to backup data.

166
Operation of an HDD & how it stores data:
It has platters and data is stored on platters.
The platters are divided into tracks and sectors.
The storage platter is spun.
It has read and write arms that move across storage media.
It reads data from and writes the data to the platters using electromagnets.
It uses magnetic fields to control magnetic dots of data.
The magnetic field determines the binary value.
Advantages of an HDD compared to SSD:
1. The HDD is cheaper per unit of data (cheaper for larger amounts of storage space) OR it is
normally cheaper for the same capacity of storage as SSD.
2. It has greater longevity, and it can perform more read/write cycles than SSD.
3. It is available in a larger storage capacity than SSD.
4. The HDD is a more trusted technology, and it is expensive to change the technology.

Disadvantages of an HDD compared to SSD:


1. It has moving parts, so it is less durable than SSD.
2. It has slower data access speed (slower read/write operation) due to greater latency
compared to SSD.
3. It has higher power consumption than SSD.
4. It will create noise and heat.
5. It is larger in physical size and heavier than SSD.
6. It has greater latency and takes more time to warm up (start-up) than SSD.
Latency is defined as the time it takes for a specific block of data on a data track to rotate
around to the read–write head. It can be noticed by messages such as ‘not responding’.

2) External Hard Disk Drive (external HDD)/(removeable HDD):


It is an external magnetic storage device mostly used to back up the data.
It has moving parts.
It is non-volatile storage, and it uses magnetic properties to store data.
The data is read and written using electromagnets.
It has the slowest read and write speed compared to solid-state storage.

NOTE: The external hard disk drive are essentially HDDs external to the computer. They are
similar to HDD, but the only difference is that they are not inside the computer.
The external HDD is connected to the computer using one of the USB ports.
It is removeable and portable magnetic storage device.
It is essentially used as a back up device or simply another way of transferring files
between computers.

167
Solid State Storage:
How a Solid State Storage Device stores data:
It uses flash memory.
It stores the data by flashing it onto the silicon chips.
It uses NAND or NOR technology.
The data is stored by controlling the flow of electrons using transistors which are used as
control gates and floating gates.
The electric current reaches the control gate and flows through to the floating gate to be
stored.
It is a type of EEPROM technology.
When the data is stored, the transistor is converted from 1 to 0 or 0 to 1.
It writes and reads sequentially.

NOTE: The operation and characteristics of a solid-state storage device is applicable to both
Solid State Drive (SSD) and USB Flash Memory/Memory Stick (pen drive) because they are both
solid-state storage devices.
The operation of SSD and USB Flash Memory and how they store data along with advantages
and disadvantages of each are exactly same as they are both solid-state storage devices.

The solid-state storage devices are following:


1. Solid State Drive (SSD)
2. USB Flash Memory/Memory Stick (pen drive)

1) Solid State Drive (SSD):


It is a solid-state storage device.
It has no moving parts.
It is non-volatile storage.
It uses flash memory to store data which uses NAND or NOR technology.
It uses transistors and cells that are laid out in a grid which are used as control gates and
floating gates.
It can be NAND or NOR technology.
It uses EEPROM technology.
It has a limited number of read/write cycles.
It has fast read and write speed compared to magnetic storage.
It can be used as an external storage device to backup data.

168
Operation of an SSD & how it stores data:
It uses flash memory.
It stores the data by flashing it onto the silicon chips.
It uses NAND or NOR technology.
The data is stored by controlling the flow of electrons using transistors which are used as
control gates and floating gates.
The electric current reaches the control gate and flows through to the floating gate to be
stored.
It is a type of EEPROM technology.
When the data is stored, the transistor is converted from 1 to 0 or 0 to 1.
It writes and reads sequentially.
Advantages of an SSD compared to HDD:
1. It has no moving parts, so it is more durable than HDD.
2. It has faster data access speed (faster read/write operation) due to less latency compared to
HDD.
3. It has less latency and takes less time to warm up (start-up) than HDD.
4. It has lower power consumption and so produces less heat and runs cooler than HDD.
5. It runs quieter than HDD.
6. It is less susceptible to interference as it is not affected by magnetic forces.
7. It is more compact, lighter, and smaller in physical size than HDD.
8. It is portable.
Disadvantages of an SSD compared to HDD:
1. It has lower longevity, and a limited number of read-write cycles can be performed than HDD.
2. It is normally expensive for the same capacity of storage as HDD.

The two types of technologies mostly used in solid-state drives are:


1) Electronically Erasable Programmable Read-Only Memory (EEPROM) technology:
It uses NOR chips rather than NAND.

Advantages:
1. This makes them faster in operation.
2. The EEPROM allows data to be read or erased in single bytes at a time.
This makes EEPROM technology more useful in certain applications where data needs to be
accessed or erased in byte-sized chunks
Disadvantages:
1. The devices using EEPROM are considerably more expensive than those that use NAND
technology.

169
2) Flash/NAND technology:
It uses NAND chips.

Advantages:
1. The devices using NAND are cheaper than those that use EEPROM technology.

Disadvantages:
1. The use of NAND only allows blocks of data to be read or erased.

2) USB Flash Memory/Memory Stick (pen drive):


It is an external solid-state storage device mostly used to back up the data.
It has no moving parts.
It is non-volatile storage.
It uses flash memory to store data which uses NAND or NOR technology.
It uses transistors and cells that are laid out in a grid which are used as control gates and
floating gates.
It can be NAND or NOR technology.
It uses EEPROM technology.
It has a limited number of read/write cycles.
It has fast read and write speed compared to magnetic storage.

NOTE: The USB flash memory/memory stick are essentially SSDs external to the computer.
They are similar to SSD, but the only difference is that they are not inside the computer.
The USB flash memory is connected to the computer using one of the USB ports.
It is removeable and portable solid-state storage device.
It is very small and lightweight, which makes it suitable as a method of transferring files
between computers.
It can also be used as a small back up device for music or photo files etc.

Operation of USB Flash Memory & how it stores data:


It stores the data by flashing it onto the silicon chips.
It uses NAND or NOR technology.
The data is stored by controlling the flow of electrons using transistors which are used as
control gates and floating gates.
The electric current reaches the control gate and flows through to the floating gate to be
stored.
It is a type of EEPROM technology.
When the data is stored, the transistor is converted from 1 to 0 or 0 to 1.
It writes and reads sequentially.

170
Main Advantage of USB Flash Memory:
1. Their main advantage is that they are very small in size which makes them easily portable.

Magnetic Storage & Solid-State Storage:

NOTE: The operation and characteristics of all magnetic storage devices are same as well as
operation and characteristics of all solid-state storage devices are same.
You must not be confused by the magnetic storage term as it refers and applies to both HDD
and external HDD whereas the solid-state storage term refers and applies to both SSD and USB
flash memory.
The only difference is that magnetic storage is the technology while HDD and external HDD
are simply devices which are implementing that technology. Similarly, the solid-state storage
is the technology while SSD and USB flash memory are simply devices which are implementing
that technology.
If a question asks anything related to the technology e.g., magnetic, you must write about that
technology whereas if a question asks anything about the particular device using the
technology e.g., HDD you must refer to that throughout the answer.
However, the answer for both magnetic or HDD will be the same, but you must understand the
difference that one is a technology and other is simply a device implementing that technology.

Main Similarities between an HDD & an SSD:


1. They are both non-volatile.
2. They are both secondary storage and not directly accessed by the CPU.
3. They both have a high capacity of storage.
4. They both have read and write abilities.

Main Differences between an HDD & an SSD:


1. The HDD has moving parts, but SSD does not.
2. The HDD uses magnetic storage whereas SSD uses flash memory.
3. The HDD is slower to access data than SSD as it has greater latency than SSD.
4. The HDD will create noise & heat whereas SSD runs quieter and cooler.
5. The HDD has higher power consumption than SSD.
6. The HDD has greater longevity and more read-write cycles whereas SSD has lower longevity
and limited number of read-write cycles.
7. The HDD is larger in physical size and heavier than SSD.
8. The HDD is normally cheaper for the same capacity of storage as SSD.
9. The HDD is available in a larger storage capacity than SSD.

171
A few examples are given below which will help you better understand the choice of each device
according to the required use (scenario) and the justification needed for choosing that particular
device according to the examination question.

Example 1:
Why a model car uses a solid state drive rather than another type of secondary storage.
A solid state drive has no moving parts.
A solid state drive has faster random access.
A solid state drive has a quick start up/shut down time (reduced latency).
A solid state drive is very small.
A solid state drive is very light.
A solid state drive consumes very little power.
A solid state drive does not generate a lot of heat (therefore safer in this application).

Example 2:
A law company wants to purchase a new file server. The company can purchase a server with
either solid state storage or magnetic storage. After discussion, it decides to purchase a file
server with magnetic storage.
Why the company chose magnetic storage rather than solid state storage:
It has greater longevity as there is likely to be a lot of read/write functions each day.
The read/write speed is sufficient enough even though it is slower than solid-state storage.
It is cheaper per unit of data stored, which is a better value for the company to purchase so
the law company can afford to buy a server with greater storage capacity.
It is a trusted technology as it has been traditionally used for many years.

Example 3:
A sports event company uses a digital camera attached to a drone, to video their events from
the sky. The video is stored as it is captured, on a device that is attached to the drone.
Which type of storage would be the most suitable to store the video and justify your choice.
The solid-state storage would be most suitable to store the video.
It has no moving parts so it will be more durable.
It is small/compact so it can be easily fit onto the device.
It is light so it will not be difficult to lift for the drone.
It can hold the large amount of data needed for video.
It uses less power so drone battery will last longer.

172
Example 4:
Which type of storage would be the most suitable for use in a web server and justify your
choice.
In case of Magnetic storage:
The webserver is likely to receive many requests a day.
The webserver will likely need to store a lot of data and magnetic storage is high capacity.
The magnetic storage is cheaper to buy for storage per unit than solid-state storage.
The magnetic storage is capable of more of read/write requests over time as it has greater
longevity.
There is no requirement for the storage to be portable, so moving parts does not matter.
In case of Solid-State storage:
The webserver is likely to receive many requests a day.
The webserver will likely need to store a lot of data and solid-state storage is high capacity.
The solid-state storage is more energy efficient.
The solid-state storage runs cooler so it will not overheat.
The solid-state storage has faster read/write speeds to handle the volume of traffic.

Example 5:
A mobile device uses an SSD. Why an SSD, rather than an HDD, is used in the mobile device:
It has no moving parts, so it is more durable.
It has a faster read/write speed (access speed).
It is more compact, lightweight, smaller, and portable.
It uses less energy, and the battery will last longer.
It is quieter.
It is not affected by magnetic forces.
It runs at a cooler temperature.
It has less latency and takes less time to warm up.

173
Example 6:
Pradeep stores his collection of films and his work files on his personal computer. Pradeep
wants to save a copy of all his films and files onto a single storage device.
Which type of storage device would be the most suitable to store the copies and justify your
choice.
In case of HDD:
The HDD is a large capacity storage for videos/films that require large storage space.
It has greater longevity so the copies will be accessible for a long time and may require large
number of read/write operations to access fields.
It is relatively cheaper than SSD per GB of data and there is a large storage capacity required
therefore overall cost will be less than other storage devices.
The device will not be moved regularly so there is no need for portability or durability.
In case of SSD:
The SSD is a large capacity storage for videos/films that require large storage space.
It has no moving parts so it can be carried/moved to other locations with limited risk of
damage.
It has fast access speed and so large video files will be stored and accessed in less time.
The cost per GB of data is not significant in comparison as there is a large storage capacity
required therefore overall cost will not be significantly more than other storage devices.
The longevity of SSD is insignificant because the copy of files may not be accessed regularly
so limited number of read/write operations are insignificant.
It uses less power and runs cooler.
It has no latency and so does not take time to start-up.

174
The following tables compare Magnetic Storage devices & Solid-State Storage devices:

(i) Table 1:

HDD SSD
Statement
(✓) (✓)

It has a limited number of read/write cycles ✓

It uses magnetic properties to store data ✓

It has moving parts ✓

It is non-volatile storage ✓ ✓

It can be used as an external storage device to back-up data ✓ ✓

It uses flash memory to store data ✓

(ii) Table 2:

USB flash
HDD SSD memory
Statement
(✓) (✓) drive
(✓)

It has no moving parts ✓ ✓

It is non-volatile ✓ ✓ ✓

It can use NAND gates to store data ✓ ✓

It uses magnetic properties to store data ✓

It has the smallest physical size ✓

It has the slowest read/write speeds ✓

175
Optical Storage:
How data is written to Optical Storage Device/Media:
The disk is rotated/spun.
A laser beam is used to write the data.
The laser beam makes indentations on the surface of the disk.
The data is written in a spiral track.
The pits and lands are used to store data.
The pits and lands represent binary values 1s and 0s.
It is called burning data to the disk.
How data is read from an Optical Storage Device/Media:
The disk is rotated/spun at a constant speed to be read.
A laser beam is used to read the data.
The laser beam shines onto the surface of the disk.
The surface is covered in a track that spirals from the center.
The data is represented on the surface using pits and lands.
The pits and lands represent binary values 1s and 0s.
The pits reflect light back differently to the area in land.
The optical device can determine the binary value from the light reflection.

The optical storage devices are following:


1. Compact Disc (CD)
2. Digital Versatile Disc (DVD)
3. Blu-Ray Disc

176
1) Compact Disc (CD):
It is an optical storage device.
It is non-volatile and off-line storage.
It is only a single polycarbonate layer.
The data is read/written using a red laser.
It is spun/rotated to be read.
It uses a spiral track for storing data.
It uses pits and lands to store data on the spiral track.
It has the smallest storage capacity.
It has the longest wavelength laser.
It can be read only (R) or read write (RW).
How the data is written to a CD:
The disk is rotated/spun.
A red laser beam is used to write the data.
The red laser beam makes indentations on the surface of the disk.
The data is written in a spiral track.
The pits and lands are used to store data.
The pits and lands represent binary values 1s and 0s.
It is called burning data to the disk.
How the data is read from a CD:
The disk is rotated/spun at a constant speed to be read.
A red laser beam is used to read the data.
The red laser beam shines onto the surface of the disk.
The surface is covered in a track that spirals from the center.
The data is represented on the surface using pits and lands.
The pits and lands represent binary values 1s and 0s.
The pits reflect light back differently to the area in land.
The CD can determine the binary value from the light reflection.

Laser Color & Storage Capacity of CD:


It uses red lasers with a wavelength of 780 nanometers.
It has a storage capacity of 700-800 MB only.

Uses of CD:
1. It is commonly used to store music albums.
2. It is used as a back-up system for photos, music, and multimedia files.
3. It is used to transfer files between computers.
4. It is used for supplying software e.g., printer drivers.

177
2) Digital Versatile Disc (DVD):
It is an optical storage device.
It is non-volatile and off-line storage.
It is a dual polycarbonate layer.
The data is read/written using a red laser.
It is spun/rotated to be read.
It uses a spiral track for storing data.
It uses pits and lands to store data on the spiral track.
It has a higher storage capacity than CD.
It has a shorter wavelength laser than CD.
It is spun/rotated faster than CD.
It has a higher data transfer rate than CD of approximately 10 mbps.
It can be read only (R) or read write (RW).
How the data is written to a DVD (dual-layer):
The disk is rotated/spun.
A red laser beam is used to write the data.
The red laser beam makes indentations on the surface of the disk.
The data is written in a spiral track.
The second polycarbonate layer is written by the red laser focusing on the fraction of a
millimeter difference compared to the first layer.
The pits and lands are used to store data.
The pits and lands represent binary values 1s and 0s.
It is called burning data to the disk.
How the data is read from a DVD (dual-layer):
The disk is rotated/spun at a constant speed to be read.
A red laser beam is used to read the data.
The red laser beam shines onto the surface of the disk.
The surface is covered in a track that spirals from the center.
The data is represented on the surface using pits and lands.
The pits and lands represent binary values 1s and 0s.
The second polycarbonate layer is read by the red laser focusing on the fraction of a
millimeter difference compared to the first layer.
The pits reflect light back differently to the area in land.
The DVD can determine the binary value from the light reflection.

178
Structure of DVD:
It uses dual layering which considerably increases the storage capacity.
There are two individual recording layers.
The two layers of a standard DVD are joined together with a transparent (polycarbonate)
spacer, and a very thin reflector is also sandwiched between the two layers.

Laser Color & Storage Capacity of DVD:


It uses red lasers with a wavelength of 650 nanometers.
It has a storage capacity of 8.5 GB.

Uses of DVD:
1. It is used to store movies and games.
2. It is used as a back-up system for photos, music, and multimedia files.
3. It is used to transfer files between computers.
4. It is used for supplying software e.g., printer drivers.

Compact Disc (CD) & Digital Versatile Disc (DVD):


Main Similarities between a CD & DVD:
1. They both need a red laser to read/write data.
2. They both are spun/rotated to be read.
3. They both use spiral tracks for data.
4. They both are optical storage.
5. They both are non-volatile/off-line storage.
6. They both use pits and lands to store data.
7. They both can be read only (R) or read write (RW).
Main Differences between a CD & DVD:
1. The DVD can be dual layer, but CD can only be a single layer.
2. The DVD has a higher storage capacity.
3. The DVD has a shorter wavelength laser.
4. The DVD are spun/rotated faster.
5. The DVDs have a higher data transfer rate (of approximately 10 mbps).

179
3) Blu-Ray Disc:
It is an optical storage device.
It is non-volatile and off-line storage.
It can be a single layer or dual layer.
The data is read/written using a blue laser.
It is spun/rotated to be read.
It uses a spiral track for storing data.
It uses pits and lands to store data on the spiral track.
It has the largest storage capacity.
It has the shortest wavelength.
It is spun/rotated the fastest.
It has the highest data transfer rate of approximately 36 mbps.
It has a built-in secure encryption system.
How the data is written to a Blu-Ray:
The disk is rotated/spun.
A blue laser beam is used to write the data.
The blue laser beam makes indentations on the surface of the disk.
The data is written in a spiral track.
The pits and lands are used to store data.
The pits and lands represent binary values 1s and 0s.
It is called burning data to the disk.
How the data is read from a Blu-Ray:
The disk is rotated/spun at a constant speed to be read.
A blue laser beam is used to read the data.
The blue laser beam shines onto the surface of the disk.
The surface is covered in a track that spirals from the center.
The data is represented on the surface using pits and lands.
The pits and lands represent binary values 1s and 0s.
The pits reflect light back differently to the area in land.
The Blu-ray can determine the binary value from the light reflection.

Structure of Blu-Ray:
It can be a single layer or dual layer.
The pits and lands are much smaller due to the use of blue laser light (with shorter
wavelength).
The single layer Blu-ray disc uses a 1.2 mm thick polycarbonate layer.
The dual layer Blu-ray disc uses a sandwich of two 0.6 mm thick polycarbonate layers.

180
Laser Color & Storage Capacity of Blu-Ray:
It uses blue lasers with a wavelength of 405 nanometers.
The single layer Blu-ray disc has a storage capacity of 27 GB.
The dual layer Blu-ray disc has a storage capacity of 50 GB.

Interactivity of Blu-Ray:

1. It can record high-definition television programmes.


2. It can skip quickly to any part of the disc.
3. It can create playlists of recorded movies and television programmes.
4. It can edit or re-order programmes recorded on the disc.
5. It can automatically search for empty space on the disc to avoid over-recording.
6. It can access websites and download subtitles and other interesting features.

Uses of Blu-Ray:
1. It is used to store high-definition movies.
2. It is used to store video games for the PlayStation.
3. It can store large quantities of high-quality photos, high-definition videos, audios and other
digital content.
4. It is used as a back-up system for photos, music, and multimedia files.

Digital Versatile Disc (DVD) & Blu-Ray Disc:


Main Differences between DVD & Blu-Ray Disc:
1. The Blu-ray disc uses blue lasers and DVD uses red lasers.
2. The Blu-ray disc has a much higher storage capacity than standard DVD.
3. The Blu-ray disc can be single polycarbonate layer or dual polycarbonate layer, but DVD can
only be dual polycarbonate layer.
4. The Blu-ray has a faster transfer rate (of approximately 36 mbps) whereas DVD has a slower
transfer rate (of approximately 10 mbps).
5. The Blu-ray discs have a built-in secure encryption system.

181
Factors affecting storage capacity of Optical Media:
1. The smaller the pit size and track width, the greater the storage capacity of the medium.
2. The shorter the wavelength of laser light, the greater the storage capacity of the medium.

The main differences between CDs, DVDs and Blu-ray are summarized in the following table:

Track Pitch
Laser Wavelength Disk Storage
Disk Type (distance between
Color of Laser Light Construction Capacity
tracks)

single 1.2 mm
CD Red 780 nm polycarbonate 1.60 μm 800 MB
layer

two 0.6 mm
DVD
Red 650 nm polycarbonate 0.74 μm 8.5 GB
(dual-layer)
layers

single 1.2 mm
Blu-ray
Blue 405 nm polycarbonate 0.30 μm 27 GB
(single-layer)
layer

two 0.6 mm
Blu-ray
Blue 405 nm polycarbonate 0.30 μm 50 GB
(dual-layer)
layers

182
The following table compares CD, DVD & Blu-Ray Disks:

(i) Table 1:

Blu-ray CD DVD
Statement
(✓) (✓) (✓)

A type of optical storage ✓ ✓ ✓

Has the largest storage capacity ✓

Can be dual layer ✓ ✓

Read using a red laser ✓ ✓

Has the smallest storage capacity ✓

Stores data in a spiral track ✓ ✓ ✓

The following table compare Magnetic Storage, Solid-State Storage & Optical Storage:

(ii) Table 2:

Magnetic Solid-State Optical


Statement
(✓) (✓) (✓)

No moving parts are used to store data ✓

Pits and lands are used to store data ✓

Data is stored on platters ✓

Flash memory is used to store data ✓

Parts are rotated to store data ✓ ✓

Data can be stored permanently ✓ ✓ ✓

183
Exam Style Questions:
Question 1:

184
Answer:

185
Question 2:

186
Answer:

Question 3:

187
Answer:

Question 4:

Answer:

188
Question 5:

Answer:

189
Question 6:

Answer:

190
Question 7:

191
Answer:

Question 8:

192
Answer:

Question 9:

193
Answer:

Question 10:

194
Answer:

195
Question 11:

Answer:

196
Question 12:

197
Answer:

Question 13:

198
Answer:

199
3.3.4 Virtual Memory:

NOTE: Virtual Memory is a newly added topic in the Computer Science (2210) syllabus
for the session 2023–2025.

We need to understand the meaning of virtual memory, how it is created and used, and why is the
use of virtual memory necessary.

Virtual Memory:
It is basically using secondary storage to stimulate additional main memory (RAM). The physical
memory (RAM) is managed using virtual memory and paging.
The secondary storage is used to extend the RAM (main memory) available so the CPU can
access more memory space than already available RAM space.
The only part of program/data which is in use needs to be in the RAM.
The pages of data are transferred between the RAM and the virtual memory when needed.

Paging:
The main memory (RAM) is divided into equal-size blocks, called page frames.
Each process that is executed is divided into blocks of the same size, called pages.
Each process has a page table that is used to manage the pages of this process.
It is used by memory management in operating system to store and retrieve data from HDD/SSD
and copy it into the RAM.
Page:
It is a fixed size consecutive block of data utilized in virtual memory systems.
The pages (data blocks) are moved in and out of an HDD/SSD (secondary storage) which
allows virtual memory system to work.
Page Frame:
The main memory (RAM) is divided into page frames of the same/equal size blocks as a page
(data block).
Page Table:
The page map table shows the mapping of pages to page frames.
Page Replacement:
It occurs when a requested page is not in memory.
When a new page is requested but is not in memory, a page fault occurs, and the operating
system (OS) replaces one of the existing pages with the new page(s).
There are several methods for page replacement and their purpose is to minimize the number
of page faults.

200
Page Fault:
It occurs when there is an attempt to load an instruction for a page not in memory.
This generates an interrupt, and the interrupt service routine (ISR) code is executed.
This causes the operating system (OS) to load the page into the memory.
How Paging is used to manage Virtual Memory:
It divides the RAM (main memory) into frames.
It divides the virtual memory into blocks of the same size called pages.
The frames and pages are of fixed size.
It sets up a page table to translate logical to physical addresses.
It keeps a track of all free frames.
It transfers/swaps the pages in RAM (main memory) with new pages from the secondary
memory (HDD/SSD) whenever needed.
The following diagram represents how Virtual Memory is created and used:
The diagram has a hard drive (HDD)(secondary storage) and a RAM (main memory).
The hard drive is portioned/divided in some way to create a virtual memory.
The pages are transferred between the RAM and the virtual memory.

201
The following diagrams show differences between paging without virtual memory and paging
using virtual memory:
(i) Without virtual memory (normal memory management):

(ii) With virtual memory (before program 4 is given RAM space):

202
(iii) With virtual memory (after program 4 is given RAM space):

This whole process will continue to occur until RAM is no longer being over-utilized by the
competing programs running in the memory.
The virtual memory gives the illusion of unlimited memory being available as even though RAM is
full, the data can be moved in and out of the secondary storage (HDD/SSD) which provides the
illusion that there is still memory available.

A software is being used to create 3D models which often requires the use of virtual memory.
Why virtual memory is needed for this process?
It is needed to extend the RAM capacity to stop the 3D modelling software from
freezing/crashing when the physical RAM is full.
It is needed to allow the computer to process the large amount of data required for 3D
modelling.

203
Benefits & Drawbacks of Virtual Memory:
Benefits of using Virtual Memory:
1. It extends the RAM capacity as the programs can be larger than RAM (physical memory) and
still be executed.
2. It prevents the system/softwares from freezing/crashing when multiple programs are running,
and the physical RAM is full.
3. It allows the computer to process the large amount of data required for a software/program.
4. It prevents wastage of memory with data that is not being used (e.g., during error handling).
5. It reduces the need to buy and install more expensive RAM memory.
6. It leads to more efficient multi-programming with less input/output loading and swapping
programs into and out of memory.
7. It eliminates external fragmentation/reduces internal fragmentation.
Drawbacks of using Virtual Memory:
1. It is slower to access data in virtual memory.
2. It can cause disk thrashing.

Disk Thrashing:
The pages are required to be back in RAM as soon as they are moved to hard drive (secondary
storage).
There is a continuous swapping of the same pages.
This results in no useful processing (deadlock) because the pages that are in RAM and on
hard drive are inter-dependent.
This results in nearly all processing time to be used for swapping pages.
The processing speed of the computer is considerably reduced.
The system may reach a thrash point where the execution of a process comes to a halt since
the system is continuously swapping pages rather than doing any actual execution.
Ways to reduce Disk Thrashing:
1. It can be reduced by installing more RAM.
2. It can be reduced by reducing the number of programs running at one time.
3. It can be reduced by reducing the size of the swap file.
4. It can be reduced by making use of a solid state drive (SSD) rather than using HDD.

204
Exam Style Questions:
Question 1:

205
Answer:

206
Question 2:

Answer:

207
3.3.5 Cloud Storage:

NOTE: Cloud Storage is a newly added topic in the Computer Science (2210) syllabus for
the session 2023–2025.

The cloud is an online data storage where the data is stored on offsite/remote servers.
It can be accessed remotely, and physical servers & storage are needed to store data in cloud
storage.
The same data is stored on more than one server in many locations.
The servers are owned and managed by a hosting company and may include hundreds of
servers in many locations.
It uses data redundancy.
Data Redundancy: When the same piece of data is stored in more than one place.

Cloud Computing:
It allows the user to access/run and manage data, files, service, or software/application etc.
on a remote server over the Internet.

NOTE: The term ‘cloud storage’ means storing the data on remote servers to make it accessible
over the Internet whereas the term ‘cloud computing’ means accessing data, files, software etc.
over the Internet.
Examples of cloud storage: Dropbox, iCloud, Google Drive, Microsoft One Drive etc.
Examples of cloud computing: Google Docs, Microsoft 365 etc.

Public & Private Cloud Computing:


There are three common systems:
1) Public Cloud:
It is the computing services offered by a 3rd party provider over the public Internet.
It is open/available to anyone with the appropriate equipment/software/credentials.
2) Private Cloud:
It is the computing services offered either over the Internet or a private internal network.
It is only available to selected users and not the general public.
It is a dedicated/bespoke system which is only accessible for/from the organization.

208
3) Hybrid Cloud:
It is a combination of both public and private clouds.
It stores some data in the private cloud and the less sensitive/less commercial data is accessed
from a public cloud storage provider.
The user can save their data in the cloud instead of saving data on a local hard disk or other storage
device so it can be accessed remotely.

3.3.6 Advantages & Disadvantages of Cloud Storage:


Advantages of Cloud Storage compared with Physical Storage Devices (Storing Locally):
1. The cloud has greater storage capacity than other methods.
2. The data could be sent directly to the cloud from any device.
3. The data can be accessed from any device and anywhere in the world.
4. The backups are automatic.
5. It is easier to add storage capacity (extra storage).
6. It has a lower capital outlay.
7. There is no need for user to carry an external storage device with them and cloud storage
cannot be misplaced or damaged.
8. The owner would only pay for the storage they used.
9. The cloud is more robust.
10. The cloud is more secure as it is password protected.
Disadvantages of Cloud Storage compared with Physical Storage Devices (Storing Locally):
1. The data cannot be saved, accessed, or downloaded if there is no Internet access.
2. It may have security issues as personal data might be stored.
3. The owner of the data loses control over it.
4. It requires a high bandwidth to download/upload data from/to the cloud and so it can be
expensive to pay the user internet service provider (ISP).
5. The cost of storage in the cloud may be restrictive in the long term as it may require costs for
extra storage/large storage capacity.
6. It is easier to hack the cloud as the data is stored for a long period of time on many servers.
7. The potential failure of the cloud storage company poses a risk of loss of all back-up data.
Benefits of using an SSD rather than the Cloud to store data:
1. The SSD is stored within the computer therefore the user has control over the data.
2. The SSD is a physical storage device in the computer therefore is present at all times.
3. Once the SSD is purchased there are no more costs for storage.
4. The SSD does not necessarily need internet access when saving data.
5. It may take less time to transfer data to the SSD than cloud.
6. It may be more difficult to find the data on the cloud than with SSD.
7. It is easier to hack the cloud as the data is stored for a long period of time on many servers.

209
Drawbacks of using an SSD rather than the Cloud to store data:
1. The data can be accessed from any device and anywhere in the world on cloud.
2. The extra storage can be set automatically on the cloud whereas SSD is a fixed size storage.
3. The SSD device can easily be misplaced or damaged.
4. The backups are automatic on the cloud whereas SSD may require the user to set up the
back-up.

Advantages & Disadvantages of Cloud Computing:


Advantages of using Cloud Computing:
1. It can be accessed from anywhere with Internet access.
2. The user does not need to install security and it provides better security.
3. The user does not need to perform backups.
4. The user does not need to buy specific software or hardware.
5. It allows documents to be easily shared.
6. It allows multiple people to work on the same document.
Disadvantages of using Cloud Computing:
1. It cannot be accessed if there is no Internet access.
2. It cannot be accessed if the server goes down.
3. It is reliant on someone else to backup.
4. It is reliant on someone else for security and might have poorer security.

210
Exam Style Questions:
Question 1:

211
Answer:

212
Question 2:

213
Answer:

Question 3:

214
Answer:

215
3 Hardware

3.4 | Network Hardware


3.4.1 Network Interface Card (NIC):

NOTE: Network Interface Card (NIC) is a newly added topic in the Computer Science
(2210) syllabus for the session 2023–2025.

A computer needs a network interface card (NIC) to access a network.


It is a hardware component that allows each individual device to connect to the network.
It provides a MAC address to the device to uniquely identify it on the network.
It provides a hardware interface/physical connection between the computer and network.

Wireless Network Interface Card (WNIC):


It is a hardware component that allows each individual device to connect to a wireless
network.
It provides a MAC address to the device to uniquely identify it on the wireless network.
Functions of a Wireless Network Interface Card (WNIC):
It provides an interface to the wireless network as an antenna.
It receives analogue radio waves and converts them to binary.
It checks incoming transmissions for correct MAC/IP address and ignores transmission not
intended for it.
It encrypts/encodes the data and decrypts/decodes the data.
It takes binary input and converts it to analogue waves and sends those radio waves via the
antenna.

216
Exam Style Questions:
Question 1:

Answer:

217
Question 2:

Answer:

218
Question 3:

Answer:

219
3.4.2 Media Access Control (MAC) Address:
It is made up of 48 bits and represented using six groups of hexadecimal digits:

NN–NN–NN–DD–DD–DD OR NN:NN:NN:DD:DD:DD
(manufacturer ID) (device serial number)

Example of MAC address:

00:15:E9:2B:99:3C

What is meant by MAC address?


It is media access control (address).
A network interface card (NIC) is given a MAC address at the point of manufacture.
It is a unique address that identifies a device connected to the internet.
It is a static address which means it does not change.
The first part of the address is manufacturer ID, and second part is the serial number of device.
It is set/assigned by the manufacturer.

Structure of a MAC address:


It uses hexadecimal values.
It is normally 48 bits in length.
The first part of the address is the manufacturer ID. NOTE: The hexadecimal
The second part is the serial number. code in a MAC address
Purpose of MAC address OR why MAC addresses are used: is the NN’s and DD’s.

It allows all devices to be uniquely identified.

What the hexadecimal code in a MAC address represents:


It is a unique physical address/number associated with network interface card in a device.
It is usually made up of 48 bits which are shown as six groups of hexadecimal digits.
The first part or 6 digits (NN-NN-NN) is the manufacturer ID of device.
The second part or last 6 digits (DD-DD-DD) is the serial number of device.

Features of MAC address:


The first part is the manufacturer ID.
The second part is the serial number.
Each part has 3 pairs of number OR each part has 6 numbers between 00 and FF separated
by “:” (colons)
It is 48 bits long.
It is represented using hexadecimal.

220
Exam Style Questions:
Question 1:

Answer:

221
Question 2:

Answer:

222
Question 3:

Answer:

223
3.4.3 Internet Protocol (IP) Address:
It is a unique address allocated to each device on the internet by the network/ISP (internet
service providers).
It is used to identify the location of a device on the Internet/network.
IP addresses can be IPv4 (32 bit) or IPv6 (128 bit).
It can be static meaning it doesn’t change each time a device is connected to the Internet.
It can be dynamic meaning that it can change each time a device is connected to the Internet.
It can be used in place of URL.
Example: 198.167.214.1
192.168.0.255

Purpose of IP address:
It is an address given to each device that is unique within the network.
It is used to locate a device on a network.
It allows a device/gateway to send data to the correct destination i.e., specific device/gateway.
Characteristics of an IP address:
It consists of values between 0–255 / 0–FFFF.
The values are separated by full stops/colons.
It is a unique address.
It can be static or dynamic.
It can be public or private.
It can be IPv4 having four groups of digits.
It can be IPv6 having eight groups of digits.
The consecutive groups of 0000 can be replaced with double colons (::) in IPv6.

NOTE: Public & Private IP address, Static & Dynamic IP address, IPv4 & IPv6 address are
newly added topics in the Computer Science (2210) syllabus for the session 2023–2025.

Public & Private IP Address:


Public IP Address:
It can be reached over the Internet.
It is less secure than a private address.
It is provided by the ISP (Internet Service Provider).
It is unique to the Internet and cannot be duplicated in different networks.

224
Private IP Address:
It can only be reached internally/through the LAN.
The NAT (Network Address Translation) is necessary for a private IP address to access the
Internet directly.
It is more secure than a public address.
It is assigned by the router of the network.
It is unique within its network but can be duplicated in other/different discrete networks.

Static & Dynamic IP Address:


Static IP Address:
In this type of address, when a computer/device disconnects and rejoins a network, the
address does not change.
This address is permanently assigned to a device by the internet service provider (ISP).
It is usually assigned to:
remote servers which are hosting a website
an online database
a File Transfer Protocol (FTP) server.
FTP servers are used when files need to be transferred to various computers throughout
the network.

Dynamic IP Address:
In this type of address, each time the computer/device rejoins a network, the address changes.
This address is temporarily assigned by the network OS.
It is automatically temporarily assigned using a Dynamic Host Configuration Protocol (DHCP)
server.

Comparison of Dynamic & Static IP addressing:


A device using Dynamic IP addressing:
When the device wants to download a webpage from a website, the DNS translates the
required website URL into an IP address and sends it back to the device.
A message is sent by the device to the IP address of the website server (given by the DNS)
requesting a webpage. The website server sends the required webpage back to the device.
A device using Static IP addressing:
The device can access the website resources directly.
This gives the device a consistent location and also means less bandwidth is used reducing
the network traffic (and takes less time to retrieve data).

225
Reasons for a web server using a Static instead of a Dynamic IP address:
The static IP does not change whereas a dynamic IP address does change.
In the static IP, the DNS does not need updating which might be delayed causing ‘address
not found’ errors.
The web server may be accessed directly using just the IP address as it is still held in cache
memory.
This gives a device consistent location and also means less bandwidth is used reducing the
network traffic (and takes less time to retrieve data).
The following table compares Dynamic & Static IP addresses:

Dynamic IP addresses Static IP addresses

It provides greater privacy since it changes It allows each device to be fully traceable since
each time a user logs on. it does not change.

It can be an issue when using, for example, It allows for faster upload & download speeds.
VoIP since this type of addressing is less
reliable as it can disconnect and change the IP It is more expensive to maintain since the
address causing the VoIP connection to fail. device must be constantly running so that
information is always available.

VoIP: Voice over Internet Protocol (VoIP), is a technology that allows you to make voice calls using
a broadband Internet connection instead of a regular (or analog) phone line.

IPv4 address:
Features of IPv4 address:
It has 4 groups of numbers separated by full stops (.)
Each group has values between 0–255
It is 32 bits long (4 bytes).
It is represented in denary.
Format of IPv4 address:
It has 4 groups of denary or hexadecimal integers separated by full stops (.)
Each group has numbers between 0–255 in Denary and 0–FF in Hexadecimal.
Each group is stored in 8 bits (1 byte) and the whole is stored in 32 bits (4 bytes).
Examples of valid IPv4 addresses:
1. 192.168.0.1
2. 128.12.2.30
3. 254.25.28.77

226
IPv6 address:
Features of IPv6 address:
It has 8 groups of numbers separated by colons (:)
Each group has values between 0–FFFF.
It is 128 bits long (16 bytes).
The consecutive groups of 0000 can be replaced with double colons (::)
It is represented in hexadecimal.
Format of IPv6 address:

It has 8 groups of hexadecimal digits separated by colons (:)


Each group has numbers between 0–FFFF.
Each number is 4 hexadecimal digits.
Each group is stored in 16 bits (2 bytes) and the whole is stored in 128 bits (16 bytes).
The first instance of multiple groups of zero can be replaced by a double colon (::)
NOTE: The range of numbers of 0–FFFF in Hexadecimal is equivalent to 0–65535 in Denary.

Examples of valid IPv6 addresses:

1. 12F3:2356:AB12:2015:0000:0000:1234:5123
2. A8FB:7A88:F FF0:0FFF:3D21:2085:66FB:F0FA
3. 12F3:2356:AB12:2015:0000:0000:1234:5123

Problems with IPv4 addressing:


The use of IPv4 is only 32-bit addresses which considerably reduces potential number of
devices and routers used on the internet at any one time.
A newer version called IPv6 is now used which is 128-bit addresses and so considerably
increases number of devices and routers used on the internet at any one time.
Why is there a need for IPv6 addressing:
The number of IP addresses needed will exceed the number available using IPv4.

Advantages of IPv6 compared to IPv4:


1. It removes the risk of IP address collisions.
2. It has built-in authentication checks.
3. It allows for more efficient packet routes.

Main Differences between formats of IPv4 address & IPv6 address:


1. The IPv4 has 4 groups of digits whereas IPv6 has 8 groups of digits.
2. In IPv4, each group is from 0–255 whereas in IPv6, each group is from 0–65535.
3. The IPv4 uses a full-stop between each group whereas IPv6 uses a colon between each group.
4. The IPv4 is 32-bit (4 bytes) whereas IPv6 is 128-bit (16 bytes).

227
The following table compares IPv4 & IPv6 addresses:

IPv4 IPv6
Statement
(✓) (✓)

Can use hexadecimal notation ✓ ✓

Each group of digits is a number between 0 and 65535 ✓

Consists of four groups of digits ✓

Uses double colons (::) ✓

The total length of the address is 32 bits ✓

The following True & False statements are regarding IP addresses:

True False
Statement
(✓) (✓)

The IP address consists of any number of digits separated by single



dots (.)

Each number in an IP address can range from 0 to 255 ✓

IP addresses are used to ensure that messages and data reach their

correct destinations

Public IP addresses are considered to be more secure than private



IP addresses

228
A few examples are given below which will help you better understand the formats of IPv4 & IPv6
addresses. The examples will show whether the given IP addresses are valid or invalid and the
justification needed for proving that according to the examination question.

Example 1:
The following table shows four IPv6 addresses. State if each address is valid or invalid.

IP Address Valid or invalid

21E5:69AA:FFFF:E100:B691:1285:F56E Valid

::255.255.255.255 Valid

59FB::1005:CC57:6571 Valid

56FE::2159:5BBC::6594 Invalid

Example 2:
The following table shows four IPv4 addresses. Indicate for each IP address whether it is valid
or invalid and give a reason.

IP Address Valid or invalid Reason

3A.21.2H.1 Invalid H is not a valid hexadecimal digit

299.53.2.2 Invalid 299 is out of range as largest individual number is 255

It consists of four numbers in the range 0–255


192.2.1.0 Valid
separated by full stops

258 is out of range as largest individual number is 255


12.258.3 Invalid 4 numbers are needed and so one group of numbers is
missing

229
Example 3:
The following table shows four possible IP addresses. Indicate for each IP address whether it
is valid or invalid and give a reason.

Denary/ Valid or
IP Address Reason
Hexadecimal Invalid

This is more than 32 bits


6AA/BBBB in Hex is bigger than FF/255 in
3.2A.6AA.BBBB Hexadecimal Invalid
denary
6AA/BBBB uses more than 8 bits (1 byte)

There are 4 bytes, each 255 or below


2.0.255.1 Denary Valid
All the values are in the range 0–255

6.0.257.6 Denary Invalid 257 is above 255 // third group is above 255

0A.78.F4.J8 Hexadecimal Invalid J is not a valid hexadecimal digit

Example 4:
The following is an IPv6 address:
15EF:5L63::2014:BB::60AA
Why is this IP address invalid?
L is not a valid hexadecimal number.
There are two double colons whereas in IPv6 only one double colon is allowed.

Example 5:
The following is an IPv6 address:
C100:2235::1000:25AA:AA50
Why this IPv6 address would be an invalid IPv4 address.
There are too many digits per group.
There are too many groups of digits.
The address is more than 32 bits (4 bytes).
The colons are used as separators.

230
Exam Style Questions:
Question 1:

Answer:

Question 2:

231
Answer:

Question 3:

Answer:

232
Question 4:

233
Answer:

Question 5:

Answer:

234
Question 6:

Answer:

235
Question 7:

Answer:

236
IP address & MAC address:
The IP address gives the location of a device on the internet. It is an address given to each device
on the internet by the network/ISP.
The MAC address identifies the device connected to the internet. It is a unique address given to a
device on a network by the manufacturer.

Main Similarities between IP Address & MAC Address:


1. Both addresses can be used to identify a computer/device.
2. Both addresses are unique.
3. Both addressed can be represented as hexadecimal.
4. Both addresses do not change if the IP address is static.
Main Differences between IP Address & MAC Address:
1. An IP address is assigned by the network/ISP whereas a MAC address is assigned by the
manufacturer.
2. An IP address can be changed if dynamic, whereas a MAC address cannot be changed.
3. The IP address has 4/8 groups of values whereas MAC address has 6 groups/pairs of values.
4. The IP address is 32-bit/128-bit whereas MAC address is 48-bit.
5. The IP address does not contain serial number or manufacturer ID whereas MAC address
does.
6. The IPv4 address is denary and MAC address is hexadecimal.

The following True & False statements compare IP addresses & MAC addresses:

True False
Statement
(✓) (✓)

A MAC address is unique to a computer on a network ✓

Once an IP address has been set it cannot be changed ✓

A MAC address is made up of the computer’s serial number and the



IP address

If a computer does not have an IP address, it cannot communicate



with another device using the Internet

237
Exam Style Questions:
Question 1:

Answer:

238
Question 2:

Answer:

239
Question 3:

Answer:

240
3.4.4 Router:

NOTE: Router is a newly added topic in the Computer Science (2210) syllabus for the
session 2023–2025.

It sends data to a specific destination on a network.


It can assign IP addresses.
It can connect a local area network (LAN) to the internet.
It receives and sends data between two networks operating on the same protocol.
It receives packets from a network and forwards packets onto a network.
It stores the IP and/or MAC address of all devices attached to it.
It may contain a firewall/proxy server.
It can be a wired or wireless device.
Role of Router in sending data to a specific destination on a network:
It sends and forwards data packets to their correct destination IP/MAC address.
It contains a routing table which holds the private IP/MAC addresses of the devices.
It uses the routing table to determine the most efficient path for sending data packet to its
correct destination.
If the correct IP/MAC address is not found, it keeps passing on the packets on the same
network until the correct address and device is found.
Hardware components of Router:
A router would typically have an internet cable plugged into it and several cables connecting
to computers and other devices on the LAN.
How a Router can support a universities LAN:
It allows internal connections between the university LANs.
It allows external connection from the main LAN.
Benefits of Wired Router:
1. It provides a faster connection (higher bandwidth) that is suitable for downloading large files
and it has less waiting time/less latency.
2. It provides a more reliable/stable connection, and it is less susceptible to issues with
distance/walls/interference.
3. It is more secure.
Benefits of Wireless Router:
1. It allows freedom of movement, and the user can move between different rooms with a device
and still receive/transmit data.
2. It is easily expanded if other users want to access the same network.
3. It requires less cabling and expertise, making the initial setup less expensive.

241
The following table shows whether the given tasks are performed by the router or not:

Performed by Not performed


Statement
router by router

Receives packets from a device ✓

Finds the IP address of a Uniform Resource Locator (URL) ✓

Directs each packet to all devices attached to it ✓

Stores the IP and/or MAC address of all devices attached



to it

242
Exam Style Questions:
Question 1:

243
Answer:

244

You might also like