3.1 Hardware The CPU Architecture
3.1 Hardware The CPU Architecture
3.1 Hardware The CPU Architecture
Below is an example of data being inputted, processed and the results being
outputted
Example
Step
Worked Example
What is the purpose of a microprocessor?
Answer - B or C
o The microprocessor is sometimes described as the brain of the computer
system but this is not an acceptable exam answer. The purpose of a
microprocessor is to process data and execute instructions
The Von Neumann computer architecture which most modern day computers
use, is based upon this concept
o The key feature of the stored program concept, and Von Neumann
architecture, is data and instructions are stored in the same memory
( RAM ) as binary
o Another feature of Von Neumann architecture is a central processing unit
(CPU) fetches instructions from memory and executes them one at a
time (serially)
o The CPU then stores the results back into memory
The CPU has two main components - the Control Unit (CU) and the Arithmetic
Logic Unit ALU)
o The Control Unit controls the flow of data around the CPU
o The Control Unit also sends control signals to the different components
instructing them what to do e.g. read, write, add, subtract
o The Control Unit decodes instructions (into an opcode and operand )
o The Control Unit controls the timings of operations (the clock speed)
o The Arithmetic Logic Unit(ALU) performs the calculations required to
execute the instructions, these include ADD and SUBTRACT
o The ALU also carries out logical operations such as COMPARE
The CPU also contains a number of registers which are small memory locations
within the CPU, which temporarily store data needed to execute an instruction
Special purpose registers have specific roles to play in the execution of an
instruction
Special purpose register Definition
Program Counter (PC) stores the address of the next instruction to be fetched
from memory
Memory Data Register stores the data that has been fetched from memory or
(MDR) being written to memory
Current Instruction Register stores the instruction the CPU is currently decoding or
(CIR) executing
Exam Tip
If asked to describe the purpose of the PC, the MAR or the MDR make sure you explain
how the data is being fetched or written to memory.
Buses
Components within the CPU and wider computer system are connected by buses.
These are wires down which electronic signals and data travel. The different buses
are collectively called the system bus
The system bus is made up of three different buses - the data bus, the control
bus and the address bus
o The data bus transmits data from the CPU to memory or input/output
controllers. It is bidirectional which means data can travel in both
directions
o The address bus transfers addresses from the CPU to memory. It
is unidirectional which mean addresses only go from the CPU to
memory
o The control bus transfers control signals from the control unit to other
components in the computer system such as memory or input/output
controllers. The control bus is bidirectional
http://www.edwardbosworth.com/My5155_Slides/Chapter12/SystemBusFundamentals.htm
A diagram showing how the different buses connect the components in a computer
system
Worked Example
Which bus is unidirectional?
[1 mark]
The Central Processing Unit (CPU) executes instructions by performing the Fetch
Decode Execute cycle
o The CPU fetches an instruction from memory
o The instruction is then decoded ( by the Control Unit) into
an opcode and an operand
o The instruction is executed and the whole cycle is repeated with the next
instruction in the process
Step
Detailed Explanation
Fetch The memory address of the instruction to be fetched is sent down the address bus.
The data/instruction at the memory address is transferred back to the CPU, via the
data bus, where it is stored in the Memory Data Register
The instruction is copied into the Current Instruction Register and the Program
Counter increments
Execut The instruction is executed by the Arithmetic Logic Unit and the opcode is performed
e upon the operand.
Exam Tip
Make sure you read the question carefully and look at the numbers of marks allocated
to judge the level of detail required. Often questions on the fetch-decode-execute cycle
only require you to describe the steps rather than explain how the registers and buses
are used during each step (as shown in the table above)
CPU Performance
Worked Example
One computer has a single core processor and the other has a dual core processor.
Explain why having a dual core processor might improve the performance of the
computer [2 marks]
The computer with the dual core processor has two cores/double the amount of cores
[1 mark]
Each core can execute a separate instruction at the same time [1 mark]
Exam Tip
There are three key factors that affect CPU performance - the number of cores in your
CPU, the cache size and clock speed. You need to able to identify these factors and
explain how they affect the computer’s performance.
Instruction Sets
An instruction set is a list of all the commands that can be processed by a CPU
Each command has a unique binary code
The table below shows an example instruction set. Each instruction has
a mnemonic that indicates what the instruction does alongside a corresponding
binary code
Instruction Set
ADD 10100001
After an instruction is decoded into an opcode and an operand, the CPU finds the
opcode in the processor’s instruction set. It then knows what operation to
perform when executing the instruction
Worked Example
Using the instruction set in the table above what would be the operation if the
instruction was 00100010 00000010?
[1 mark]
Embedded Systems
Movement sensor
Lighting system Movement sensor Lights
Keypad to enter alarm code
Movement sensor
Actuator controlling movement of
Vending machine Keypad to make choice
choice
Keypad to set temperature
Central Heating system Heat
Temperature sensor
Worked Example
Describe how an embedded system controls a washing machine [3 marks]
The user selects the wash cycle they require using a keypad [1 mark]
The microprocessor will process the inputs and begin to heat the water and move
the drum to begin the wash. The actuator controlling the drum and the heating
mechanism are the output devices [1 mark]
Sensors will monitor the water level and temperature [1 mark]