Fetch-Execute Cycle and Register Transfer Notation
A processor repeatedly fetches an instruction from memory, works out what it means, and carries out its operation. This repeating process is the fetch-execute (F-E) cycle. Register transfer notation (RTN) gives a compact way to describe values moving between registers and memory.
By the end of this page, you should be able to:
- describe the fetch, decode and execute stages;
- read RTN and explain what square brackets mean;
- distinguish a register from its contents, and an address from the contents stored there;
- trace how an instruction moves from memory into the processor.
1. The processor repeats three stages
The fetch-execute cycle is the repeated process the CPU uses to run a program. Each instruction passes through three main stages.
| Stage | What happens | Key point |
|---|---|---|
| Fetch | The processor gets the next instruction from main memory. | The instruction is brought into the processor. |
| Decode | The Control Unit interprets the instruction. | The processor identifies the operation required. |
| Execute | The processor carries out the operation. | The action depends on the instruction. |
After execution, the processor starts another cycle to process the next instruction. A program therefore runs through many fetch, decode and execute stages.
Fetch does not mean execute
During fetch, the processor obtains an instruction. It works out what the instruction means during decode, then carries out the operation during execute.
2. RTN describes transfers between registers
Register transfer notation (RTN) describes how values move between registers and how an operation uses those values. The left arrow β means that the value on the right is placed into the register on the left.
| RTN | Meaning |
|---|---|
MAR β [PC] |
Copy the contents of PC into MAR. |
MDR β [[MAR]] |
Use the address in MAR to read memory, then place the memory contents in MDR. |
CIR β [MDR] |
Copy the contents of MDR into CIR. |
[PC] means
the value currently held in PC. In [[MAR]], the inner brackets give the address
held in MAR; the outer brackets mean the contents of memory at that address.
Do not confuse the register with the value
MAR is a register. If MAR contains 320, then 320 is its content.
In this example, 320 is an address. The instruction stored at memory address
320 is a different value.
3. Fetch the instruction in a clear sequence
The Program Counter (PC) holds the address of the next instruction. The processor copies that address to MAR, reads the instruction from memory, and places it in CIR.
- MAR β [PC]: copy the next instruction address from PC to MAR.
- PC β [PC] + 1: advance PC to the next sequential address.
- MDR β [[MAR]]: read the instruction at the address in MAR into MDR.
- CIR β [MDR]: copy the fetched instruction into CIR.
PC changes after its current address has been copied to MAR. MAR keeps the address being read, while PC now identifies the following instruction address. The instruction itself moves from memory through MDR to CIR.
The sequence on this page increments PC after copying the address to MAR. If a question gives you a particular RTN sequence, follow that sequence and keep each transfer in its stated order.
4. Decode the instruction, then execute it
Once the fetched instruction is in the Current Instruction Register (CIR), the Control Unit (CU) decodes it. The CU identifies the operation and the information needed to carry it out.
During execute, the processor performs the required operation. It may use the ALU, registers or memory, depending on the instruction. The F-E cycle then continues with the next instruction.
MDR and CIR have different roles
MDR temporarily holds information being transferred to or from memory. CIR holds the current instruction while it is decoded and executed. The CU decodes the instruction; the registers hold values.
Interactive: step through one fetch-execute cycle
Use Next step to follow a small program. The memory table shows an instruction
at address 320, another instruction at 321, and a value at address
510. The ACC begins with 12.
5. Avoid these common mix-ups
| Mix-up | Keep the ideas separate |
|---|---|
| Address and instruction | The address identifies a memory location; the instruction is stored at that location. |
| MAR and memory contents | MAR holds an address; double brackets in [[MAR]] refer to the contents at that address. |
| MDR and CIR | MDR temporarily holds transferred information; CIR holds the current instruction. |
| Decode and execute | The CU interprets the instruction during decode; execute carries out its operation. |
| Register and contents | A register is a storage location; its contents are the value held there now. |
6. Check your understanding
Try each question before opening the suggested response.
-
PC contains address
700. Write the RTN that copies its contents into MAR.Suggested response
MAR β [PC] -
After the address is copied, PC is increased by one. What does MAR contain, and what does PC contain?
Suggested response
MAR still contains
700; PC contains701. -
MAR contains
700. Write the RTN to place the contents of that memory location into MDR.Suggested response
MDR β [[MAR]]. The double brackets mean the contents of memory at the address held in MAR. -
Which register holds the current instruction during decode, and which component decodes it?
Suggested response
The CIR holds the current instruction. The CU decodes it.
-
Put the three F-E stages in order.
Suggested response
Fetch, decode, execute. The processor repeats the cycle for the next instruction.
Final check
When tracing RTN, read each line from right to left: identify the source value first, then state which register receives it. Keep the address, the memory contents and the instruction in CIR distinct.