Paper 1 - Computer Systems
Paper 2 - Computational Thinking, Algorithms, and Programming

The Fetch Decode Execute Cycle

The Fetch Decode Execute Cycle, also known as the Fetch Execute Cycle is the foundation of how all computers work.

Purpose of the CPU - fetch decode execute

When computers were first created, basic instructions were provided directly to the computer along with the data to be used. The machine claimed to be the first real computer was the Difference Engine, created by Charles Babbage and programmed by Ada Lovelace.

Today, our machines are far more complex and use a system known as the Stored Program Concept. What this means is that both our instructions and data are stored in the same format…. binary!

In order for the computer to understand what is instruction and what is data, it needs to perform a set of tasks that fetches the required information, understands it, then processes it. This is known as the Fetch, Decode, Execute Cycle (also referred to as the Fetch Execute Cycle).

Fetch

In this stage, the processor gets the next instruction from main memory along with any data needed and holds these in special memory locations called registers.

Registers act as specific pieces of memory within the processor that hold the instructions in data within the main memory. The reason for having registers directly within the processor is related to the speed at which instructions need to be processed. Whilst my memory is much faster than secondary storage, there is still a hierarchy within the main memory itself.

Often, this is referred to as the immediate access store with the RAM being the largest and slowest within primary memory and cache having separate levels which include level 2 and 3 directly outside the CPU. Level one is often found inside the processor itself. With cache having different levels, this allows the highest priority instructions and data to be stored in the level one cash and accessed more quickly.

Decode

Once the required information is obtained from the main memory, the processor has to decode the binary into two parts. The first part is the instruction, and at this stage of the cycle is called the Opcode.

The second part is the data which is referred to as the Operand.

These words should be familiar to you from maths. When you perform a mathematical calculation, the Operator (what we called the Opcode) is the function to be performed. Eg. Add, or subtract. Whereas the data / numbers to be operated upon is called the Operand… the same!

Execute

Finally, the processor knows what to do with the instruction and data and can complete the task. Once the outcome is known, this is stored in the final register called the Accumulator.

Imagine this as the screen of your calculator that is showing you a running total as you perform more operations.

Grab a calculator and have a go – how does that running total work? (hint. It’s the processor!)

Activity

The Fetch Decode Execute Scribbl.it Notes provide a structured way for you to revise topic areas in a visual way. You don’t have to be an artist as it’s all been drawn out for you (or you can use this as inspiration to create your own!). Print the notes, then colour in areas of importance, add doodles and colour, then add more detail to the notes page being as creative as possible.