teach-ict.com logo

THE education site for computer science and ICT

3. The fetch-decode-execute cycle

A standard process describes the steps needed for processing to take place. It is called the Fetch - Decode - Execute cycle or sometimes simply called the Fetch-Execute Cycle.

First of all, both the data and the program that acts upon that data are loaded into main memory (RAM) by the operating system. The CPU is now ready to do some work.

1. FETCH

The first step the CPU carries out is to fetch some data and instructions (program) from main memory then store them in its own internal temporary memory areas. These memory areas are called 'registers'. fetch decode execute cycle

This is called the 'fetch' part of the cycle.

For this to happen, the CPU makes use of a vital hardware path called the 'address bus'.

The CPU places the address of the next item to be fetched on to the address bus.

Data from this address then moves from main memory into the CPU by travelling along another hardware path called the 'data bus'.

You could imagine that it is a bit like a boat attendant at a lake calling in customers when their time is up -- "Boat number 3, time to come in!" The 'address' of the boat is 3 and the 'data' is its content. The boat is parked at a pier, which is like the internal register of the CPU.

 

2. DECODE

The next step is for the CPU to make sense of the instruction it has just fetched.

This process is called 'decode'.

The CPU is designed to understand a specific set of commands. These are called the 'instruction set' of the CPU. Each make of CPU has a different instruction set.

The CPU decodes the instruction and prepares various areas within the chip in readiness of the next step.

 

3. EXECUTE

This is the part of the cycle when data processing actually takes place. The instruction is carried out upon the data (executed). The result of this processing is stored in yet another register.

Once the execute stage is complete, the CPU sets itself up to begin another cycle once more.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Fetch Decode Execute Cycle