Computer Organisation and Architecture · Memory Interfacing
Introduction to Memory Interfacing and CPU Speed in MIPS
Overview
Memory interfacing is the study of how the various parts and types of memory are connected to each other, to the I/O devices, and to the CPU. It matters because a CPU can only run as fast as instructions can be supplied to it, and memory is slower than the CPU — so the way memory is organized and connected determines whether the CPU's speed can actually be used.
Key concepts
- Memory interfacing: how the various parts and types of memory are connected to each other, to the I/O devices, and to the CPU.
- Computer organization vs. architecture: organization deals with how the various parts are connected/wired together; architecture deals with the programmer-visible instruction set.
Interfacing is about connecting parts, so it belongs to organization. - Program: any input given to the system; it resides in memory and must be supplied to the CPU for execution.
- MIPS (Million Instructions Per Second): the common measure of CPU speed; 1 MIPS means the CPU executes one million () instructions in one second.
- Bottleneck: the slowest component that holds back the faster one. If the CPU executes a program directly from the hard disk, the CPU runs fast but is held back by slow secondary memory, which becomes the bottleneck.
- Memory hierarchy (fastest to slowest): CPU — cache — main memory — secondary memory. Registers form one more level: a relatively small but very fast memory present inside the CPU.
- Volatile memory: memory that is not permanent and cannot retain data (cache and main memory are volatile; secondary memory is not).
- Process: a program that has been loaded into main memory.
- Pages: the unit of data movement between secondary memory and main memory (paging, segmentation, segmented paging, and virtual memory are covered under operating systems).
- Blocks or words: the unit of data movement between main memory and cache (cache memory concepts).
- Cache mapping: mapping data from main memory to cache.
- Main memory mapping / virtual memory mapping: mapping data from secondary memory to main memory.
How it works
- A program resides in memory and must be supplied to the CPU for execution; input to the CPU comes mainly through memory.
- Memory speed is less than CPU speed, so memory can become the bottleneck. Keeping data only on the hard disk (secondary memory) makes the slow secondary memory the bottleneck.
- Moving data to a higher-speed memory (main memory) helps, but main memory is still not as fast as the CPU, so an even higher-speed memory (cache) is added.
- The resulting organization is CPU — cache — main memory — secondary memory. The CPU is connected directly to the cache, and sometimes directly to the main memory.
A program is never accessed directly from secondary memory; it is first fetched into main memory. - Cache alone cannot serve as all of memory: it is very costly (increasing its size makes the whole computer system very expensive) and it is volatile. Hence a trade-off of low-speed memory + medium-speed memory + high-speed memory.
- Main memory alone cannot hold everything either: it is also volatile and also costly.
So only some main memory is provided, everything is stored in secondary memory, and a program is loaded into main memory when required — at that point it becomes a process. - Program flow: the program is moved into main memory (becoming a process); a part of the process is moved into cache as and when required; from cache, instructions are taken one by one into registers and executed.
- Depending on how much cost is acceptable for the computer system, one chooses how much cache, how much main memory, and how much secondary memory to buy.
Formulas
- — MIPS is Million Instructions Per Second, the rate at which the CPU executes instructions.
Comparison
| Feature | Cache | Main memory | Secondary memory |
|---|---|---|---|
| Speed | High (faster than main memory) | Medium (not as good as the CPU) | Very slow |
| Cost | Very costly | Costly | Cheapest |
| Volatility | Volatile | Volatile | Non-volatile (retains data) |
| Role | Holds the part of the process needed now; connected directly to the CPU | Holds the program when it becomes a process | Stores everything; programs are never executed directly from it |
| Data movement | Unit of transfer | Mapping name |
|---|---|---|
| Secondary memory ↔ main memory | Pages | Main memory mapping / virtual memory mapping |
| Main memory ↔ cache | Blocks or words | Cache mapping |
Revision summary
- MIPS = Million Instructions Per Second; 1 MIPS = instructions per second.
- Memory speed is less than CPU speed, so memory can become the bottleneck — this motivates the hierarchy.
- Hierarchy from slow/cheap to fast/costly: secondary memory → main memory → cache → registers (registers are inside the CPU).
- A program is never accessed directly from secondary memory; it is first fetched into main memory, where it becomes a process.
- Cache is rejected as the only memory because it is costly and volatile; main memory is rejected as the only memory because it is costly and volatile.
- Unit of transfer: pages between secondary and main memory; blocks/words between main memory and cache.
- Mapping names: main memory → cache is cache mapping; secondary memory → main memory is main memory mapping / virtual memory mapping.
- Memory interfacing is part of computer organization (connecting parts), not architecture.
Previous-year exam insights
- CPU execution time = instruction count × CPI × clock cycle time (or instruction count × CPI / clock rate);
MIPS = clock rate / (CPI × ).
Asked inUGC NET 2015 - Speedup from improving one unit = 1 / ((fraction of work not improved) + (fraction of work improved / improvement factor)) (Amdahl's law);
when operations have different original times, weight each by its share of total original time.
Asked inGATE 2004 - Maximum data transfer rate of a bus = bus width in bytes / minimum bus cycle time, where bus cycle time = number of clock cycles per bus cycle / clock frequency.
Asked inUGC NET 2015 - Memory access time available per CPU cycle = clock cycle time;
if memory access time plus decoding/buffering delay exceeds one clock cycle, wait states = ceil(required time / clock cycle time) − 1.
Asked inISRO 2014 - Speedup from widening the bus and raising the clock = (new clock rate / old clock rate) × (new bus width / old bus width).
Asked inISRO 2011 - In DMA/block transfer with cycle stealing, maximum transfer rate = fraction of CPU time available for the memory bus × bus transfer rate per cycle (memory bus cycles per second × bytes per cycle).
Asked inUGC NET 2015