The Fetch Decode Execute Cycle, also known as the Fetch Execute Cycle is the foundation of how all computers work.
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).
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.
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!
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!)
The Fetch Decode Execute Cycle is the process that is used to measure the speed of the CPU. Click here to see the factors that affect the speed of the processor.