3.1 Computer Architecture & Fetch Execute Cycl
3.1 Computer Architecture & Fetch Execute Cycl
3.1 Computer architecture & fetch execute cycle Majid Tahir www.majidtahir.com
Syllabus Requirements:
3. Hardware
3.1Computer architecture
Candidates should be able to:
1- (a) Understand the role of the central processing unit (CPU) in a computer
Notes and guidance
The CPU processes instructions and data that are input into the computer so that the result can
be output
(b) Understand what is meant by a microprocessor
Notes and guidance
A microprocessor is a type of integrated circuit on a single chip
2- (a) Understand the purpose of the components in a CPU, in a computer that has a Von
Neumann architecture
units: arithmetic logic unit (ALU) and control unit (CU)
registers: program counter (PC), memory address register (MAR), memory data register
(MDR), current instruction register (CIR) and accumulator (ACC)
buses: address bus, data bus and control bus
(b) Describe the process of the fetch–decode–execute cycle including the role of each
component in the process
How instructions and data are fetched from random access memory (RAM) into the
CPU, how they are processed using each component and how they are then executed
Storing data and addresses into specific registers
Using buses to transmit data, addresses and signals
Using units to fetch, decode and execute data and instructions
3- 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 number of cores, size of the cache and speed of the clock can affect the
performance of a CPU
4- Understand the purpose and use of an instruction set for a CPU
An instruction set is a list of all the commands that can be processed by a CPU and the
commands are machine code
5- Describe the purpose and characteristics of an embedded system and identify devices in
which they are commonly used
An embedded system is used to perform a dedicated function, e.g. domestic appliances,
cars, security systems, lighting systems or vending machines. This is different to a
general purpose computer that is used to perform many different functions, e.g. a
personal computer (PC) or a laptop
All programs and data processing are run in the CPU and all hardware components are,
to some extent, controlled by it.
Registers
Registers are small amounts of high speed memory contained within the CPU. They are
used by the processor to store small amounts of data that are needed during
processing, such as:
the address of the next instruction to be executed
the current instruction being decoded
the results of calculations
Different processors have different numbers of registers for different purposes, but most
have some, or all, of the following: We will study functionality of each register in Von
Neumann Model.
program counter
memory address register (MAR)
memory data register (MDR)
current instruction register (CIR)
accumulator (ACC)
Cache
Cache is a small amount of high speed memory built directly within the processor.
It is used to temporarily hold data and instructions that
the processor is likely to reuse.
This allows for faster processing as the processor does
not have to wait for the data and instructions to be
fetched from the random-access memory (RAM).
Clock
The CPU contains a clock which is used to coordinate all of the computer's
components.
The clock sends out a regular electrical
pulse which synchronises - keeps in time
- all the components.
The frequency of the pulses is known as
the clock speed.
Clock speed is measured in hertz. The higher the clock speed, the greater the number
of instructions performed in any given moment of time.
Buses
A bus is a high speed internal connection. Buses are used to send control signals and
data between the processor and other components.
Three types of bus are used:
Address bus - carries memory addresses from the processor to other components such as
RAM and input/output devices.
Data bus - carries the actual data between the processor and other components.
Control bus - carries control signals from the processor to other components.
It could take three weeks to set up a program on ENIAC (a computer of 1940s) and get
it working. ENIAC (Electronic Numerical Integrator and Computer) was the first
electronic general-purpose computer. It was Turing-complete, digital, and capable
of being reprogrammed to solve "a large class of numerical problems
The von Neumann architecture, also known as the von Neumann model and
Princeton Architecture, is based on John von Neumann’s (mathematician and
physicist) research paper in 1945.
program counter - holds the memory address of the next instruction to be fetched from main
memory
memory address register (MAR) - holds the address of the current instruction that is to be
fetched from memory, or the address in memory to which data is to be transferred
memory data register (MDR) - holds the contents found at the address held in the MAR, or
data which is to be transferred to main memory
current instruction register (CIR) - holds the instruction that is currently being decoded and
executed
accumulator (ACC) - holds the results of processing
The registers and key elements of the Von Neumann architecture all play a part in how
an instruction is processed in the fetch-decode-execute cycle.
This described design architecture for an electronic digital computer with parts
consisting
Central Processing Unit containing:
o Control Unit
o Arithmetic/Logic unit
o Processor registers,
o Memory to store data & instructions
Input / Output Mechanism
External Storage
Memory
The computer will have memory that
can hold both data and also the
program processing that data. In
modern computers this memory is
RAM.
Control Unit
The control unit will manage the process of moving data and program into and out of
memory and also deal with carrying out (executing) program instructions - one at a time.
This includes the idea of a 'register' to hold intermediate values. In the illustration above,
the 'accumulator' is one such register.
Input - Output
This architecture allows for the
idea that a person needs to
interact with the machine.
Whatever values that is passed
to and forth is stored once again in some internal registers.
Registers:
The Von Neumann architecture uses a single processor which follows a linear
sequence of fetch-decode-execute. In order to do this, the processor has to use
some special registers, which are discrete memory locations with special
purposes attached. These are:
PC Program Counter- keeps track of where to find the next instruction so that a copy of the
instruction can be placed in the current instruction register
MAR Memory Address Register- to hold the memory address that contains either the next
piece of data or an instruction that is to be used.
MDR Memory Data Register: acts like a buffer and holds anything that is copied from the
memory ready for the processor to use it
Current Instruction Register: The current instruction register holds the instruction that is
CIR to be executed
Accumulator: is a special purpose register where data is worked on e.g I wanted to add 4
to 7, for example, I would fetch 4 from RAM and put 4 in the Accumulator. I would then get 7
from RAM and add that to whatever was in the Accumulator. I would then store the result
briefly in the Accumulator before moving it back to somewhere in RAM to be used later. All
ACC calculations of any description are done using the Accumulator.
Bus
Notice the arrows between components? This implies that information should flow between
various parts of the computer. In a modern computer built to the Von Neumann architecture,
information passes back and forth along a 'bus'. There are buses to identify locations in memory
- an 'address bus'
1. Load the address that is in the program counter (PC) into the memory
address register (MAR).
2. Load the instruction that is in the memory address given by the MAR into
the memory data register (MDR).
3. Load the instruction that is now in the MDR into the current instruction
register (CIR).
4. Increment the PC by 1.
5. Decode the instruction that is in the CIR.
6. If the instruction is a jump instruction then
a. Load the address part of the instruction into the PC
b. Reset by going to step 1.
7. Execute the instruction.
8. Reset by going to step 1
Clock speed:
Clock speed is the number of pulses the central processing unit's
(CPU)'s clock generates per second. It is measured in hertz.
CPU clocks can sometimes be sped up slightly by the user. This process is known as
overclocking. The more pulses per second, the more fetch-decode-execute cycles that
can be performed and the greater the number of instructions that are processed in a
given space of time. Overclocking can cause long-term damage to the CPU as it is
working harder and producing more heat.
Cache size:
Cache is a small amount of high-speed random access memory (RAM) within the
processor. It is used to temporarily hold data and instructions that the processor is likely
to reuse. This allows for faster processing as the processor does not have to wait for the
data and instructions to be fetched from RAM.
The bigger its cache, the less time a processor has to wait for instructions to be fetched.
Number of cores:
A processing unit within a CPU is known as a core. Each core is capable of fetching,
decoding and executing its own instructions.
The more cores a CPU has, the greater the number of instructions it can process in a
given space of time.
Embedded systems
As well as general purpose computers, there are other types of computer systems. The
most common of these are known as embedded systems.
An embedded system is a small computer that forms part of a larger system, device or
machine. It includes both hardware and software and its purpose is to control the device
and to allow a user to interact with it. They tend to have one, or a limited number of
tasks that they can perform.
Examples of embedded systems include:
digital watches
electronic calculators
GPS systems
fitness trackers
Depending on the embedded system’s purpose, they use input devices like sensors and
switches to produce output, for example sounding warning buzzers and switching lights
on.
Embedded devices are not usually programmable by a user - the programming is
usually done beforehand by the manufacturer. However, it is often possible to upgrade
the software on an embedded device. For example, fitness trackers are embedded
systems, but the software can often be upgraded by connecting the device to a PC and
installing the new software.
Embedded systems can have advantages over general purpose computers in that:
Their limited number of functions means they are cheaper to design and build.
They tend to require less power. Some devices run from batteries.
They do not need much processing power. They can be built using cheaper, less powerful
processors.
[2]
(b) The seven stages in a von Neumann fetch-execute cycle are shown in the table below.
Put each stage in the correct sequence by writing the numbers 1 to 7 in the right hand column.
[6]
Answers
Refrences:
https://www.bbc.co.uk/bitesize/guides/zkrr97h/revision/8
www.wikipedia.com
VCN – ICT Department 2013 Prepared by Davis Rwatooro T.