The term fetch/execute is used to describe the process of sending and receiving data to/from the processor and memory (whether it be RAM (main memory) or cache).
When a memory read operation occurs;
- data is read from a memory address
- it is then taken to the processor
When a memory write operation occurs:
- data is taken from the processor
- it is then written to the memory
During the fetch/execute cycle the control unit, data bus and address bus are all in use:
the control unit will:
- dictate the clock speed of the fetch/execute cycle
- activate either the read or write line
the address bus will hold the address that is being accessed in main memory
the data bus will either transfer the data contained the memory address to the processor, or will transfer data from the processor to the memory address
The control unit clock line is active at all times, setting the pulse/pace of the fetch/execute cycle.
Memory read
The steps for a read operation are:
- MAR (Memory Address Register) sets up the address bus with the relevant memory location to be read from.
- The control unit read line is activated
- The contents of the address held on the address bus are placed on the data bus
- The data bus transfers the data from memory to the MDR (memory Data Register)
Example of a program being read
The memory address of the first instruction is placed on the address bus.
A read signal is activated on the control bus and the data is transferred along the data bus to a register within the processor.
The instruction is then decoded and executed.
The process is repeated until the program is complete.
Memory write
The steps of a write operation are:
- MAR (Memory Address Register) sets up the address bus with the relevant memory location to be written to
- MDR (Memory Data Register) passes the data to be written to the data bus
- The control unit write line is activated
- Data bus transfers the data to the memory location specified on the address bus
Think of it like the steps to sending an email.
You type the email address that you want your message sent to.
You type the messageof the email ready to be sent.
You click the send button.
The application and email servers deliver your message to the address you entered.