Inside the CPU

Learning Objectives

  • To understand the major components inside the Central Processing Unit
  • To understand the fetch-decode-execute cycle

Learning Outcomes

All must have watched and, with help, understood the videos on the basics of the CPU and the fetch-decode-execute cycle.  Read through and understood what each different component of the CPU is and be able to describe it basically in a GCSE style question.  Tried out the Little Man Computer and use this to help describe the fetch-decode-execute cycle. (Grade D/E)

Most should have watched and understood the videos on the basics of the CPU and the fetch-decode-execute cycle.  Read through and understood what each different component of the CPU is and be able to explain it in a GCSE style question.  Tried out the Little Man Computer and use this to help explain the fetch-decode-execute cycle. (Grade B/C)

Some could have watched and understood the videos on the basics of the CPU and the fetch-decode-execute cycle.  Read through and understood what each different component of the CPU is and be able to explain it in a GCSE style question, justifying each point.  Tried out the Little Man Computer and use this to help justify why the fetch-decode-execute cycle is used. (Grade A*/A)

Keywords

Words to learn: processing, register, decode, execute

Starter

We have looked in previous lessons at input devices, output devices and storage devices.  At the heart of the input, process, output model is a processor – in a computer this is called a CPU (Central Processing Unit).

We have also watched videos on how the CPU is made and what it does on a general level.  But what is actually inside a CPU?  How does it work?

Watch the following videos on:

Main

Look at the diagram below which illustrates the main components inside the Central Processing Unit:

Inside the CPU Diagram

The registers provide a small amount of temporary storage space for the units which perform tasks.  The units are connected to RAM and other input/output devices using the buses.

Looking at the registers, there are some important registers:

  • Program Counter – stores the RAM address of the next instruction to be fetched from RAM by the control unit
  • Instruction Register – stores the details of the instruction currently being executed by the control unit
  • Address Register – stores the RAM address of the next piece of data to be fetched or stored in RAM by the control unit
  • Accumulator Register – stores the results of any calculations by the arithmetic and logic unit

There are two units we need to know about at GCSE (there are other units as well, but that’s for A level…):

  • Control Unit – This part of the CPU works out if it is time to fetch an instruction/data, decode an instruction or execute an instruction.  It does this by switching each time it receives a pulse from the clock.  It connects to the registers using internal cabling within the CPU and connects to external RAM and devices using the three buses
  • Arithmetic and Control Unit – This part of the CPU performs calculations and makes decisions based upon the instructions given to it.  It can access registers and RAM but must go through the control unit.

Finally there are the buses – there are three we need to know about:

  • The data bus – holds the instructions/data either being sent or retrieved from RAM or other devices
  • The address bus – used to hold the address of where instructions/data are being sent to or retrieved from in RAM
  • The control bus – indicates to RAM if the information on the data and address buses are being stored or read.  Also tells RAM and other devices what stage of the fetch-decode-execute cycle is active.

We can simulate a CPU by using the Little Man Computer (LMC).  This is an online simulation of a very basic computer.  You can have a look at the LMC by clicking here.

lmc

The LMC looks complicated, but it really isn’t.  On the left hand side we can see the CPU along with what four registers are currently holding and the arithmetic and logic unit connected to it.

At the bottom in the purple INPUT box the user can provide input and at the top in the pink OUTPUT box the computer can display results.

On the right hand side we can see each address in RAM along with the contents – which could be an instruction or it could be data.

Let’s see the LMC in action.  At the bottom left of the screen, next to the HELP button there is a drop down menu.  From this menu choose “add”.  This will load a simple program into the LMC.  Your teacher will run the example and explain how the computer works through the fetch-decode-execute cycle.  Have a go yourself and see if you can work out how the LMC works.

In the next lesson you will look at more detail as to how the LMC works and how you can program it to solve problems.

Plenary

Have a go at answering this GCSE exam style question:

Ashley has a desktop PC with a 3.4GHz Smantel central processing unit (CPU).  Describe the purpose of the following CPU components:

a) The Program Counter register
b) The Arithmetic and Logic unit
c) The Control bus

(6 marks)