Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Objectives

• Understand the purpose and use of an instruction set


for a CPU
• Understand what is meant by a microprocessor
• Describe the purpose and characteristics of an
embedded system
• Be able to identify devices which commonly use
embedded systems
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
Two computers are being sold in a shop for the same price. The
specification of the CPU in each computer is listed below:
Computer 1 Computer 2
Clock Speed: 2.3 GHz Clock Speed: 3.4 GHz
Cache Memory: 2 MB
Cache Memory: 2 MB L2
L2
Number of Cores: 4 Number of Cores: 2
(a)A customer will mainly be buying the computer for video editing.

The sales assistant advises that Computer 1 will be likely to run


faster for this.

Using information in the table, identify one reason for this.


There are more cores.
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
Describe how the use of cache in a computer system can affect the
performance of the CPU.
Cache is faster to transfer data from than RAM (1).

The processor will first try to access data in cache (1).

If it finds it / has a hit, (1) then it will have saved time waiting for the data from
RAM (1).

If it doesn’t find it in cache / there is a miss (1) then it will need to request it
from
slower RAM.
Most data that the CPU needs will be stored in cache (if there is a suitable
amount
of it) (1),
so there is a significant increase in the speed that the CPU can obtain data
from memory (1).
Cache has different levels (1). The faster levels are tried first (1).
Increasing the amount of cache will increase the number of hits (1) which will
increase the performance of the CPU (1).
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
A computer system has 16 GB of RAM and 8 MB of cache which is faster
than RAM.

Explain why the computer system does not have 16 GB of cache.

Cache is far more expensive to produce than RAM (1) so the cost of the
computer/CPU/cache would significantly increase (1) but there would not be a
significant increase in speed (as most data needed is stored in the lower
amount of cache) (1).
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
A dual-core computer system has two cores.

Explain two components that each core will contain.

Registers (1) that are used to store small amounts of data (1).

Control unit (1) which controls the timing of all operations (1).

ALU/arithmetic logic unit (1) which performs calculations / performs logical


expressions (1).

(L1) cache (1) that is dedicated memory to be used by the individual core (1).

Accept answers of the individual registers and their use, e.g., MAR / Memory
Address Register, MDR / Memory Data Register, CIR / Current Instruction
Register / Accumulator, PC / program counter.
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
The CPU features a number of different buses that make up the system bus.

(a)Describe the term ‘bus’.

A bus is a collection of wires through which data or control signals are


transmitted from one component to another.
Embedded systems and instruction sets
Computer architecture and storage

Exam questions
(b) State the role of each bus in a CPU.

Component Purpose
Responsible for transferring the address of the
Address bus
memory or device to be read from or written to.
Carries control signals to coordinate the
Control bus activities of the CPU.
Transports data between the CPU and RAM, and
Data bus between CPU and IO and storage devices.
Embedded systems and instruction sets
Computer architecture and storage

Starter
• CPUs fetch, decode and execute instructions
• In a high level language, you may program an instruction
such as
total  0
FOR i  1 TO 10 DO
total  total + i
ENDFOR

• What sort of instructions


does a CPU
actually use?
Embedded systems and instruction sets
Computer architecture and storage

Starter
• CPUs use very simple instructions known as
machine code or assembly language
• A high level instruction such as total  0 may use an
instruction such as LOAD ACC, #0
• Harder instructions are broken down into
simpler assembly code instructions
• For example,
FOR i  1 TO 10 DO
may need several
instructions to move
data between RAM
and the Accumulator
Embedded systems and instruction sets
Computer architecture and storage

Instruction sets
• Instruction sets are all the possible instructions that
are able to be decoded and executed by a CPU
• A particular CPU will have its own instruction set
• Programs written for one type of CPU won’t work on another
• For example, a program written for an Intel Core i7 won’t work
on an ARM processor contained in a smartphone
Embedded systems and instruction sets
Computer architecture and storage

Operators and operands


• In ordinary Maths and programming we use the
words operator and operand
• An operator performs an operation (calculation) on the
operand(s)
• The operands are the values used

5 + 7
Operand Operator Operand
Embedded systems and instruction sets
Computer architecture and storage

Opcodes and operands


• When programming a processor a special language
called assembly code is used
• The program is then assembled into a binary form known as
machine code – this is what is run by the processor
• The assembly code (and machine code) make use of
opcodes and operands
• The opcode is the instruction and the operands are the values
that the instruction works on
Instruction: STO 057 ACC
Opcode Operand Operand
…into memory …the contents
Store…
address 057… of the accumulator
Embedded systems and instruction sets
Unit 3 Computer architecture and storage

Worksheet
• Complete Task 1 on Worksheet
Embedded systems and instruction sets
Computer architecture and storage

Microprocessor
• A microprocessor is an integrated circuit that is all
contained on a single chip
• CPUs are one type of microprocessor, they include Pentium
microprocessors and ARM microprocessors
• Microcontrollers contain not only the
microprocessor, but also RAM and
ROM or flash memory for volatile and
non-volatile storage – this allows
for an entire computer to
be contained on one chip
Embedded systems and instruction sets
Computer architecture and storage

Embedded systems
• Do these devices have inputs, processes and
outputs?
• Could they be classed as computers?
• Why or why not?
Embedded systems and instruction sets
Computer architecture and storage

Embedded computers
• An embedded computer is a single microprocessor
that includes RAM, ROM and a CPU
• An embedded computer is frequently used to control a device
using simple inputs
Embedded systems and instruction sets
Computer architecture and storage

Embedded systems
• Without embedded systems, a digital device
would not be able to perform specific functions
• For example, a dishwasher wouldn’t know when to heat
the water, or a satnav wouldn’t know how to communicate
with a satellite
• What embedded functions do cars use?
Embedded systems and instruction sets
Computer architecture and storage

Car embedded systems


• Some examples of embedded systems in
cars include:
• Cruise control
• Engine cooling fan
• Interior fans and temperature
• Interior lighting
• Rear cameras and remote parking
• Infotainment systems (entertainment / information / satnav)
• Engine control unit (ECU)
Embedded systems and instruction sets
Computer architecture and storage

Other embedded systems


• Embedded systems are also used in:
• Security systems
• Lighting systems
• Vending machines
Embedded systems and instruction sets
Computer architecture and storage

Embedded vs General purpose


• The following table shows how the characteristics of
embedded systems compare to
general purpose machines
Characteristic Embedded system General purpose machine
CPU speed Typically slow Typically very fast
Software Has one purpose and New software can be
cannot install new software installed
Storage Programs stored on ROM Programs stored on
hard drives
Reliability Typically very reliable – e.g. As it runs many software
a microwave should not programs it may be less
have a bug that changes reliable and need restarting
defrost to full power the device
Embedded systems and instruction sets
Unit 3 Computer architecture and storage

Worksheet
• Complete Task 2 on Worksheet
Embedded systems and instruction sets
Computer architecture and storage

Plenary
• Work with a partner to explain
the following terms:
• Embedded system
• Microprocessor
• Instruction set
• Assembly code
• Machine code
• Opcode and operands
Embedded systems and instruction sets
Computer architecture and storage

Plenary
• Embedded system – a single processor that includes, RAM,
ROM and processor as one unit
• Microprocessor – a type of integrated circuit on a single chip
• Instruction set – a list of all the commands that can be
processed by a CPU
• Assembly code – code written in assembly language. The
instructions written are exact 1:1 representations of the
machine code that will be executed on the CPU
• Machine code – The binary representation of the assembly
code program. This will be executed by the CPU
• Opcode and operands – The opcode is the instruction and the
operands are the values that the instruction works on

You might also like