0% found this document useful (0 votes)
57 views6 pages

What Is The Fetch-Execute Cycle

The fetch-execute cycle is the process by which the CPU retrieves, decodes, and executes instructions from memory, consisting of three main stages: Fetch, Decode, and Execute. This cycle is essential for the operation of the CPU and involves various components such as the Program Counter, Memory Address Register, and Arithmetic Logic Unit. It occurs billions of times per second in modern processors, enabling continuous instruction processing.

Uploaded by

risenyeom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views6 pages

What Is The Fetch-Execute Cycle

The fetch-execute cycle is the process by which the CPU retrieves, decodes, and executes instructions from memory, consisting of three main stages: Fetch, Decode, and Execute. This cycle is essential for the operation of the CPU and involves various components such as the Program Counter, Memory Address Register, and Arithmetic Logic Unit. It occurs billions of times per second in modern processors, enabling continuous instruction processing.

Uploaded by

risenyeom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

What is the Fetch-Execute Cycle?

The fetch-execute cycle (also known as the fetch-decode-execute cycle) is the process the CPU
follows to retrieve an instruction from memory, understand it, and then execute it. It repeats
continuously while the computer is running.

Three main stages:

1. Fetch – The CPU retrieves an instruction from memory.

2. Decode – The CPU interprets (decodes) the instruction.

3. Execute – The CPU carries out the instruction.

To make this clearer, let’s use an analogy:


Imagine you are a student following a to-do list.

Fetch: You look at the first task on your list.

Decode: You read and understand what needs to be done.

Execute: You complete the task.

Then, you move on to the next task and repeat the cycle.

Now, let’s get into the technical details.

Step-by-Step Breakdown of the Fetch-Execute Cycle:

1. Fetch Stage

The Program Counter (PC) holds the address of the next instruction to be fetched.
The Memory Address Register (MAR) takes this address from the PC.

The CPU fetches the instruction stored at that address in RAM and stores it in the Memory
Data Register (MDR).

The Program Counter (PC) is incremented to point to the next instruction.

2. Decode Stage

The Control Unit (CU) interprets the instruction stored in the MDR.

If it involves data, the CPU gets ready by identifying which registers are needed.

3. Execute Stage

The instruction is carried out.

This could involve arithmetic operations (using the Arithmetic Logic Unit (ALU)),
loading/storing data, or changing the flow of execution (e.g., a jump instruction).

The result may be stored in a register or sent to an output device.

Diagram Representation

1. Fetch:
PC → MAR → MDR → CIR
2. Decode:
CIR → CU
3. Execute:
ALU / Registers → Output

I recommend drawing this cycle on the board with arrows to show the flow of data.

Example in Assembly Language


Consider a simple instruction like:

ADD 5, 3

Fetch: The CPU retrieves this instruction from memory.

Decode: The CU identifies it as an ADD operation.

Execute: The ALU performs 5 + 3 = 8, and stores the result.

---

Common Misconceptions & How to Address Them

1. "The CPU fetches the instruction and data at the same time."

Explain that fetching an instruction is separate from fetching data. The CPU fetches the
instruction first, then fetches the required data if needed.

2. "The CPU executes only one instruction at a time."

Modern CPUs use pipelining, meaning they work on multiple instructions at different stages
simultaneously.

---

Interactive Activities to Reinforce Understanding

1. Role-Playing the CPU

Assign students different CPU components (PC, MAR, MDR, ALU, CU) and have them act out
the fetch-execute cycle.

One student (PC) holds a list of instructions, another (MAR) fetches from a "memory location,"
and so on.
2. CPU Simulation

Use an online simulator like Little Man Computer (LMC) to allow students to step through each
stage of the cycle.

3. Quick Quiz Questions

What are the three stages of the fetch-execute cycle?

What is the function of the Program Counter?

What does the ALU do?

Summary for the Students

The fetch-execute cycle is how the CPU retrieves, interprets, and carries out instructions.

It involves the PC, MAR, MDR, CIR, CU, ALU, and Registers.

This cycle happens billions of times per second in modern processors.

Marking Scheme
2(a) The CPU fetches an instruction: LOAD 50 (5 marks)

The LOAD 50 instruction means the CPU should load the value stored at memory
address 50 into a register. The process follows these steps:

1. Fetch (2 marks)

The Program Counter (PC) holds the address of the next instruction (e.g., 200).

The Memory Address Register (MAR) takes this address and sends a request to RAM.
The instruction (LOAD 50) is retrieved from memory and stored in the Memory Data
Register (MDR).

The instruction is transferred to the Current Instruction Register (CIR) for decoding.

The PC is incremented to point to the next instruction.

2. Decode (1 mark)

The Control Unit (CU) interprets the instruction (LOAD 50).

It identifies that the CPU must fetch data from memory location 50 and store it in a
register.

3. Execute (2 marks)

The MAR is updated with the address 50.

The CPU fetches the data from memory address 50 and stores it in a general-purpose
register (e.g., Accumulator).

---

2(b) Explanation of CPU State (3 marks)

The CPU registers show the following:

PC = 200 → The next instruction is located at address 200. (1 mark)

MAR = 200 → The CPU is currently fetching the instruction stored at address 200. (1
mark)

MDR = 11001010 → The instruction retrieved from memory (binary representation of an


operation) is stored in the Memory Data Register (MDR), ready to be decoded. (1 mark)
At this moment, the CPU is at the end of the fetch stage, preparing to decode and
execute the instruction stored in the MDR.

You might also like