CS 2210 – Notes Ch 3
CS 2210 – Notes Ch 3
O Levels
Computer Science
CS 2210 – Notes
Chapter No. 3
Hardware
Computer Architecture
Input & Output Devices
Data Storage
Network Interface
2|Page
Step Example
Process If the instruction being executed is ADD, the inputted value is added to an existing value
Output The result of the calculation is outputted to the user via the monitor
A diagram showing the input, process, output sequence followed by computer systems
3|Page
Stores the results of any calculations that have taken place in the
Accumulator ACC
Arithmetic Logic Unit (ALU)
Buses
Components within the CPU and wider computer system are connected by buses
A bus is a set of parallel wires through which data/signals are transmitted from one
component to another
There are 3 types of bus:
5|Page
The data or instructions received from main memory is fetched to the memory data
register (MDR) via the data bus
A copy of the instruction or data is stored in the current instruction register (CIR)
The program counter (PC) increments by 1 so it is pointing to the next instruction to be
executed
Decode stage
During the decode stage of the cycle, the CPU needs to work out what is required from the
instruction
This is done as the instruction is split into two parts:
o Opcode - what the instruction is
o Operand - what to do it to
This could be either data or an address where the data is stored
Execute stage
During the execute stage of the cycle, the CPU will carry out the instruction that was
fetched
Some examples that would take place at this stage are
o Performing a calculation
o Storing a result or data back in main memory (RAM)
o Going to main memory to fetch data from a different location
The important things to remember are:
An instruction or data is fetched from memory
The instruction is decoded
The instruction is executed
The cycle repeats billions of times per second
Examiner Tips and Tricks
Make sure you read the question carefully and look at the number of marks allocated to judge the
level of detail required. Often questions on the fetch-decode-execute cycle only require you to
describe the steps rather than explain how the registers and buses are used during each step
Worked Example
Explain how an instruction is fetched using Von Neumann architecture. [6]
Answer
The Program Counter (PC) holds the address/location of the next instruction to be
fetched [1]
The address held in the PC is sent to the Memory Address Register (MAR) [1]
The memory address is sent using the address bus [1]
The Program Counter is incremented [1]
8|Page
The instruction is sent from the address in memory to the Memory Data Register
(MDR) [1]
The instruction is transferred using the data bus [1]
The instruction is sent to the Current Instruction Register (CIR) [1]
Cache size
Cache is very small, very fast memory on or close to the CPU
Cache is used as temporary storage to provide quick access to a copy of frequently used
instructions and data
The larger the cache size, the more frequently used instructions or data can be stored
This results in the CPU having to complete fewer fetch cycles from memory (RAM),
speeding up the performance
Cache also has a significantly faster read/write speed than RAM, making it much quicker to
retrieve instructions from there instead of from memory (RAM)
Number of cores
A core works like it is its own CPU
Multiple core processors mean they have multiple separate processing units that can fetch,
decode and execute instructions at the same time
For example, a dual-core processor would have 2 processing units, each with their own
o Control Unit (CU)
o Arithmetic Logic Unit (ALU)
o Accumulator (ACC)
o Registers
Multi-core processors can run more powerful programs with greater ease
Multiple cores increase the performance of the CPU by working with the clock speed
o Example: A quad-core CPU (4 cores), running at a clock speed of 3Ghz
4 cores x 3GHz
4 x 3 billion instructions
12 billion instructions per second
10 | P a g e
Worked Example
One computer has a single core processor and the other has a dual core processor.
Explain why having a dual core processor might improve the performance of the computer.[2]
Answer Any 2 from:
The computer with the dual core processor has two cores/double the amount of cores [1]
Parallel processing can take place [1]
Each core can execute a separate instruction at the same time [1]
Each core can process instructions independently of each other [1]
Subtract SUB 00100010 Subtract a value from the values stored in the accumulator
Worked Example
Using the instruction set in the table above what would be the operation if the instruction was
00100010 00000010? [1]
Answer
Either of:
The operation would be SUB [1]
If the operand was raw data the complete instruction would be to subtract 2 from the
value in the accumulator [1]
Embedded Systems
What is an embedded system?
An embedded system is a computer system which is used to perform a dedicated function,
inside a larger mechanical unit
Examples of embedded systems include
o Heating thermostats
o Hospital equipment
o Washing machines
o Dishwashers
o Coffee machines
o Satellite navigation systems
o Factory equipment
o Security systems
o Traffic lights
12 | P a g e
Laptop
Washing Machine
Mobile Phone
Washing Machine ✓
Input Devices
What is an Input Device?
Input devices are hardware components that allow users to interact with a
computer system
They enable the user to input data or commands into the system, which
the computer then processes to produce an output
Captures
photographs Photography
Digital or videos as Smartphones High-quality visual content
Camera digital Webcams
images
Inputs text
and Computers Type documents
commands Tablets Enter data
Keyboard
by pressing Laptops Control software
keys
Captures
analogue Recording
sound and studios Audio recording
Microphone converts it Smartphones Voice communication
into digital Computers
signals
Moves the
cursor on
the screen
based on Computers Precise control and navigation on a
Optical
hand Laptops computer screen
Mouse
movements
over a
surface
stored
information
Detects
ATMs
touch by
Touch Older
pressing a Direct interaction with the device
Screen smartphones
flexible
(Resistive) and tablets
screen layer
Detects
touch by
interrupting Kiosks
Touch Accurate touch detection
infrared Large touch
Screen Works well in various lighting conditions
light beams displays
(Infra-red)
across the
screen
Detects
touch
Modern
through
smartphones
Touch changes in Smooth, responsive touch experience with
Tablets
Screen electrical multi-touch capabilities
Touch
(Capacitive) charge on
monitors
the screen
surface
Captures
Two- flat, 2D Offices
Digitises documents and photos for
Dimensional images of Libraries
storage, editing, or sharing
(2D) documents Schools
Scanner or photos
Captures
Manufacturing
Three- detailed 3D
Design Creates digital models of objects for
Dimensional shapes and
Medical design, analysis, or reproduction
(3D) dimensions
imaging
Scanner of objects
15 | P a g e
Output Devices
What is an Output device?
Output devices are hardware components that receive information from a computer system
and present it to the user in an understandable form
They enable the computer to communicate the results of processed data or commands
Types of output devices
Cinemas
Digital Light Projects images onto a screen High-
Classrooms
Processing (DLP) Shows images or video by shining quality
projector light through tiny mirrors Large images
presentations
High-
quality
Heat from a laser fuses toner (fine Offices
Laser printer prints
powder) onto paper Schools
Fast print
speed
High-
quality
Televisions images
Light Emitting Displays images and video using Computer Bright
Diode (LED) screen tiny lights called LEDs monitors
Energy
Smartphones efficient
Thin
Bright
Offices
Liquid Crystal Projects images or video onto a Excellent
Display (LCD) screen by shining light through Classrooms balance of
projector liquid crystal panels quality and
Home cinemas
affordability
16 | P a g e
Energy
Televisions efficient
Liquid Crystal Monitors Thin
Displays images and video using
Display (LCD)
liquid crystals with a backlight Smartphones Sharp
screen
images
Laptops
Lightweight
Televisions
Converts electrical signals into Multiple
Speaker analogue sound waves to play Radios shapes and
music sizes
Smartphones
Manufacturing
Create
Adds thin layers of plastic, one on Medicine prototypes
3d printer top of another to form a three
dimensional object Education Custom
parts
Home
Sensors
Sensors are input devices
They measure a physical property of their environment such as light levels, temperature or
movement
Sensors can be used for monitoring systems and control systems
o A monitoring system tracks the state of a system, it gathers data and may
issue warning messages
o A control system will control the system based upon the input from sensors
o For example, if the water temperature in a fish tank fell below the acceptable level, a
control system would start up a heater
o The system will then continue to check the water temperature readings (outputs)
and when they are within the acceptable range it will switch off the heater
A process where outputs are recycled and used as inputs, creating a continuous cycle is
called a feedback loop
Examiner Tips and Tricks
You are likely to be given a scenario and asked to identify the sensors that would be used.
The 14 sensors you need to be aware of are in the table below
Worked Example
What type of sensor would be used to help drivers when reversing? [1]
A Motion
B Infra-red
C Light
D Proximity
A Monitoring
B Control
Answer
A Motion
B Infra-red
C Light
D Proximity
A Monitoring
19 | P a g e
B Control
Primary Storage
Primary storage is directly accessed by the CPU
Computer systems need both primary and secondary storage to operate
Both types of storage play a crucial role in the operation of a computer system
A quick comparison of primary and secondary storage shows:
Primary Secondary
A smart television allows the user to search the Internet and watch videos online.
The smart television uses RAM
Give two examples of data that the smart television could store in RAM [2]
How to answer this question
Think about the main function of a smart television, watch channels, use apps to stream
content and browse the web etc
For each function, try to think of what data would have to be in the RAM whilst you were
actually doing it (in use!)
Possible answers
Current channel being watched
Current volume
Current video/file/tv program being watched
Web browser/applications that are running
Data being downloaded/buffered
Examiner Tips and Tricks
Examiners will accept anything reasonable when answering these style of questions BUT brand
names will not be be awarded without giving an example
ROM
What is ROM?
ROM (Read Only Memory) is primary storage that holds the first instructions a computer
needs to start up (Bootstrap)
ROM contains the BIOS (Basic Input Output System)
ROM is a small memory chip located on the computers motherboard
ROM is fast memory, much faster than secondary storage but slower than RAM
ROM is non-volatile which means the contents of ROM are not lost when the power is turned
off
ROM is read only which means data can only be read from
In comparison to RAM, it has a much smaller capacity
Examiner Tips and Tricks
RAM & ROM are examples of primary storage, they can be referred to as Main Memory or Primary
Memory in the exam
Worked Example
Quinn has 512 kilobytes of ROM and 16 gigabytes of RAM in her computer
1. Describe the purpose of the ROM in Quinn's computer [2]
2. Describe the purpose of the RAM in Quinn's computer [2]
Answer
21 | P a g e
1. ROM
Store start-up instructions/bootstrap
Used to start the computer
2. RAM
Stores the parts of the OS / programs that are running
Stores data currently in use
...for access by the CPU
Guidance
Do not confuse the purpose with characteristics, describe what it does, not what it is
Secondary Storage
Storage devices are non-volatile secondary storage, that retain digital data within a
computer system
They provide a means of storing, accessing, and retrieving data, which can include software
applications, documents, images, videos, and more
There are 3 types of storage:
o Magnetic
o Solid-state (flash memory)
o Optical
Computer systems need both primary and secondary storage to operate
Both types of storage play a crucial role in the operation of a computer system
A quick comparison of primary and secondary storage shows:
Primary Secondary
Speed - How fast can data be read from and written to? (R/W)
Cost - How much does it cost?
Portability - How easy is it to move around? What is the physical size? Weight?
Durability - How robust is the storage?
Reliability - What is the probability that the device will consistently perform its function?
Worked Example
A games console has secondary storage.
State, using an example, why the games console needs secondary storage [2]
How to answer this question
They keyword is 'why', why does a games console need secondary storage? give an example,
do not just describe what secondary storage is!
Answer
To store data once the power is turned off / permanently // for non-volatile storage
Examples could include:
o Storing games
o Save games
o User data/profiles
o Downloaded content/applications/updates
Magnetic Storage
What is magnetic storage?
Magnetic storage is a type of non-volatile media that uses magnets (polarity) to store binary
0s and 1s
A magnetic hard disk is made up of several metal discs coated with a magnetic material
o These are called platters
o Iron particles on each platter are magnetised to represent a 0 or 1
Each platter is divided by concentric circles creating several tracks and wedge shaped sectors
23 | P a g e
The hard drive spins the metal disk(s) at a high speed (typically around 5400-7200 RPM)
using a motor
A read/write arm, controlled by an actuator, moves the head over the surface of the disc to
the location of the data
The data is read/written using electromagnets
Advantages Disadvantages
Capacity - High storage Durability - Moving parts can get damaged if dropped
It uses NAND and NOR gates in electrical circuits to persistently control the flow of
electrons
Solid-state (flash memory) is memory made up of tiny cells that can contain one bit of
data (1 or 0)
Each cell contains a transistor that acts as a switch that can be turned on or off
The transistor contains two main parts:
o Control gate - top layer of transistor, connects to circuit and controls if current can
flow through the transistor
o Floating gate - can hold a charge (like a tiny rechargeable battery) and is sandwiched
between two layers of insulating material (Oxide)
To store data a charge is placed on the floating gate
o A high voltage is applied to the control gate, which allows electrons to be pushed
through the oxide layer and onto the floating gate
To remove data, a high voltage charge is applied in the opposite direction, pulling the
electrons off the floating gate
Advantages Disadvantages
Noise - Silent
Optical Storage
What is optical storage?
Optical storage is a type of non-volatile media that uses lasers to burn the surface of a disk,
creating pits and lands suitable for storing binary 0s and 1s
Examples of optical storage include:
o Blu-rays have the largest capacity
o CDs have the lowest capacity
o CD-R are read-only (you cannot save data on to them)
o CD-RW can be written to and read from
25 | P a g e
All optical devices work by shining a laser at the disk and processing the reflection
An arm moves the laser across the surface of the disk
In CD-Rs a laser burns the data, permanently on to the disk, by creating pits and lands
The laser is also used to read the data from the pits and lands
When the laser light hits the point where the pit changes into a land or vice versa the light
scatters and is not reflected back as well.
This is captured by a sensor and can be interpreted as a change in the binary value
Advantages Disadvantages
Noise - Silent
Worked Example
Zarmeen has purchased a new tablet computer. The tablet has an internal secondary storage device.
The storage device is a solid state device.
1. Give three benefits of the tablet having a solid state device instead of a magnetic device [3]
2. Give two drawbacks of the tablet having a solid state device instead of a magnetic device [2]
Answers
Benefits
o Faster access / read/write speeds
o Smaller in physical size
o More durable // no moving parts
Drawbacks
o More expensive (per gigabyte)
o Smaller capacity (usually)
o Limited number of read/write cycles
Guidance
26 | P a g e
In the example above, the computer is turned on and the elements of the operating system are
loaded into RAM
The user opens some spreadsheet and video editing software but RAM is full
The program not currently being used (video editing) is transferred to virtual memory
When the user wants to use the video editing software again, it is transferred back from
virtual memory to RAM
27 | P a g e
Case Study
A student uses software to create 3D models.
3D modelling often means processing large amounts of data
This takes up a large amount of RAM
If there is not enough physical RAM, virtual memory is used to:
o Extend the RAMs capacity
o Ensure the software does not freeze/crash when RAM gets full
Worked Example
A computer only has 4GB of RAM, Fynn says that virtual memory can be used instead of adding
more RAM.
1. Explain how virtual memory can compensate for the lack of RAM in Fynn's computer [3]
2. Explain why it would be beneficial for Fynn to get more RAM instead of relying on virtual
memory [2]
How to answer these questions
1. What is the definition of virtual memory? how does it work?
2. What is the downside of using virtual memory? turn this into an advantage of adding more
RAM
Answers
How can Virtual Memory compensate
o Virtual Memory is used when RAM is full
o ...part of the secondary storage used as (temporary) RAM
o Data from RAM is moved to the secondary storage/Virtual Memory (to make space in
RAM)
o RAM can then be filled with new data
o When data in Virtual Memory is needed it is moved back to RAM
Benefit of more RAM
o More RAM will improve the performance of the computer // More RAM will speed
up the access to data
o Virtual Memory is slower to access than RAM direct (because it has to go back to
RAM first)
o Moving data between RAM and VM takes processor time
28 | P a g e
Cloud Storage
What is cloud storage?
Cloud storage is a term to describe long-term (secondary) storage of data that resides in
a remote location, accessible only via a wide area network (Internet)
Data is stored on remote servers, typically using magnetic storage (HDD), but increasingly
using solid state (SSD)
Advantages Disadvantages
Cost - Typically a
Reliability - Access data anywhere, any time, from any device monthly/yearly subscription
plan
Availability - No access
Security - Automatic backups
without an internet connection
Capacity - Endless storage space (cost permitting), uses less space on own
device
Collaboration - Multiple people can access the same file at the same time
Benefit Explanation
Data can be accessed by anyone with the relevant permissions, making it quick to
share files and collaborate with others
Data can be accessed on any device with an internet connection
Cloud storage providers often use multiple servers to store and backup data, reducing
Reliability
the risk of data loss due to hardware failure
but the school is still legally responsible if data is accessed by unauthorised people [1]
Data stored on the cloud could be hacked or intercepted [1]
Explain two advantages to the school of storing their data in the cloud.
[4]
Additional storage can be purchased if needed [1]
The cloud hosting company provides back up [1]
The cloud hosting company provides security [1]
Data can be accessed from anywhere and from any device provided there is an internet
connection [1]
So teachers would be able to access data from home [1]
So students would be able to access work from home [1]
MAC Addresses
What is a MAC address?
A MAC (Media Access Control) address is a unique identifier given to devices which
communicate over a local area network (LAN)
A network interface card is given a MAC address at the point of manufacture
MAC addresses are static, meaning they can never change
MAC addresses make it possible for switches to efficiently forward data to the
intended recipient
Any device that contains a Network Interface Card (NIC) has a MAC address assigned
during manufacturing
A device connecting to a local network already has a MAC address, if it moves to a different
network then the MAC address will stay the same
A MAC address is represented as 12 hexadecimal digits (48 bits), usually grouped in pairs
The first three pairs are the manufacturer ID number (OUI) and the last three pairs are
the serial number of the network interface card (NIC)
There are enough unique MAC addresses for roughly 281 trillion devices
IP Addresses
What is an IP address?
32 | P a g e
IPv4 provides over 4 billion unique addresses (232), however, with over 7 billion people
and countless devices per person, a solution was needed
IPv6
Internet Protocol version 6 is represented as 8 blocks of 4 hexadecimal digits, separated
by colons
Each block is 2 bytes (16 bits), each address is 16 bytes (128 bits)
IPv6 could provide over one billion unique addresses for every person on the planet (2128)
Worked Example
Computers in a network can be identified using both IP addresses and MAC addresses.
Describe two differences between IP addresses and MAC addresses [2]
Answer
IP address is dynamic/can change // MAC address is static/cannot change
IP address is used to communicate on a WAN/Internet // MAC address is used to
communicate on a LAN
Router
33 | P a g e
What is a router?
The router is responsible for routing data packets between different networks
An example of data the router can direct is, sending internet traffic to the correct
destination/devices in your home network
The router connects networks together, local area networks (LAN) to the wider internet which
is a type of wide area network (WAN)
The router can manage and prioritise data traffic, which can help to keep connections stable
The router will assign IP addresses to the devices on the network
Image of a router