Olevels Computer Science Chapter 3
Olevels Computer Science Chapter 3
(Chapter 3)
Syllabus Content:
1
Syllabus Content:
2
Syllabus Content:
3
Syllabus Content:
4
3 Hardware
5
The following diagram is a simple representation of von Neumann CPU architecture:
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
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).
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.
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.
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.
Address Contents
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:
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
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
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 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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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:
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
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.
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.
52
Binary values of:
Binary value of light area = 0
Binary value of dark area = 1
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:
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.
Input and output devices found at the checkout in supermarkets along with Barcode Scanners:
54
Applications of Barcode Scanners:
55
Quick Response (QR) Codes:
QR Codes
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.
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.
60
Keyboards:
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.
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 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:
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”.
66
Optical Mouse:
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
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.
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.
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.
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.
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:
73
Touch Screens:
Touchscreens
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.
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’.
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.
77
The following tables compare capacitive and resistive technologies:
(i) Table 1:
Resistive Capacitive
Statement
(✓) (✓)
This touch screen uses the electrical properties of the human body ✓
(ii) Table 2:
Capacitive Resistive
Statement
(✓) (✓)
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
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
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.
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.
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
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.
104
Sequence of events during printing of Inkjet Printers:
Stage in
Description of what happens
process
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.
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
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.
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
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).
*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.
The finalized drawing is imported into some special software that prepares it in a format
which is understood by the 3D printer.
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:
111
The following tables compare inkjet, laser, and 3D printers:
(i) Table 1:
3D Inkjet Laser
Statement
(✓) (✓) (✓)
(ii) Table 2:
Inkjet Laser
Statement
(✓) (✓)
112
(iii) Table 3:
Inkjet Laser
Statement
(✓) (✓)
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.
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.
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.
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.
Examples of Sensors:
132
Sensors, Description & Example Applications:
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)
133
Sensor Description Example Applications
134
Sensor Description Example Applications
Benefits of using Sensors to monitor the manufacture of plastic pipes by measuring pressure,
temperature, and speed of production:
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.
Pressure It could be used to monitor the level of the water in the washing machine.
136
Example 3:
Identify four sensors that could be used on a farm that grows fruit. State what each sensor
could be used for.
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.
137
Sensor Example of use
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
Example 7:
Sensor Application
138
Example 8:
Sensor Application
Example 9:
Sensor Scenario
Magnetic Field/Pressure/Motion
Counting the number of cars that cross a bridge
/Infrared
Sensor Task
139
Example 11: Washing Machine
Sensor Task
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.
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.
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.
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]
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]
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]
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]
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]
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]
149
3 Hardware
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):
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.
Use of DRAM:
1. DRAM is the most common type of RAM used in computers except for high-speed areas.
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.
(i) Table 1:
DRAM SRAM
Statement
(✓) (✓)
Does not need to be refreshed as the circuit holds the data while
✓
the power supply is on
(ii) Table 2:
SRAM DRAM
Statement
(✓) (✓)
152
(iii) Table 3:
DRAM SRAM
Statement
(✓) (✓)
Needs to be refreshed ✓
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).
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).
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
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
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.
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.
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.
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.
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.
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.
170
Main Advantage of USB Flash Memory:
1. Their main advantage is that they are very small in size which makes them easily portable.
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.
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 is non-volatile storage ✓ ✓
(ii) Table 2:
USB flash
HDD SSD memory
Statement
(✓) (✓) drive
(✓)
It is non-volatile ✓ ✓ ✓
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.
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.
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.
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.
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:
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.
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
(✓) (✓) (✓)
The following table compare Magnetic Storage, Solid-State Storage & Optical Storage:
(ii) Table 2:
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):
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.
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.
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.
210
Exam Style Questions:
Question 1:
211
Answer:
212
Question 2:
213
Answer:
Question 3:
214
Answer:
215
3 Hardware
NOTE: Network Interface Card (NIC) is a newly added topic in the Computer Science
(2210) syllabus for the session 2023–2025.
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)
00:15:E9:2B:99:3C
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.
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.
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.
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:
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:
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
227
The following table compares IPv4 & IPv6 addresses:
IPv4 IPv6
Statement
(✓) (✓)
True False
Statement
(✓) (✓)
IP addresses are used to ensure that messages and data reach their
✓
correct destinations
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.
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.
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
6.0.257.6 Denary Invalid 257 is above 255 // third group is above 255
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.
The following True & False statements compare IP addresses & MAC addresses:
True False
Statement
(✓) (✓)
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.
241
The following table shows whether the given tasks are performed by the router or not:
242
Exam Style Questions:
Question 1:
243
Answer:
244