Chapter 3
Chapter 3
•The purpose of the Central Processing Unit (CPU) is to fetch, decode and
execute instructions
• The CPU is the brain of the computer and its job is to take an input, process data
and produce an output
• It is central to all devices including:
o Laptops o
Desktops o Games-
Consoles o Mobile
Devices
• The words CPU and Microprocessor are interchangeable and can be used to
mean the same thing
• A microprocessor is a type of integrated circuit on a single chip
• Data and commands are inputted by the user using an input device, the central
processing unit (CPU) processes data by executing instructions and the
results are outputted to an output device
• Below is an example of data being inputted, processed and the results being
outputted
Step Example
Memory Data
MD • Stores the data or instruction which
Register R has been fetched from memory
Current
Instruction
CIR
Register
• Stores the instruction the CPU is
currently decoding or executing
• The purpose of the Central Processing Unit (CPU) is to fetch, decode and
execute instructions
• The CPU is the brain of the computer and its job is to take an input, process data
and produce an output
What is the Fetch-Decode-Execute cycle?
• The Fetch-Decode-Execute Cycle is the cycle that the central processing unit
(CPU) runs through billions of times per second to make a computer work
• A computer takes an input, processes the input and then delivers an output for
the user
o Input: Clicking a button on the gamepad
o Process: The CPU inside the console follows a set of instructions to
carry out the task o Output: The player moving on screen
Fetch stage
• During the fetch stage of the cycle, the program counter holds the address of
the next instruction to be fetched from memory
• The address of the next instruction or data to be fetched is copied into the
memory address register (MAR)
• The address of the instruction or data is then sent along the address bus and
awaits a signal from the control bus
• The signal sent along the control bus is sent from the control unit (CU) to the
main memory
• The data or instructions received from main memory is fetched to the memory
data register (MDR) via the data bus
• A copy of the instruction or data is stored in the current instruction register
(CIR)
• The program counter (PC) increments by 1 so it is pointing to the next
instruction to be executed
Decode stage
• During the decode stage of the cycle, the CPU needs to work out what is
required from the instruction
• This is done as the instruction is split into two parts:
o Opcode - what the instruction is o
Operand - what to do it to
▪ This could be either data or an address where the data is stored
Execute stage
• During the execute stage of the cycle, the CPU will carry out the instruction
that was fetched
• Some examples that would take place at this stage are
o Performing a calculation
o Storing a result or data back in main memory (RAM) o
Going to main memory to fetch data from a different location
The important things to remember are:
[6]
Answer
• The Program Counter (PC) holds the address/location of the next
instruction to be fetched [1]
• The address held in the PC is sent to the Memory Address Register (MAR)
[1]
• The memory address is sent using the address bus [1]
• The Program Counter is incremented [1]
• The instruction is sent from the address in memory to the Memory Data
Register (MDR) [1]
• The instruction is transferred using the data bus [1]
• The instruction is sent to the Current Instruction Register (CIR) [1]
Clock speed
• The clock speed is measured in Hertz (Hz)
• The clock speed measures the number of fetch-decode-execute cycles that can
take place in 1 second
• The faster the clock speed, the more instructions can be fetched and executed
per second
• Modern computers have a clock speed in Gigahertz (GHz), meaning billion
• A clock speed of 3.5GHz can perform up to 3.5 billion instructions per second
Cache size
• Cache is very small, very fast memory on or close to the CPU
• Cache is used as temporary storage to provide quick access to a copy of
frequently used instructions and data
• The larger the cache size, the more frequently used instructions or data can be
stored
• This results in the CPU having to complete fewer fetch cycles from memory
(RAM), speeding up the performance
• Cache also has a significantly faster read/write speed than RAM, making it much
quicker to retrieve instructions from there instead of from memory (RAM)
Number of cores
• A core works like it is its own CPU
• Multiple core processors mean they have multiple separate processing units that
can fetch, decode and execute instructions at the same time
• For example, a dual-core processor would have 2 processing units, each with
their own
o Control Unit (CU) o
Arithmetic Logic Unit (ALU) o
Accumulator (ACC) o
Registers
• Multi-core processors can run more powerful programs with greater ease
• Multiple cores increase the performance of the CPU by working with the clock
speed
o Example: A quad-core CPU (4 cores), running at a clock speed of 3Ghz
▪ 4 cores x 3GHz
▪ 4 x 3 billion instructions
▪ 12 billion instructions per second
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]
Answer
Any2 from:
• The computer with the dual core processor has two cores/double the
amount of cores [1]
• Parallel processing can take place [1]
• Each core can execute a separate instruction at the same time [1]
• Each core can process instructions independently of each other [1]
• An instruction set is a list of all the commands that can be processed by a CPU
• Each command has a binary code which is called machine code
• The binary code is made up of an operation code (opcode) and an operand o
The opcode is the operation to be performed
o The operand is the location where the operation is to be performed in
• The table below shows an example instruction set
• Each instruction has a mnemonic that indicates what the instruction does
alongside an example binary code
• 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
Instructi Mnemo Binary Command
on nic code
Input Devices
What is an Input Device?
• Input devices are hardware components that allow users to interact with a
computer system
• They enable the user to input data or commands into the system, which the
computer then processes to produce an output
Types of input devices
Name of Where is it
What does it do? Why is it used? device used?
• Make a
Actuator • Converts energy into robot's • Essential in
• User Needs o What tasks will the user be performing? A graphic designer might
need a graphics tablet, while a data entry clerk might need a keyboard with a
number pad
• User Skills o Is the user comfortable with the device? A touch screen might be
more intuitive for some users, while others might prefer a mouse and keyboard
• Environment o Where will the device be used? A wireless mouse might be
suitable for a clutter-free office, while a wired mouse might be better for a public
computer lab to prevent theft
• Cost o Higher-end devices often have more features but are also more
expensive. Consider the budget and whether the extra features are worth the
cost
Sensors
• Sensors are input devices
• They measure a physical property of their environment such as light levels,
temperature or movement
• Sensors can be used for monitoring systems and control systems
o A monitoring system tracks the state of a system, it gathers data and
may issue warning messages
o A control system will control the system based upon the input from
sensors
o For example, if the water temperature in a fish tank fell below the
acceptable level, a control system would start up a heater
o The system will then continue to check the water temperature readings
(outputs) and when they are within the acceptable range it will switch off
the heater
• A process where outputs are recycled and used as inputs, creating a
continuous cycle is called a feedback loop
Sensor
What it measures Typical use
type
What is a router?
• The router is responsible for routing data packets between different networks
• An example of data the router can direct is, sending internet traffic to the correct
destination/devices in your home network
• The router connects networks together, local area networks (LAN) to the wider
internet which is a type of wide area network (WAN)
• The router can manage and prioritise data traffic, which can help to keep
connections stable
• The router will assign IP addresses to the devices on the network
• MAC Addresses
• IP Addresses
• What is an IP address?
•
32
• IPv4 provides over4 billion unique addresses(2 ), however, with over7
billion people andcountless devices per person , a solution was needed
• IPv6
•
• IPv6 could provide overone billion unique addressesfor every personon the
planet (2128 )
•