You are on page 1of 5

What is the purpose of the CPU?

The purpose of the CPU is to process data. The CPU is where processes such as
calculating, sorting and searching take place. Whatever is done on our computers,
such as checking emails, playing games and doing homework, the CPU has
processed the data we use.

The CPU is made up of three main components, the control unit, the immediate
access store and the arithmetic and logic unit.

The control unit


The control unit controls the flow of data within the system.

The control unit controls and monitors communications between


the hardware attached to the computer. It controls the input and output of data,
checks that signals have been delivered successfully, and makes sure that data goes
to the correct place at the correct time.

Immediate access store


The immediate access store is where the CPU holds all the data
and programs that it is currently using. You can think of it like the numbers typed
into a calculator – they are being stored inside the calculator while it processes the
calculations. The immediate access store is often referred to as the registers in the
CPU.

Arithmetic and logic unit


The arithmetic and logic unit (ALU) is where the CPU performs the arithmetic
and logic operations. Every task that your computer carries out is completed here.
Even typing into a word processor involves adding binary digits to the file, and
then calculating which pixels on the screen should change so that you can see the
characters. The ALU’s operations fall into two parts:

 the arithmetic part, which deals with calculations, eg 1 + 2 = 3


 the logic part, which deals with any logical comparisons, eg 2>1
CPU speed
A computer’s speed is heavily influenced by the CPU it uses. There are three main
factors that affect how quickly a CPU can carry out instructions:

 clock speed
 cores
 cache
Clock speed
CPUs can only carry out one instruction at a time.
It might seem like CPUs can perform many instructions simultaneously, since it is
possible for you to do homework, read instant messages and listen to music at the
same time. However, the CPU is able to carry out instructions at such speed that it
can seem like it is simultaneous.

The speed at which the CPU can carry out instructions is called the clock speed.
This is controlled by a clock. With every tick of the clock, the CPU fetches
and executes one instruction. The clock speed is measured in cycles per second,
and one cycle per second is known as 1 hertz. This means that a CPU with a clock
speed of 2 gigahertz (GHz) can carry out two thousand million (or two billion)
cycles per second.
The higher the clock speed a CPU has, the faster it can process instructions.

The higher the clock speed a CPU has, the faster it can
process instructions.
Cores
A CPU is traditionally made up of a processor with a single core. Most modern
CPUs have two, four or even more cores.

A CPU with two cores, called a dual core processor, is like having two processors
in one. A dual core processor can fetch and execute two instructions in the
same time it takes a single core processor to fetch and execute just one
instruction. A quad core processor has four cores and can carry out even more
instructions in the same period of time.

The main downside of using quad core processors is that they are more expensive
to design and make, and they also use more power than single or dual core
processors. Another disadvantage is that the instructions have to be split up to
decide which core will execute them and the results have to be merged together
again at the end, which slows the processor down a little.
Cache
A cache (pronounced ‘cash’) is a tiny block of memory built right onto the
processor. The most commonly used instructions and data are stored in the cache
so that they are close at hand. The bigger the cache is, the more quickly the
commonly used instructions and data can be brought into the processor and used.

The fetch-execute cycle


The basic operation of a computer is called the ‘fetch-execute’ cycle. The
computer fetches the instruction from its memory and then executes it. This is done
repeatedly from when the computer is booted up to when it is shut down.

Fetching the instruction


The first step the fetch-execute cycle carries out is fetching the instruction. The
CPU fetches this from the main memory (the hard drive) and stores it in the CPU
temporary memory, the immediate access store (the registers).

Once the instruction has been fetched, the CPU will need to understand the
instruction to action it. This is called decoding.

Executing the instruction


When the instruction has been decoded, the CPU can carry out the action that is
needed. This is called executing the instruction. The CPU is designed to
understand a set of instructions - the instruction set.
A single piece of program code might require several instructions. Look at this
Python (3.x) code:
area = length * width
First, the computer needs to load in the value of the variable length into the
immediate access store (registers). Next it needs to load in the value of the
variable width. Then it needs to multiply the two numbers together, and finally it
needs to store the result in the variable area.

You might also like