1. Home
  2. Explore
  3. Computer Science
  4. Computer Memory Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Computer Memory Overview

DRAM (Dynamic Random Access Memory) Study Notes

1. Why Computers Use Both SSDs and DRAM

Computers use two main types of memory: Solid-State Drives (SSDs) for long‑term storage and Dynamic Random Access Memory (DRAM) for working memory. The CPU can only process data that has been moved into DRAM, which is why loading programs requires copying data from the SSD to DRAM — this is the origin of loading bars.

The key difference is speed versus capacity:

  • SSD — stores terabytes of data permanently in massive 3D arrays of memory cells. Access time is approximately 50 microseconds (50×10−650 \times 10^{-6}50×10−6 s).

  • DRAM — stores gigabytes of data temporarily in 2D arrays of capacitor‑based memory cells. Access time is approximately 17 nanoseconds (17×10−917 \times 10^{-9}17×10−9 s).

Speed comparison: DRAM is about 3000 times faster than an SSD. This is analogous to a supersonic jet (Mach 3) vs. a moving tortoise.

However, DRAM is volatile — it loses data when power is removed and requires periodic refreshing. DRAM also has much lower capacity per physical volume than an SSD. Therefore, computers use both: the SSD provides large permanent storage, and during loading, data is copied (and prefetched) into DRAM so that the CPU can access it at nanosecond speeds.

For example, a video game loads the game executable and assets from the SSD into DRAM at startup, and then a save‑file load moves the specific 3D models, textures, and environment into DRAM. Without DRAM, the game would run 3000 times slower.

2. DRAM Module and Its Connection to the CPU

A stick of DRAM is called a Dual Inline Memory Module (DIMM). A typical DIMM has 8 DRAM chips. On the motherboard, there are usually 4 DRAM slots, connected to the CPU via 2 memory channels. The left two slots share one channel, and the right two share another.

Inside the CPU, a memory controller manages all communication with DRAM. The CPU also has separate interfaces for SSDs (M.2 slots and SATA connectors). The memory controller uses mapping tables to coordinate the flow of data from SSDs into DRAM, and then from DRAM into the CPU’s cache memory for processing.

Memory Channels in DDR5

For DDR5, each memory channel is split into two sub‑channels, Channel A and Channel B. Each sub‑channel independently transfers 32 bits at a time using 32 data wires. Additionally:

  • 21 address wires carry the address specifying where to read or write.

  • 7 control signal wires carry command signals.

The addresses and commands are sent to all 4 chips on that memory channel, which work in parallel. However, the 32‑bit data lines are divided across the chips, so each chip only reads or writes 8 bits at a time. Power for the DRAM is supplied by the motherboard and managed by a voltage regulator on the stick itself.

3. Internal Structure of a DRAM Microchip

Die Organization

Inside the external packaging, a die sits on an interconnection matrix. This 2‑gigabyte DRAM die is organized into:

  • 8 bank groups, each with 4 banks → total 32 banks.

  • Within each bank: a massive array of 65,536 rows by 8,192 columns (approximately 17 billion memory cells).

  • Tens of thousands of wires and supporting circuitry (row decoders, column multiplexers, sense amplifiers) run around each bank.

Addressing 17 Billion Cells

To access any specific group of 8 cells, a 31‑bit address is used:

Bits

Purpose

3 bits

Select the bank group (0–7)

2 bits

Select the bank within that group (0–3)

16 bits

Row address (selects 1 of 65,536 rows)

10 bits

Column address (selects 1 of 1,024 groups of 8 columns)

Because the chip reads/writes 8 bits at a time (×8 organization), 8,192 columns are grouped into 1,024 groups of 8, hence only 10 bits are needed for the column address.

Optimization: The 31‑bit address is sent in two parts using only 21 wires. First, the bank group, bank, and row address are sent (Row Address Strobe – RAS). Then the column address is sent (Column Address Strobe – CAS). This allows the DRAM to check for a “row hit” before needing the column address.

4. The Memory Cell: 1T1C (One Transistor – One Capacitor)

Each memory cell consists of two components:

  • A capacitor — stores one bit of data as electrical charge. Charged to 1 volt represents a binary 1; 0 volts represents a binary 0.

  • A transistor (access transistor) — acts as a switch. Its gate is controlled by a wordline wire, and its channel connects the capacitor to a bitline wire.

When the wordline is activated (voltage applied), the transistor turns on, and electrons can flow between the capacitor and the bitline, allowing reading or writing. When the wordline is off, the transistor isolates the capacitor, preserving the stored charge.

The capacitor is shaped like a deep trench etched into the silicon to maximize capacitance while minimizing surface area. It consists of two conductive plates separated by a dielectric insulator only a few atoms thick.

Note: Because the transistor is only a few dozen nanometers wide, electrons slowly leak across the channel. Therefore, every memory cell must be refreshed periodically (every 64 ms) to restore the charge.

5. Basic Operations: Reading, Writing, and Refreshing

5.1 Reading Data

  1. The CPU sends a read command and a 31‑bit address. The first 5 bits select a specific bank.

  2. All wordlines in that bank are turned off, isolating all capacitors. Then all bitlines are precharged to 0.5 volts (half the supply voltage).

  3. The 16‑bit row address activates a single wordline. All capacitors in that row connect to their respective bitlines.

  4. If a capacitor holds a 1 (1 V), charge flows onto the 0.5 V bitline, raising its voltage slightly. If it holds a 0 (0 V), charge flows from the bitline into the capacitor, lowering the bitline voltage.

  5. Sense amplifiers at the bottom of each bitline detect these tiny voltage perturbations and drive the bitline fully to 1 V (if the perturbation was positive) or 0 V (if negative). The row is now open.

  6. The column multiplexer uses the 10‑bit column address to connect exactly 8 of the 8,192 bitlines to the read driver, which sends the 8 bits to the CPU over the data wires.

5.2 Writing Data

Writing follows a similar initial sequence (precharge, activate row, sense amplify) so that the row is open. Then:

  • The column multiplexer connects the specified 8 bitlines to the write driver.

  • The write driver overrides the sense amplifier’s voltage by applying the desired values (1 V or 0 V) onto those bitlines. This forces the corresponding capacitors to charge or discharge, writing the new data.

Important: The write driver is much stronger than the sense amplifier, allowing it to overwrite the stored values.

5.3 Refreshing

Because charge leaks from the capacitors, every memory cell must be refreshed within a maximum interval of 64 milliseconds. The refresh operation is essentially a read followed by re‑amplification:

  1. Close any open row and precharge all bitlines to 0.5 V.

  2. Open a row — the capacitors perturb the bitlines, and sense amplifiers restore them to full 1 V or 0 V, thereby refilling leaked charge.

  3. Repeat for every row in the bank. Each row takes about 50 ns, so a full refresh of 65,536 rows takes approximately 3 milliseconds.

Each bank is refreshed independently, and the CPU’s memory controller schedules refresh operations automatically.

6. Row Hits, Row Misses, and Timing Parameters

Row Hit

If the CPU sends a read/write command to the same row that is currently open (called a page hit or row hit), the DRAM only needs the column address to select the desired group of 8 cells. This skips the precharge and row activation steps, making the operation much faster.

Row Miss

If the next address refers to a different row (a row miss), the DRAM must:

  1. Close the currently open row (isolate capacitors).

  2. Precharge the bitlines to 0.5 V.

  3. Open the new row.

  4. Then access the columns.

This is slower than a row hit.

Timing Parameters on a DRAM Package

DRAM modules are rated with four numbers (e.g., CL–tRCD–tRP–tRAS), all measured in clock cycles:

Parameter

Meaning

CL (CAS Latency)

Time between sending a column address (row hit) and receiving the data.

tRCD (RAS to CAS Delay)

Time to open a row (from row activation to column access) if bitlines are precharged.

tRP (Row Precharge Time)

Time needed to precharge the bitlines before opening a new row.

tRAS (Row Active Time)

Minimum time between a row activation and the next precharge.

Why Multiple Banks Help

DDR5 has 32 banks, each operating independently. The CPU can have different rows open in different banks simultaneously, increasing the probability of a row hit and reducing average access time. Multiple bank groups also allow the refresh of one bank per group while others remain active, minimizing the performance impact of refreshing.

Optimization for Row Hits

The CPU’s memory controller, compilers, and programs are designed to maximize the number of consecutive row hits. The opposite — thrashing (jumping between rows repeatedly) — is very inefficient in both time and energy.

7. Burst Buffer

The burst buffer is a temporary storage (128 bits) that speeds up sequential access.

  • Instead of 8 wires from the column multiplexer, there are 128 wires connecting to a 128‑bit buffer.

  • The 10‑bit column address is split: 6 bits control the multiplexer (selecting 128 of the 8,192 bitlines), and 4 bits control the buffer (selecting 8 bits at a time to send to the read/write driver).

Reading with Burst Buffer

  1. The 6‑bit part of the column address selects 128 memory cells, which are loaded into the burst buffer in one step.

  2. The 4‑bit counter cycles through all 16 possible positions, outputting 8 bits each time. This yields 16 sets of 8 bits (128 bits total) — known as a burst length of 16.

  3. After the burst is complete, a new set of 128 cells can be loaded.

The benefit: contiguous data can be accessed extremely quickly (1024 bits per bank per burst), while still allowing random access to any group of 8 bits if needed.

8. Sub‑Arrays and Hierarchical Decoding

A bank of 65,536 × 8,192 cells would have extremely long wordlines and bitlines, causing high capacitance and slow operation. To solve this, each bank is divided into smaller sub‑arrays of 1,024 × 1,024 cells.

  • Shorter bitlines — each sense amplifier is closer to the memory cells it serves, reducing the capacitance that a tiny capacitor must drive. This allows the capacitor to be smaller.

  • Shorter wordlines — each wordline now drives only 1,024 transistor gates instead of 8,192, reducing the RC delay and turning on access transistors faster.

  • Hierarchical row decoders — a two‑level row decoding scheme selects both the sub‑array and the row within that sub‑array.

Intermediate sense amplifiers are placed below each sub‑array.

9. Folded DRAM Architecture and the Sense Amplifier

Folded Bitline Layout

In a folded DRAM design, each column has two bitlines — an active bitline and a passive bitline. Memory cells alternate between rows connected to the left (active) and rows connected to the right (passive).

  • When a row is active (e.g., row 0), all cells in that row connect to the active bitlines; the passive bitlines are disconnected from any cell.

  • When the next row (row 1) is active, the roles swap: the previously passive bitlines become active and vice versa.

The Sense Amplifier: Cross‑Coupled Inverter

Inside each sense amplifier (one per pair of bitlines) is a cross‑coupled inverter, which forces the two bitlines to be opposite voltages (a differential pair). If the active bitline is 1 V, the passive bitline is driven to 0 V, and vice versa. The passive bitline is not connected to any memory cell, so it does not interfere with stored data.

Three benefits of the folded architecture:

  1. Easy precharge — during precharge, a transistor is turned on to short‑circuit the active and passive bitlines. Their opposite charges average out, settling at exactly 0.5 V.

  2. Noise immunity — electric field lines from the active bitline terminate on the passive bitline (its opposite partner), reducing stray emissions and coupling to other wires.

  3. Reduced parasitic capacitance — the differential pair arrangement improves the sense amplifier’s ability to detect and amplify small voltage changes.

10. Additional Notes

Voltage Levels in Different DDR Generations

Generation

VDD (logic 1)

Precharge voltage

Write/refresh (typical)

DDR5

1.1 V

0.55 V

~1.4 V

DDR4

1.2 V

0.6 V

~1.5 V

DDR3

1.5 V

0.75 V

Higher

When writing or refreshing, a slightly higher voltage is applied to the capacitor to guard against leakage, ensuring a stored 1 remains distinguishable from a stored 0 over the refresh interval.

DRAM Package Labeling

On a DRAM DIMM, the sticker typically shows:

  • Capacity (e.g., 16 GB)

  • Data rate in millions of transfers per second (MT/s), which is twice the clock frequency (DDR = Double Data Rate)

  • Peak transfer rate in MB/s (e.g., 4800 MB/s for DDR5-4800)

Memory Hierarchy

DRAM is part of a larger memory hierarchy in a computer:

  • Registers — fastest, smallest (inside CPU cores)

  • Cache memory (L1, L2, L3) — faster than DRAM, smaller

  • DRAM (main memory) — slower, larger capacity

  • SSD / Hard Drive — slowest, largest capacity

The hierarchy balances speed, capacity, and cost to deliver optimal performance.


These notes cover the essential concepts of DRAM technology, from system‑level organization down to the nanoscale physics of a single memory cell. Understanding these principles provides a foundation for further study of modern computer architectures and memory systems.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent