Uni3 - Revision 1
Uni3 - Revision 1
1
3.1.1 Understand the role of CPU in a computer system
● The CPU, often referred to as the "brain" of the computer, is an electronic chip
known as a microprocessor.
● It fetches instructions from the computer's main memory (RAM), decodes them,
and executes them as provided by a computer program.
● The CPU's primary purpose is to process data, including tasks such as searching,
sorting, calculating, and decision-making within the computer.
● Regardless of the activity performed on a computer, such as writing an essay,
viewing photographs, or checking emails, the CPU handles all the necessary data
processing and computations.
● In addition to data processing, the CPU also controls other component parts of
the computer.
3.1.2 Understand the purpose of the components in a CPU, in a computer that has a
Von Neumann architecture
2
The Von Neumann architecture- main features
Components of CPU
CPU includes
● Arithmetic and logic unit (ALU)
● Control unit (CU)
● registers
● buses
● System clock
ALU
● ALU stands for Arithmetic and Logic Unit, capable of performing ADD, SUBTRACT,
AND, OR, and NOT operations.
3
● The result of the ALUs calculations is stored in memory. This memory is usually a
very fast kind of memory called a 'register', located as close to the ALU as possible
inside the CPU.
CU
● The control unit controls the operation of the computer’s ALU, memory and
input/output devices, telling them how to respond to the program instructions it has
just read and interpreted from the memory unit.
● The control unit also provides the timing and control signals required by other
computer components.
Buses
● Buses are the means by which data is transmitted from one part of a computer to
another, connecting all major internal components to the CPU and memory.
4
Registers
Registers are high-speed storage areas in the CPU. All data must be stored in a register
before it can be processed.
MAR Memory Address Register Holds the memory location of data that needs
to be accessed
MDR Memory Data Register Holds data that is being transferred to or from
memory
AC Accumulator Where intermediate arithmetic and logic
results are stored
PC Program Counter Contains the address of the next instruction to
be executed
CIR Current Instruction Register Contains the current instruction during
processing
System clock
● The clock sends out regular electrical pulses which synchronize (keep in time) all
the components.
5
● The frequency of the pulses is known as clock speed.
● Clock speed is measured in hertz. The higher the frequency, the more
instructions can be performed in the given time.
● The RAM holds all the data and programs needed to be accessed by the CPU.
● The RAM is often the CPU that transfers data and programs from the slower
backing store (e.g., hard disk drive) to RAM temporarily.
● This is done to speed up operations because accessing data from RAM is much
faster than accessing it from the backing store. referred to as the Immediate
Access Store (IAS)
Memory(Page no 78)
6
Write signal is sent to the memory.
· Value 1001 0101 is written to the specified memory location.
● The Fetch-Decode-Execute cycle is the basic method used by the CPU to carry
out a single instruction contained in a computer program.
● The diagram below shows how each step relates to one another. First, there is a
fetch operation followed by a decode operation and then an execute operation.
Then another fetch begins and the cycle starts all over again.
● Usually, the operating system loads it, ready for the CPU to use. The very first
instruction in the program needs to be loaded into the CPU (fetch)
● The fetch action loads an instruction into the CPU then the decode and execute
stage takes place inside the CPU. Once the first cycle is complete, the CPU
fetches the next instruction.
7
Fetch
The fetch operation is responsible for getting an instruction or data from the main
memory into the CPU.
Let's look at a program that begins at location 305 in the main memory.
Step 1
Step 2
During the first stage of the fetch
cycle, the program counter value is
copied into the Memory Address
Register (MAR).
Step 3
8
Step 4
Now the instruction is passed across
the data bus and copied into the
Memory Data Register.
Step 5
Then the instruction in the MDR is
copied into the Instruction Register
so that it is ready to use during the
next stage (decode)
Step 6
The program counter is now
incremented by one location,
changing it to 306 so that it is ready
to begin the next fetch cycle.
Decode
In the 'decode' stage, the control unit reads the Instruction Register (Add #5) and makes
sure that it is an instruction that the CPU can carry out i.e. it is in its instruction set. If it
is, then various parts of the CPU are prepared for the next stage, which is the 'Execute'
stage.
9
Execute
The final stage of the cycle is called 'execute' which just means carrying out the
instruction that has been decoded. In this case, the instruction is to add 5 to the value in
the accumulator.
Summary of F-D-E
Fetch:
● PC copies the address of the next instruction to Memory Address Register (MAR).
● MAR places the instruction address on the address bus. This causes the data in
memory stored at that address to be loaded into the Memory Data Register (MDR).
10
● Instruction Register (IR) (also the Current Instruction Register (CIR) ) loads the
instruction from the MDR
Decode:
● CU: Determines (decodes) what is required to complete the instruction pending in the
IR.
Execute:
The Accumulator is used as an internal “working memory” register for the ALU.
11
3.2 Understand what is meant by a core, cache, and clock in a CPU and explain how
they can affect the performance of a CPU
● The CPU is responsible for carrying out all instructions for all programs that the
computer is running. More than any other component, the quality of the CPU
affects the computer's performance.
● These include:
Adjusting the clock
Adjusting the processing cores
Adjusting the cache memory
● The clock is a quartz crystal on the CPU chip that sends out regular electrical
pulses.
● The CPU uses these pulses to keep time, fetching a new instruction with every
tick of the clock.
● Every CPU has its own clock, and these clocks can tick at different rates. The
faster the clock ticks, the more instructions are carried out per second.
● However, using a clock speed higher than the computer was designed for can
lead to seriously unsynchronised operations and the computer would frequently
crash and become unstable. Overclocking can lead to serious overheating of the
CPU again leading to unreliable performance.
12
A 'core' is a complete processing unit within the CPU - it has an ALU, a control unit and
memory in the form of registers
● A cpu with two cores is called a 'dual core' and one with four cores is called a
'quad-core'.
● The idea of using more cores alleviates the need to continually increase clock
speeds. However, doubling the number of cores doesn’t necessarily double the
computer’s performance since we have to take into account the need for the CPU
to communicate with each core; this will reduce overall performance.
● Multi-tasking
Multi-tasking is the ability to carry out more than one task at the same time. With
two cores, a CPU can run two tasks simultaneously.
● Parallel Processing
Parallel processing is when a single task (program) is split into two or more parts
and each part is processed at the same time.
3.2.3 Cache
● As the CPU processes instructions, it needs to fetch instructions and data from
the program. These are stored in main memory (random access memory or
RAM).
13
● However, RAM is comparatively slow for the CPU to access and retrieve data
from. To overcome this issue, a special type of memory called the cache, is used.
● The cache acts as a buffer, helping to speed up the transfer of data between the
CPU and RAM.
● Cache memory stores frequently used instructions and data that need to be
accessed faster, which improves CPU performance.
● When a CPU wishes to read memory, it will first check out the cache and then
move on to main memory/RAM if the required data isn’t there.
● The larger the cache memory size the better the CPU performance.
● Increasing bus width (data and address buses) increases the performance and
speed of a computer system
However, using a clock speed higher than the computer was designed for can
lead to seriously unsynchronised operations and the computer would frequently
crash and become unstable. Overclocking can lead to serious overheating of the
CPU again leading to unreliable performance.
Unlike RAM, cache memory is located within the CPU itself, which means it has
much faster data access times than RAM.
The idea of using more cores alleviates the need to continually increase clock
speeds. However, doubling the number of cores doesn’t necessarily double the
computer’s performance since we have to take into account the need for the
CPU to communicate with each core; this will reduce overall performance.
● Graphics cards
● More RAM
● Faster RAM
● More secondary storage
14
● Faster secondary storage
● Defragmenting secondary storage
● Correct operating system
● Updated operating system and drivers
● Run a malware and virus scan
● Upgrading CPU, from within the same family
15
●
Read Pages 83,84 and 85 for few detailed examples of embedded systems
● A barcode is a series of dark and light parallel lines of ● much easier and faster
varying thicknesses. ● more up-to-date sales
information
16
● The numbers 0 to 9 are each represented by a unique ● no need to price every stock
series of lines. item on the shelves
● read by a red laser or red LED ● allows for automatic stock
● Light is reflected back off the barcode; control
● the reflected light is read by sensors (photoelectric ● possible to check customer
cells) buying habits
● a pattern is generated, which is converted into digital
data
Other input/Out devices associated with barcode: Keypad, Screen, Speaker, Card
reader, Touchscreen
2. QR Code Scanner
● This is made up of a matrix of ● They can hold much ● More than one
filled-in dark squares on a more information QR format is
light background ● There will be fewer available
● It can presently hold up to errors; ● QR codes can be
4296 characters (or up to 7089 ● QR codes are easier to used to transmit
digits read malicious codes
● also allows internet ● It is easy to transmit QR
addresses to be encoded codes
within the QR code.
● The three large squares at the
corners of the code function
as a form of alignment;
3. Digital cameras
Features and Working
17
● the image is captured when light passes through the lens onto a light-sensitive cell;
● each of the sensors is often referred to as pixels
● the image is converted into tiny electric charges which are then passed through an ADC
● the ADC converts the electric charges from each pixel into levels of brightness
● the quality of the image depends on the recording device, the number of pixels the levels
of light and how the image is stored
4. Keyboards
Features and Working
● used as the input devices on computers, tablets, mobile phones, and many other electronic
items
● Each character on a keyboard has an ASCII value. Each character pressed is converted into
a digital signal, which the computer interprets.
● There is a membrane or circuit board at the base of the keys
● When a key is pressed, the CPU in the computer can then determine which key has been
pressed
5. Microphones
Features and Working
● Microphones are either built into the computer or are external devices connected through
the USB port or using Bluetooth connectivity.
● When sound is created, it causes the air to vibrate.
● When a diaphragm in the microphone picks up the air vibrations, the diaphragm also
begins to vibrate.
● A copper coil is wrapped around the cone which is connected to the diaphragm.
● As the diaphragm vibrates, the cone moves in and out causing the copper coil to move
backwards and forwards causing an electric current.
● The electric current is then either amplified or sent to a recording device. The electric
current is analog in nature.
6. Optical mouse
Features and Working
18
● Benefits of an optical mouse over a mechanical mouse » There are no moving parts,
therefore it is more reliable. » Dirt can’t get trapped in any of the mechanical components. »
There is no need to have any special surfaces.
● A wired mouse has the following advantages: » no signal loss since there is a constant
signal pathway (wire) » cheaper to operate (no need to buy new batteries or charge
batteries) » fewer environmental issues (no need to dispose of old batteries).
7. 2D scanners
Features and Working
2D scanners are used at airports to read passports. They make use of OCR technology
to produce digital images which represent the passport pages. At many airports the
two-dimensional photograph in the passport is scanned and stored as a JPEG image.
The passenger’s face is also photographed using a digital camera. The two digital
images are compared using face recognition/detection software. Key parts of the face
are compared.
8. 3D scanners
Features and Working
19
Computed tomographic (CT) scanners are used to create a 3D image of a solid object.
● builds up an image of the solid object through a series of very thin ‘slices’.
● Each of these 2D ‘slices’ make up a representation of the 3D solid object
Touch screens allow the user to carry out the same functions as they would with a
pointing device, such as a mouse.
Capacitive Infrared » Resistive (most
common method at the
moment).
20
● Better image clarity than resistive ● It is possible for
screens, especially in strong accidental activation
sunlight to take place if the Advantages
● Very durable screens that have infrared beams are Good resistance to dust
high scratch resistance disturbed in some and water
● Projective capacitive screens allow way Can be used with bare
multi-touch. ● Sometimes sensitive fingers, stylus, and
to light interference. gloved hand.
Disadvantages
Disadvantages
● Low touch sensitivity
● Doesn’t support
● Surface capacitive screens only
multi-touch facility
work with bare fingers or a special
● Poor visibility in
stylus
strong sunlight
● They are sensitive to
● Vulnerable to
electromagnetic radiation
scratches on the
screen
1. Actuators
21
● this beam of light is then sent to a group
micromirrors tilt towards the light of chromatic-coated mirrors
source- ON. tilt away from the light ● these reflect the light back at different
source- OFF. wavelengths
● when the white light hits these mirrors,
A bright white light source passes the reflected light has wavelengths
through a color filter on its way to the corresponding to red, green and blue light
DMD chip. components
● these three different colored light
components pass through three LCD
screens
● consequently, three different versions of
the same image are now produced
● these images are then re-combined using a
special prism to produce a full-color
image
● Finally, the image passes through the
projector lens onto a screen.
Advantages Advantages
● higher contrast ratios ● give a sharper image than DLP projectors
● Higher reliability/longevity ● have better color saturation than DLP
● quieter running than LCD projectors
projector ● more efficient in their use of energy than
● uses a single DMD chip, which DLP technology – consequently they
means no issues lining up the generate less heat
images
● smaller and lighter than LCD
projector Disadvantages
● they are better suited to dusty
or smoky atmospheres than LCD ● although improving, the contrast ratios are
projectors not as good as DLPs
Disadvantages ● LCD projectors have a limited life (that is,
the longevity is not as good as DLPs)
● Image tends to suffer from ● since LCD panels are organic in nature,
‘shadows’ when showing a moving they tend to degrade with time (screens
22
image turn yellow and the colors are
● DLP do not have gray subsequently degraded over time)
components in the image
● the color definition is
frequently not as good as LCD
projectors because the color
saturation is not as good (color
saturation is the intensity of a color)
3. Printer
● Inkjet printers are often used for ● These devices produce high-quality
printing one-off photos or where printouts and are very fast when making
only few pages of good quality, multiple copies of a document; any
color printing is needed; application that needs high-volume
● Inkjet printers are essentially made printing
up of:
» a print head, which consists of ● Laser printers use dry powder ink rather
nozzles that spray droplets of ink than liquid ink and make use of the
onto the paper to form characters properties of static electricity to produce
The ink droplets are produced the text and images.
currently using two different
technologies: Refer to 105 for the steps
23
each nozzle. The crystal is given a
tiny electric charge which makes it
vibrate. This makes the ink to be
ejected to the paper
Advantages
Disadvantages
4. 3D printers
The solid object is built up layer by layer using materials such as: powdered
resin, powdered metal, paper or ceramic.
Direct 3D printing uses inkjet technology; a print head can move left to right as
in a normal printer.
Binder 3D printing is similar to direct 3D printing and uses two passes for each
of the layers; the first pass sprays dry powder and then on the second pass a
binder (a type of glue) is sprayed to form a solid layer.
Uses of 3D printing - covering of prosthetic limbs, making items to allow
precision reconstructive surgery (e.g. facial reconstruction following an accident);
24
5. LED and LCD screens
LED LCD
● An LED screen is made up of tiny light emitting ● LCD screens are made up of tiny liquid
diodes (LEDs). Each LED is either red, green or crystals. These tiny crystals make up an
blue in color. array of pixels that are affected by changes in
● This type of screen tends to be used for large applied electric fields.
outdoor displays due to the brilliance of the ● Because LCD’s don’t produce any light,
colors produced. LCD screens are back-lit using light emitting
diode (LED) technology
Organic light emitting diodes (OLED) ● Use of LED backlighting gives a very
good contrast and brightness range.
Use of organic light emitting diodes (OLEDs). Before the use of LEDs, LCD screens
used cold cathode fluorescent lamps
Advantages of using OLED compared to (CCFL) as the back-lit method.
existing LEDs and LCDs:
Advantages of LCD
● The plastic, organic layers of an OLED are
thinner, lighter and more flexible than the ● The main advantage of LCD is, it is low
crystal structures used in LEDs or LCDs. cost and energy-efficient and has very
little power consumption.
● LCD provides excellent resolution,
● The light-emitting layers of an OLED are brightness, and contrast so the picture
lighter; OLED layers can be made from quality is crystal clear.
plastic rather than the glass as used in ● It gives perfect sharpness at the native
25
LED and LCD screens. resolution.
● Generate less heat during operation
due to its low power consumption.
● It is not affected by the magnetic field
● OLEDs give a brighter light than LEDs.
and has no geometric distortion.
○ OLEDs do not require backlighting
● Due to high peak intensity, they
like LCD screens– OLEDs generate
produce very bright images as the
their own light.
brightness range of LCDs is high
Disadvantages
● Since OLEDs require no backlighting, ● It needs extra light sources.
they use much less power than LCD ● It has also a restricted viewing angle.
screens (most of the LCD power is used ● Its speed is very slow.
to do the backlighting); this is very
important in battery-operated devices
such as mobile phones.
26
■ LEDs consume very little power which
means they produce less heat as well as
using less energy.
6. Loudspeakers
Loudspeakers are output devices that produce sound. When connected to a computer
system, digitized sound stored on a file needs to be converted into sound as follows:
» The digital data is first passed through a digital to analog converter (DAC) where it is
changed into an electric current.
» This is then passed through an amplifier (since the current generated by the DAC will
be very small); this creates a current large enough to drive a loudspeaker.
» This electric current is then fed to a loudspeaker where it is converted into sound.
3.2.3 Sensors
● Sensors are input devices which read or measure physical properties from their
surroundings.
● Sensors are used in both monitoring and control applications.
● Sensors used in various applications
27
PH sensor -acidity levels in the soil in a greenhouse
cars ● Light sensor- switch on car headlights automatically when it gets dark
● Infrared sensor- Helps to turn on car windscreen wipers automatically
● Gas sensor - monitor oxygen levels in a car exhaust
● Magnetic sensor- used in anti-lock braking systems in cars
● Accelerometer- anti-lock braking systems in cars
● Liquid level sensor- monitor levels in a petrol tank in a car
● Accelerometer- used in cars to measure rapid deceleration
Mobile ● Proximity sensor- detect when a face is close to a mobile phone screen
● Accelerometer- change between portrait and landscape mode
28
control applications monitoring applications
Examples Examples
Monitoring of a patient in a hospital Turning street lights on
intruders in a burglar alarm Controlling the temperature in a central
Monitoring pollution levels in a river heating/air conditioning system
Chemical process control
Steps for any control applications 1. Steps for monitoring applications
29
4. If new data is outside the acceptable 5. If the new data is outside the
range, a warning message is sent to a acceptable range, the
screen or an alarm is activated computer/microprocessor sends
signals to control valves, motors,
etc via DAC
3.3 Memory
Contains RAM, ROM and cache Examples include HDD, SSD, DVD,
memory memory stick, Blu-ray disc
used to store data, files, part of an always used to store BIOS and other
application or part of the operating data needed at startup
system currently in use Used to boot up the computer when
power is turned on
30
it is volatile, which means memory they are non-volatile (the contents are
contents are lost when powering off not lost after powering off the
the computer computer)
● Two types of RAM- SRAM and DRAM (Static RAM, Dynamic RAM)
DRAM SRAM
To store information for a longer time, Capacitors are not used hence no
the contents of the capacitor need to refreshing is required.
be refreshed periodically.
These are used in cache memories. These are used in main memories.
31
** Applications of RAM and ROM other than computers
Example- RAM and ROM in a remote-controlled toy car
ROM RAM
32
2. SSD(Solid State Drives)
● No moving parts and data is retrieved at the same rate.
● don’t rely on magnetic properties.
● store data by controlling the movement of electrons within NAND
or NOR chips.
● The data is stored as 0s and 1s in millions of tiny transistors
● At each junction one transistor is called a floating gate and the
other is called a control gate within the chip.
● This effectively produces a nonvolatile rewritable memory.
Drawback of SSD
Most solid state storage devices are conservatively rated at only 20GB of write
operations per day over a three year period . It specifically refers to the maximum
amount of data that can be written to the device.
33
● Used to store expensive software and additional files to run the software
to avoid illegal access
3. Optical media
Virtual Memory
● The purpose of RAM is to store current data and program instructions in use
● The amount of physical RAM available is limited. The average modern desktop
computer has between 4GB and 16GB of RAM. Some programs are larger than this
● Virtual memory is part of secondary storage which acts as RAM when RAM is full
● It prevents the computer system crashing when RAM is full
34
● Data that needs to be accessed by the CPU directly is switched by the operating
system from virtual memory into RAM and an inactive page from RAM replaces it in
virtual memory. This is called page switching(Paging)
● The table describes the steps that are taken when a program is opened on a computer
Step Description
2 ● If RAM is full, the memory manager will move out the most
inactive pages of data and put them in virtual memory until
needed
Drawback
35
Disk thrashing and thrash point
● As main memory fills, more and more data needs to be swapped in and out of
virtual memory leading to a very high rate of hard disk read/write head
movements; this is known as disk thrashing.
● A point can be reached when the execution of a process comes to a halt since the
system is so busy moving data in and out of memory rather than doing any
actual execution – this is known as the thrash point.
Cloud storage
Cloud storage is a method of data storage where data is stored on remote servers.
» Public cloud – this is a storage environment where the customer/client and cloud
storage provider are different companies
Hybrid cloud – this is a combination of the two above environments; some data
resides in the private cloud and less sensitive/less commercial data can be accessed
from a public cloud storage provider.
36