0% found this document useful (0 votes)
46 views

Chapter 3 (Computer Science)

Uploaded by

basiltoosy1218
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Chapter 3 (Computer Science)

Uploaded by

basiltoosy1218
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Chapter 3: Hardware

Computer Architecture:
Central processing unit:
 The CPU, also known as a microprocessor or processor, is the central component of modern
computer systems, including tablets and smartphones.
 It is typically installed as an integrated circuit on a single microchip and is responsible for
processing all instructions and data in a computer application.
 It consists of a control unit, arithmetic and logic unit, registers, and buses.

Von Nuemann architecture:


 Early computers were limited in their ability to store programs or data, requiring significant human
intervention.
 In the mid-1940s, John von Neumann introduced the ‘stored program computer' concept, which has
been the foundation of computer architecture ever since.
 This architecture introduced a central processing unit (CPU), which could directly access memory,
stored programs and data, and execute instructions in sequential order.
 This innovation was not available in computers prior to the mid-1940s.

1|Page
Components of the central processing unit (CPU):
The main components of the CPU are the Control Unit (CU), Arithmetic & Logic Unit
(ALU) and system clock.
Arithmetic & Logic Unit (ALU):
 The Arithmetic & Logic Unit (ALU) is a computer component that enables the execution of
arithmetic (e.g. +, - and shifting) or logic operations (e.g. AND, OR) during program execution.
 It can be equipped with multiple Alu’s for specific functions, such as multiplication and division,
which involve addition, subtraction, and logical shift operations.

Control Unit (CU):


 The control unit reads an instruction from memory, stores its location in the Program Counter (PC),
and interprets it using the Fetch–Decode–Execute cycle.
 Signals are generated along the control bus to instruct other computer components, ensuring data
flow and program instructions synchronization throughout the computer.
 A system clock is used to produce timing signals on the control bus to ensure this vital
synchronisation takes place – without the clock the computer would simply crash!
 RAM, also known as the Immediate Access Store (IAS), is a crucial storage system for CPU data
and programs.
 The CPU temporarily stores these data and programs in RAM, allowing faster read/write operations
compared to the backing store.
 This allows the CPU to temporarily store any key data needed by an application, significantly
enhancing overall performance.

Registers:
One of the most fundamental components of the von Neumann system are the registers. Registers
can be general or special purpose.

System buses and memory:

2|Page
Memory:
The computer memory is made up of a number of partitions. Each partition consists of an address
and its contents. The address will uniquely identify every location in the memory and the contents
will be the binary value stored in each location.

Iinput and output devices:


 Input and output devices are crucial for entering and exchanging data in computer systems. Input
devices convert external data into a computer-readable format,
 while output devices display the computer's processing results in a human-readable form, such as
printers, monitors, and loudspeakers.
(System) buses:
System buses in computers serve as parallel transmission components, transmitting one bit of data per wire. In the
von Neumann architecture, three common buses are the address bus, data bus, and control bus.
Address bus:
 The address bus is a crucial component in a computer system, carrying addresses throughout the
system.

3|Page
 It is unidirectional between the CPU and memory, preventing addresses from being carried back to
the CPU.
 The width of a bus is crucial, as wider buses can address more memory locations at any given time.
 For example, a 16-bit bus can address 216 memory locations, while a 32-bit bus can address
4294967296 simultaneously. However, even wider buses are not large enough for modern
computers.
Data bus:
 The data bus is bidirectional, allowing data to be sent from CPU to memory and vice versa, as well
as to input/output devices.
 Data can be an address, instruction, or numerical value. The width of the data bus is crucial, as it
affects the word length that can be transported.
 Words are groups of bits, with 16-bit, 32-bit, or 64-bit word lengths being the most common. Larger
word lengths can improve a computer's overall performance.

Control bus:
 The control bus is also bidirectional. It carries signals from the control unit (CU) to all the other
computer components
 . It is usually 8-bits wide. There is no real need for it to be any wider since it only carries control
signals.

Fetch–Decode–Execute cycle:
The CPU fetches data and instructions from memory, stores them in registers using both the address and
data bus, and then decodes each instruction before executing them, known as the Fetch–Decode–Execute
cycle.

Fetch:
 The Fetch-Decode-Execute cycle in a computer stores data and instructions in the Memory Data
Register (MDR).
 The next instruction is fetched from the MAR memory address and stored in the MDR.
 The contents are copied to the Current Instruction Register (CIR), and the PC is incremented so that
next instruction can be processed
Decode:
The instruction is then decoded so that it can be interpreted in the next part of the cycle

Execute:
 The CPU passes the decoded instruction as a set of control signals to the appropriate components within the
computer system.

4|Page
 This allows each instruction to be carried out in its logical sequence.


Cores, cache and internal clock:
 The performance of a CPU is determined by factors such as the system clock, which defines the
clock cycle that synchronizes all computer operations. The control bus transmits timing signals to
ensure full synchronization.
 An increase in clock speed increases the computer's processing speed, but it is not necessarily a
guarantee of increased overall performance. A typical current value is 3.5GHz, involving 3.5 billion
clock cycles a second.

Other factors that determine the performance of a CPU:


1. The width of the address bus and data can also affect computer performance and needs to be
taken into account.
2. Overclocking is a factor to consider. The clock speed can be changed by accessing the BIOS
(Basic Input/Output System) and altering the settings.:
i. Execution of instructions beyond design limits can cause unsynchronized operations, leading to
computer crashes and instability, as instructions may not complete in time before the next one is due to
be executed.
ii. overclocking can lead to serious overheating of the CPU again leading to unreliable performance.
3. Cache memories, located within the CPU, offer faster data access times than RAM. They store
frequently used instructions and data, enhancing CPU performance. When reading memory, the
CPU checks the cache first, then moves to main memory or RAM if required. Larger cache
memory sizes improve CPU performance.
4. The use of different number of cores in a computer can enhance performance. One core consists
of an ALU, control unit, and registers. Many computers have dual or quad core CPUs. Increasing
the number of cores reduces the need to increase clock speeds. However, doubling the number of

5|Page
cores doesn't necessarily increase performance, as the CPU must communicate with each core,
which can reduce overall performance.

Instruction Set:
 Instructions are a sequence of operations in a computer system, decoded by the ALU and CU, which
are part of the CPU.
 An operation consists of an opcode and an operand, with the opcode indicating the operation to be
performed and the operand representing the data to be acted on.
 The instruction set, a limited number of opcodes, is used to understand the operation. All software on
a computer contains instructions that need to be converted into binary.
 The Fetch–Decode–Execute cycle is the sequence of steps used by the CPU to process each
instruction.
 The X86 CPU standard is a common example of an instruction set, with almost identical instruction
sets across all computer designs.
 Don’t confuse it with program as Instruction sets are low-level language instructions that instruct the
CPU to perform an operation, while program code requires interpreters or compilers to convert it into
the computer's understood instruction set. Examples of instruction set operations include ADD, JMP,
and LDA
Embedded Systems:
An embedded system is a combination of hardware and software which is designed to carry out a specific set of
functions. The hardware is electronic, electrical or electro-mechanical. Embedded systems can be based on:
1. Microcontrollers: integrated circuit containing a CPU and memory (RAM or ROM) built in to the same chip
2. Microprocessor: Integrated circuit containing only a CPU on the chip.
RAM, ROM, peripherals need to be added
3.. System on chips: This contains a microcontroller as one of its components along with a secondary storage
on a single chip.

 Embedded systems are devices that can be manually inputted or automatically sourced from sensors.
 These inputs can be analogue or digital, such as oxygen levels or fuel pressure in a car's engine
management system.

6|Page
 The output of the embedded system sends signals to controlled components, such as heating
elements or engine fuel levels.
 Depending on the device, embedded systems are either programmable or nonprogrammable, with
nonprogrammable devices requiring software upgrades. Examples include a satellite link and an
oven control panel.
. Programmable devices permit upgrading by two methods:
 Programmable devices can be upgraded through two methods: connecting the device to a computer
and downloading updates to the software
 or automatic updates via Wi-Fi, satellite, or cellular links. For example, modern cars allow updates to
engine management systems and other components via satellite link.

 Embedded systems, which can be connected to the internet, enable remote control using smartphones
or computers.
 These systems are designed for specific tasks, allowing engineers to optimize their designs to reduce
physical size and cost.
 The range of applications is vast, from a single microcontroller in an MP3 player to a complex array
of multiple units in a medical imaging system.
 However, computers are not considered embedded systems as they are multi-functional and can
perform various tasks using different software, making them unsuitable for this category. Hence,
embedded systems are not limited to specific tasks.
Examples of Embedded systems:
Set-top box:
 A set-top box uses an embedded system for recording and playing television programmes remotely,
using an internet-enabled device or an interface panel at home.
 The embedded system handles functions involving inputs from sources like a Solid-State Device
(SSD) or a satellite signal, allowing for storage and retrieval of programmes and decoding incoming
signals.

7|Page
Security systems:

 The system uses RAM for setting security codes and activates or deactivates alarms using a keypad.
Sensor data is sent to a controller, which checks against SSD values for sensitivity adjustments.
 Outputs can be flash lights, sound alarms, or send messages to the home owner via mobile phone,
and the home owner can interface with the system remotely if needed.
Lighting systems:
 Embedded systems are crucial in modern lighting systems, from simple home use to major
architectural systems. They control lighting based on various factors, such as time of day, room
occupancy, and natural light brightness.
 These systems can automatically control lighting using inputs like light sensors and memory data. In
an office environment, the time of day is important as it saves energy by switching to low lighting
levels when unoccupied.
 However, if there is movement, correct lighting levels are restored automatically. On bright sunny
days, the system can automatically dim lights and increase output if natural light levels fall below a
set value.
 Embedded systems can control internal and external lighting systems, such as fountain lights or light
shows, and can also trigger emergency lighting in aircraft.
 Some systems use Bluetooth light bulbs, allowing the system to control each bulb independently.
LED bulbs are widely available and come in various colours to change the mood.

Vending systems:
They usually use microcontrollers to control a number of functions that we all associate with vending machines

 The vending machine's core is a microcontroller embedded system, which receives inputs from the
keypad for item selection and sensors for counting coins, machine temperature, and a tilt sensor for
security.
 The system outputs include actuators for motors, signals for cooling systems, item descriptions and
changes on an LCD display panel, and data sent back to the vending machine company for remote
sales activity monitoring, including refill instructions, eliminating the need to visit each machine.

8|Page
 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.
Washing machines:
 White goods, such as refrigerators, washing machines, and microwave ovens, are controlled by
embedded systems with keypads or dials.
 These inputs, like temperature, wash cycle, or cooking duration, are used to perform tasks without
human intervention. These devices can also be operated remotely using an internet-enabled
smartphone or computer.

Input devices
Barcodes:
 series of dark and light parallel lines of varying thickness
 numbers 0 to 9 are each represented by a unique series of lines
 different codes for digits appearing on the left and for digits appearing on the right of the barcode

 Each digit in the barcode is represented by bars of 1 to 4 blocks


 there are different patterns for digits on the left-hand side and for digits on the right-hand side.

9|Page
 All digits have same width and have 2 light bars and 2 dark bars
 the left digits have an odd number of dark elements and start with a light bar
 the right digits have an even number of dark elements and start with a dark bar.
 allowing a barcode to be scanned in any direction.

What happens when barcode is scanned?

 A barcode reader shines a red laser at the barcode to read the data it represents
 The light from the white lines is reflected back
 Black lines absorb the light so less is reflected
 The different levels of reflection are converted into a binary value which can be processed by a
microprocessor
What happens when the barcode has been scanned?
 Barcode number is looked up
 When it is found, stock item record looked up
 Price and stock details sent to checkout
 Stock number (for the item) is reduced by 1 each time barcode scanned
 Number of stock items compared to reorder number, if its less than or equal to this value, more stock
items are automatically ordered
 The system automatically stops re-ordering when an order for more stock items is generated, and
updates stock levels in the database when new items arrive.
Advantages to customers and managers for using barcodes:
 Increased Efficiency: Barcodes automate tasks like product lookup and pricing, saving time and
reducing human error for both managers and cashiers.
 Improved Accuracy: Scanning eliminates the need for manual data entry, leading to more accurate
inventory levels, pricing, and checkout transactions.
 Enhanced Convenience: Self-checkout options with barcode scanners offer quicker service for
customers, while managers benefit from faster inventory management and checkout processes.
 Reduced Costs: Increased efficiency and accuracy translate to lower labor costs and minimized
losses from errors or theft.

Quick response (QR) codes:


 QR codes are small squares of light and dark pixels that can
hold up to 4296 characters or 7089 digits and encode internet
addresses
 They are more complex than barcodes, which can only hold
30 digits.
 As more data is added, the QR code structure becomes more
intricate.
 The QR code's corners feature three large squares for
alignment
 while a small corner square ensures the correct size and angle of
the camera shot when the code is read.
 QR codes often link to a website where more information can be found
 They can also be used to advertise products, share contact details, provide promotional codes, train
tickets, and event tickets
Advantages of QR codes compared to traditional barcodes:
 Hold much more info
 Fewer errors- has built in error checkers due to larger capacity
 QR codes are easier to read; they don’t need expensive laser or LED scanners like barcodes
 easy to transmit QR codes either as text messages or images
 possible to encrypt QR codes which gives them greater protection than traditional barcodes.

10 | P a g e
Disadvantages of QR codes compared to traditional barcodes:
 More than one QR format is available
 QR codes can be used for attagging malicious codes, with many free apps available. This can lead to
unauthorized access to user data, fake websites, and even the downloading of viruses, as the creator
can easily embed malicious code within the QR code.

New developments:
Frame QR codes, featuring a canvas area for incorporating graphics or images, are increasingly popular due
to their increased ability to include advertising logos.

Digital Cameras:
Digital cameras have replaced traditional film-based cameras, which were expensive to operate due to the
lack of image deletion capabilities. Morden Cameras allow wireless transfer of photographs via Bluetooth or
can transfer using USB (which uses wires). They are controlled by an embedded system which can
automatically adjusts the shutter speed, aperture size and size of the image it also focuses the image,
operates the flash gun to remove Red Eye automatically

What happens when photograph taken?


The image is seen, Rays pass through the lens which makes the ray organized and go through the CCD
(charged couple device) (which converts light into electricity) then the electricity goes through a ADC
(analogue to digital convertor) which converts it into bits or bytes which contain the brightness and all the
other details.

Keyboards:
it is the most common method of data entry, it can be either virtual or a touch screen technology.
When a key is pressed it completes a circuit and the CPU determines which key has been pressed then it
refers to an index file ( which contains the ASCII value of the character the key represents).
people with repetitive strain injury (RSI) in the hands and wrists use ergonomic keyboards to overcome this
problem.

Microphones:
a microphone converts sound waves into an electric current which is converted into a digital format so it can
be understood by computer. So basically sound causes air particles to vibrate, in the speaker A copper coil
is wrapped around a cone connected to a diaphragm; the diaphragm captures the vibrations making itself
vibrate which causes the cone to move in and out causing copper wire to move backwards and fowards, this
motion induces a electric current. The electric current can do through ADC to become bits n bytes and be
stored in computer or amplified.

Optical mouse:
An optical mouse is a pointing device that uses tiny cameras to capture 1500 images per second. It can work
on any surface and uses a red LED at its base. A red led is used in the base of the mouse, the red light is
reflected from the surface and captured by a complementary metal oxide semiconductor (CMOS) which

11 | P a g e
generates electric pulses to represent the light, these pulses are sent to a digital signal processor. The
processor calculates the mouse's coordinates based on changing image patterns, allowing the computer to
move the cursor to the mouse's coordinates.

Advantages of optical mouse:


 There are no moving parts making it reliable
 Dirt cannot get trapped in any mechanical
components
 No need for special surface

Advantages of wired mouse:


 no signal loss since there is a constant signal pathway
 Cheaper to operate (no need to buy batteries)
 Environmentally safe (no need to dispose of old batteries)

2D scanners:
2 dimensional scanners, they are most common and generally used to input hard copy (paper) documents.
The image is converted into an electronic form that can be stored in a computer

A number of stages occur when scanning a document:


The cover is raised, document is placed in glass panel, cover is closed, a bright light then illuminates the
document , scan head moves across the page, the image is processed and sent to the CPU,a charge couple
device (CCD) makes it a digital copy, if needed OCR converts to text file.

Application of 2D scanners at airports:


Used to read passports, basically OCR software selects text and puts it into a database. The 2D image in the
passport is also scanned and stored, to compare it with the persons current face; for verifying purposes

3D scanners:
3 dimensional scanners, which scan x,y,z coordinates of solid objects and produces 3D images. The images
can be used in computer aided design (CAD) or to 3D print the file.

Application of 3D scanners:
Computed tomographic (CT) scanners are used to create a 3D image of a solid object. This is based on
tomography technology, which basically 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 touch selection of app to launch it
- Allows to carry out same functions as a pointing device (mouse)
- 3 types: capacitive , infrared , resistive

12 | P a g e
Capacitive touch screens:
composed of a protective glass layer, a conductive transparent electrode and a glass substrate. Since human
skin, conducts electricity when you touch the screen it disturbs the electrostatic field of the conductive layer
from which the micro controller can determine the coordinates of the disturbance (point of touching).

Two types of capacitive touch screens, surface and projective ; the have same general structure as shown in
figure 3.32
surface capacitive screens: sensors are placed at the corners as well as small voltage applied at the
corners creating electric field, finger touch will draw current from each corner reducing capacitance at point
of touch. Microcontroller will measure decrease in capacitance and determine the point of decrease ( which
is the point of touch). This method only works with a stylus or touch.
Projective capacitive screens: transparent conductive layer is in a x-y matrix format creating 3D
electrostatic field, finger touch disturbs this field allowing microcontroller to pinpoint coordinates. This
method works well with stylus, touch or cotton gloves, also allows multi touch facility.

Advantages of capacitive compared to infrared Disadvantages of capacitive compared to


and resistive: infrared and resistive:
Better image clarity Surface capacitive only work with a stylus or bare
fingers
Durable scratch resistance screens Sensitive to electromagnetic radiation
Projective capacitive allow multi touch

Infrared touch screens:


Uses infrared transmitters and sensors, which make a infrared
field, touch breaks infrared field, which the sensors detect and
send to microcontroller which determines point of touch.

Advantages of infrared compared to resistive and Disadvantages of infrared compared to resistive and
capacitive : capacitive:
Allows multi touch Sensitive to moisture or water
Good durability Possible for accidental activation
Operability isn’t effected by scratchs or cracks Sensitive to light interreference

Resistive touch screens: made up of 2 layers of electrically resistive material on which voltage
is applied across them. Upper layer which is the polyethylene layer and lower layer which is the glass layer
both have resistive coating on one side. When the top layer is touched both layers make contact and since
both layers are covered with resistive coating this completes a circuit resulting in flow of electricity. The
point of contact is detected when there is a change in voltage, microcontroller converts voltage into digital
data and sends it to microprocessor.

13 | P a g e
Advantages of resistive compared to capacitative Disadvantages of resistive compared to capacitative
and infrared and infrared
Good resistance to dirt and water Low touch sensitivity
Can be used with finger, glover, stylus Multi touch not supported
Poor visibility in strong light
Vulnerable to scratchs made on screen.

Output Devices
Actuators:
An actuator is a mechanical or electromechanical device such as a relay, solenoid or motor, actuators are
used to help control devices such as open or stop a valve , start/ stop a conveyer belt. Basically
Actuators converts an electric signal into a magnetic field producing linear motion (mechanical movement).

Light projectors:
Projectors, project a computer output on a larger screen.
there are 2 types of projectors

1. Digital light projector


2. Liquid crystal display projector

Digital light projectors:


they have a number of small digital micromirror devices (DMD), the amount and arrangement of DMD
represents the resolution. There tilting towards the light source and away from it creates shades of grey.
They can tilt several thousand times in a second so they can produce many shades of grey.

A bright white light passes through a condensing lens which makes the rays go towards the colour filter
which splits the white light into the 3 primary colours, which then passes into the DMD chip; the tilting
states of each micromirror are linked with colours from the filter to produce the coloured image.

Liquid crystal display projector:


a white beam of light generated by a LCD in the project is sent through a group of chromatic coated mirrors
which reflect light back at different wave lengths; the wavelengths are corresponding to red, green and blue
components. The components are sent through 3 LCDs screens which produces there versions of the same
image, one full of shades of red, one full of shades of green and one full of shades of blue; then these images
are recombined using a special prism to create a full image which passes through the projector lens on to the
screen.

14 | P a g e
15 | P a g e

You might also like