COA Notes
Main memory organization, DRAM technology, memory modules, interleaving, and bandwidth optimization.
Introduction
Main memory (RAM) is where your running programs and their data reside. It's the primary workspace of the computer — large enough to hold multiple active programs but fast enough to keep the CPU fed (with cache assistance). Understanding main memory technology — DRAM, memory modules, interleaving, and DDR — helps explain system performance characteristics and design decisions.
DRAM Technology
How DRAM Works
Each DRAM cell stores one bit using a tiny capacitor and a transistor:
- Capacitor charged = logic 1
- Capacitor discharged = logic 0
- The transistor acts as a gate for reading/writing
The Refresh Problem
Capacitors leak charge over time — after a few milliseconds, the data would be lost. DRAM must be refreshed periodically (every ~64 ms) — each row is read and rewritten to restore charge. This is why it's called Dynamic RAM (as opposed to Static RAM/SRAM which uses flip-flops and doesn't need refresh).
DRAM Access Sequence
- Row activation (RAS): Select a row — the entire row is loaded into a row buffer
- Column access (CAS): Select a column within the active row — specific bits are output
- Precharge: Prepare the bank for the next access
RAS-CAS-Precharge cycle takes ~50-100 ns total for random access. But sequential access within the same row is much faster (only CAS needed — ~10-15 ns).
Memory Organization
Memory Banks
DRAM is organized into banks that can operate semi-independently:
| Bank 0 | Bank 1 | |||
|---|---|---|---|---|
| Rows × | Rows × | |||
| Columns | Columns | |||
| Bank 2 | Bank 3 |
While one bank is in the precharge phase, another can be accessed — this interleaving hides some latency.
DDR (Double Data Rate) Memory
Evolution
| Generation | Data Rate | Voltage | Year |
|---|---|---|---|
| SDR (SDRAM) | 100-133 MT/s | 3.3V | 1998 |
| DDR | 200-400 MT/s | 2.5V | 2000 |
| DDR2 | 400-1066 MT/s | 1.8V | 2004 |
| DDR3 | 800-2133 MT/s | 1.5V | 2007 |
| DDR4 | 1600-3200 MT/s | 1.2V | 2014 |
| DDR5 | 3200-8400 MT/s | 1.1V | 2020 |
MT/s = Mega-Transfers per second (data transferred on both rising AND falling clock edges — hence "double data rate")
DDR Bandwidth Calculation
Memory Interleaving
Concept
Spread consecutive addresses across multiple memory modules so that while one module is busy (precharging), the next module is already being accessed.
Low-Order Interleaving (Most Common)
Lower address bits select the module; upper bits select the location within module:
| Address bits | [Module address | Module select] |
| Address 0 | Module 0 Address 4 → Module 0 |
| Address 1 | Module 1 Address 5 → Module 1 |
| Address 2 | Module 2 Address 6 → Module 2 |
| Address 3 | Module 3 Address 7 → Module 3 |
When reading addresses 0,1,2,3 sequentially, each goes to a different module — maximum bandwidth!
Benefit
| Without interleaving | Access time = n × memory_cycle |
| With k-way interleaving | Access time ≈ memory_cycle + (n-1) × transfer_time |
| Without | 4 × 100ns = 400ns |
| With | 100ns + 3 × 25ns = 175ns (2.3× speedup) |
Memory Channels
Modern systems use multiple independent memory channels:
- Single channel: One 64-bit path to memory
- Dual channel: Two 64-bit paths (2× bandwidth)
- Quad channel: Four 64-bit paths (4× bandwidth, server/HEDT platforms)
Each channel has its own set of DIMMs, operating independently and in parallel.
Error Correction in Memory
ECC (Error-Correcting Code) Memory
- Adds extra bits (8 bits per 64-bit word) for Hamming-based error correction
- Detects and corrects single-bit errors; detects double-bit errors
- Essential for servers and critical systems
- ~2-3% performance overhead
Key Takeaways
- DRAM stores bits in capacitors — dense and cheap but needs periodic refresh
- Access involves row activation (RAS) + column select (CAS) + precharge
- DDR transfers data on both clock edges, doubling the effective data rate
- Memory interleaving hides latency by overlapping accesses to different banks/modules
- Multi-channel configurations multiply bandwidth proportionally
- DDR5 provides ~51 GB/s bandwidth with 6400 MT/s data rate
- ECC memory adds error correction capability for mission-critical systems
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Main Memory.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Organization & Architecture topic.
Search Terms
computer-organization, computer organization & architecture, computer, organization, memory, main, main memory
Related Computer Organization & Architecture Topics