Fetching a word from memory and storing a word in memory are fundamental operations performed by a computer’s central processing unit (CPU) to access and manipulate data. Here’s a breakdown of both processes:
Fetching a Word from Memory:
- Initiation:Â The CPU identifies the memory location (address) of the word it needs to access.
- MAR (Memory Address Register):Â The address is loaded into a special register called the Memory Address Register (MAR).
- Memory Request:Â The CPU sends a “read” signal to the memory unit along with the address from the MAR.
- Memory Access:Â The memory unit locates the data at the specified address and retrieves it.
- MDR (Memory Data Register):Â The retrieved data (word) is transferred to another special register called the Memory Data Register (MDR).
- Delivery to CPU:Â Finally, the data in the MDR is transferred to the appropriate register within the CPU for further processing.
Storing a Word in Memory:
- Preparation:Â The CPU has the data (word) it wants to store in a specific register.
- MDR (Memory Data Register):Â The data is transferred from the CPU register to the MDR.
- MAR (Memory Address Register):Â The address of the memory location where the data needs to be stored is loaded into the MAR.
- Memory Request:Â The CPU sends a “write” signal to the memory unit along with the address from the MAR.
- Memory Access:Â The memory unit locates the specified address and prepares to receive the data.
- Data Transfer:Â The data from the MDR is written to the memory location specified by the MAR.
Analogy:
Imagine your computer’s memory as a filing cabinet with labeled drawers (memory addresses). Fetching a word is like finding a specific document (data) in a drawer (memory location) using its label (address). You then take the document (data) and place it on your desk (CPU register) for further work.
Storing a word is like taking a document (data) from your desk and putting it back into a specific drawer (memory location) in the filing cabinet (memory). You tell the filing cabinet system (memory controller) where to put it (address) and it writes the document (data) in that location.
These fetch and store operations are coordinated by the CPU’s control unit and involve a series of electrical signals and data transfers on the memory bus. They are essential for the CPU to interact with memory and execute program instructions.