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

Ch3 Computer Architecture

Uploaded by

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

Ch3 Computer Architecture

Uploaded by

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

3 Hardware

3.1 | Computer Architecture


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

3.1.2 Von Neumann Architecture:


In early years, computers were not able to store programs until 1945; John von Neumann developed
the concept of the stored program computer, referred to as Von Neumann Architecture concept.
He designed architecture for an electronic digital computer with subdivisions of a central arithmetic
part, a central control part, a memory to store both data and instructions, external storage, and input
and output mechanisms.
The von Neumann architecture had the following main features:
The concept of a central processing unit (CPU or processor)
The CPU was able to access the memory directly
The computer memories could store programs as well as data
The stored programs were made up of instructions which could be executed in sequential
order.

5
Computer Science editted by: Sir Yasin 1
The following diagram is a simple representation of von Neumann CPU architecture:

Components of the Central Processing Unit (CPU):


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

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

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

Immediate Access Store (IAS):


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

Main Memory (RAM):


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

Input & Output Devices:


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

7
Computer Science editted by: Sir Yasin 3
The main components of the CPU (processor) are the arithmetic logic unit (ALU), the control unit
(CU) and the system clock.

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

Control Unit (CU):


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

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

Special Purpose Registers:

Memory Address Register (MAR):


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

Memory Data/Buffer Register (MDR):


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

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

Current Instruction Register (CIR):


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

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

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

The following is a section of computer memory:

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

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

READ & WRITE Operations:


READ operation:

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

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

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

MAR 1 1 1 1 0 0 0 1

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

MDR 0 1 0 1 1 0 1 1

10
Computer Science editted by: Sir Yasin 6
WRITE operation:

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

Address Contents

1111 0000 0111 0010

1111 0001 0101 1011

1111 0010 1101 1101

1111 0011 0111 1011

1111 1100 1110 1010

1111 1101 1001 0101

1111 1110 1000 0010

1111 1111 0101 0100

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

MDR 1 0 0 1 0 1 0 1

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

MAR 1 1 1 1 1 1 0 1

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

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

In the part of READ operation:


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

In the part of WRITE operation:


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

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

12
Computer Science editted by: Sir Yasin 8
Exam Style Questions:
Question 1:

13
Computer Science editted by: Sir Yasin 9
14
Computer Science editted by: Sir Yasin 10
Answer:

15
Computer Science editted by: Sir Yasin 11
Question 2:

Answer:

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

16
Computer Science editted by: Sir Yasin 12
The following diagram shows how buses are used to connect the CPU to the memory and to
input/output devices:

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

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

Width of Address Bus:

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

17
Computer Science editted by: Sir Yasin 13
Benefit of increasing the address bus width from 16 bits to 32 bits:

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

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

Width of Data Bus:

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

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

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

18
Computer Science editted by: Sir Yasin 14
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
Computer Science editted by: Sir Yasin 15
The following diagram shows how the Fetch–Decode–Execute cycle is carried out in the Von
Neumann computer model:

20
Computer Science editted by: Sir Yasin 16
Exam Style Questions:
Question 1:

21
Computer Science editted by: Sir Yasin 17
Answer:

Question 2:

22
Computer Science editted by: Sir Yasin 18
Answer:

Question 3:

23
Computer Science editted by: Sir Yasin 19
Answer:

Question 4:

Answer:

24
Computer Science editted by: Sir Yasin 20
Question 5:

25
Computer Science editted by: Sir Yasin 21
Answer:

Question 6:

26
Computer Science editted by: Sir Yasin 22
Answer:

Question 7:

27
Computer Science editted by: Sir Yasin 23
Answer:

Question 8:

28
Computer Science editted by: Sir Yasin 24
Answer:

Question 9:

29
Computer Science editted by: Sir Yasin 25
Answer:

30
Computer Science editted by: Sir Yasin 26
Question 10:

31
Computer Science editted by: Sir Yasin 27
Answer:

32
Computer Science editted by: Sir Yasin 28
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 Science editted by: Sir Yasin 29
Computer Performance:
As discussed earlier, by increasing the clock speed the processing speed of the computer is also
increased. However, it is not possible to say that a computer’s overall performance is necessarily
increased by using a higher clock speed.

Four other factors need to be considered:

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

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

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

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

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

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

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

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

34
Computer Science editted by: Sir Yasin 30
Potential Problem:

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

Summary of factors affecting computer performance:

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

35
Computer Science editted by: Sir Yasin 31
Exam Style Questions:
Question 1:

Answer:

Question 2:

36
Computer Science editted by: Sir Yasin 32
Answer:

Question 3:

37
Computer Science editted by: Sir Yasin 33
Answer:

Question 4:

Answer:

38
Computer Science editted by: Sir Yasin 34
Question 5:

Answer:

39
Computer Science editted by: Sir Yasin 35
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
Computer Science editted by: Sir Yasin 36
3.1.5 Embedded System:

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

An embedded system is used to perform a dedicated function.


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

Microcontroller:

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

Microprocessor:

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


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

The following diagram summarizes how Embedded Systems work in general:

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

General Purpose Computers & Embedded Systems:


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

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

Applications of Embedded Systems:


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

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

43
Computer Science editted by: Sir Yasin 39
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
Computer Science editted by: Sir Yasin 40
The following diagram shows the Embedded Systems used in many security devices:

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

2. Whether the room is occupied or empty:


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

3. The brightness of the natural light:


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

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

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

The embedded system is in the form of a microcontroller.


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

46
Computer Science editted by: Sir Yasin 42
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
Computer Science editted by: Sir Yasin 43
Exam Style Questions:
Question 1:

48
Computer Science editted by: Sir Yasin 44
Answer:

Question 2:

49
Computer Science editted by: Sir Yasin 45
Answer:

50
Computer Science editted by: Sir Yasin 46

You might also like