Curious Minds

Clear answers to science and history questions

How Does a DRAM Work? Memory Explained

· 5 min read · Science

A DRAM (dynamic random-access memory) works by storing each bit of data as an electrical charge in a tiny capacitor, which is paired with a transistor to form a single memory cell. Because capacitors leak charge, the data must be refreshed thousands of times per second, and this dynamic nature gives DRAM its name.

What Is DRAM and Why It Matters

DRAM is the main memory in computers, smartphones, and most electronic devices that need fast, temporary storage for running programs. It sits between the processor and long-term storage like SSDs or hard drives, holding the data and instructions the CPU is actively using. Unlike ROM or flash memory, DRAM is volatile: it loses its contents when power is removed. Its key advantage is high density at low cost—billions of bits fit on a single chip—making it ideal for large main memory. The trade-off is that DRAM is slower than the CPU's on-chip SRAM cache and requires constant refreshing.

The Basic Structure of a DRAM Cell

Each DRAM cell consists of two components: a capacitor that stores the charge (0 or 1) and a transistor that acts as a switch, connecting the capacitor to a bit line when the word line is activated. This 1T1C design (one transistor, one capacitor) is extremely compact, allowing very high density. Cells are arranged in a grid of rows and columns. The word line selects a row, and the bit lines read or write the columns. Sense amplifiers at the end of each bit line detect the tiny charge difference and amplify it to a full logic level. A key challenge is that reading a cell is destructive: the charge is drained during the read, so the sense amplifier must immediately write the value back.

How Data Is Read and Written

To read a bit, the row decoder activates the word line for the desired row. All cells in that row connect their capacitors to their respective bit lines. Each bit line's sense amplifier detects whether the capacitor held a charge (1) or not (0). Because the charge is small, the sense amplifier compares it against a reference voltage and latches the result. This process also refreshes the row. To write, the desired value is driven onto the bit lines with a strong driver while the word line is active, charging or discharging the capacitor. Multiple bits are read or written in parallel—typically 8, 16, or 64 bits at a time—depending on the memory organization.

Why DRAM Needs Refreshing

The capacitor in each cell is tiny (a few femtofarads) and leaks charge through the transistor and dielectric. Without intervention, data would be lost within milliseconds. To prevent this, DRAM controllers issue refresh commands at regular intervals—typically every 64 milliseconds for the entire array, but each row must be refreshed within that window. Refresh operations read and rewrite each row, consuming power and bandwidth. Modern DRAM standards define refresh modes (e.g., auto-refresh, self-refresh) and temperature-dependent refresh rates. This constant refresh is the main reason DRAM consumes standby power and why it is called "dynamic."

DRAM Organization and Access Protocols

A DRAM chip is organized into banks, rows, and columns. Multiple banks allow overlapping operations: while one bank is being refreshed or precharged, another can be accessed. The memory controller sends commands like ACT (activate row), READ, WRITE, and PRE (precharge) to manage access. Timing parameters such as tRCD (row-to-column delay) and tRP (row precharge time) define the minimum intervals between commands. These timings, along with clock frequency, determine memory latency and bandwidth. Modern standards like DDR4 and DDR5 use double data rate signaling, transferring data on both rising and falling clock edges to double throughput.

Types of DRAM

  • Asynchronous DRAM: Early types like FPM and EDO, not tied to a system clock.
  • Synchronous DRAM (SDRAM): Synchronized with the system clock, allowing pipelined operations.
  • DDR SDRAM: Double data rate, transfers on both clock edges. Generations DDR through DDR5 offer increasing speed and lower voltage.
  • Graphics DRAM (GDDR): Optimized for high bandwidth in GPUs, with wider interfaces.
  • Low-power DRAM (LPDDR): Designed for mobile devices, emphasizing energy efficiency.

Common Problems and Limitations

DRAM faces several challenges. Refresh overhead reduces available bandwidth. Row hammer—a phenomenon where repeatedly accessing a row can cause bit flips in adjacent rows—has become a security concern, mitigated by targeted refresh and other techniques. Capacitor scaling is difficult: as cells shrink, maintaining enough charge becomes harder, leading to research into alternatives like 3D stacking and new dielectrics. DRAM also has limited endurance compared to some technologies, though it is far more durable than flash. Finally, DRAM is volatile, so data must be saved to non-volatile storage before power-off.

DRAM vs. SRAM and Other Memory

SRAM (static RAM) uses six transistors per cell and holds data as long as power is applied, without refresh. It is faster but much less dense and more expensive, so it is used for CPU caches. DRAM's 1T1C cell is far denser, making it suitable for main memory. Flash memory is non-volatile but slower and has limited write endurance. The memory hierarchy—registers, SRAM caches, DRAM main memory, and flash/disk storage—balances speed, cost, and capacity.

Frequently Asked Questions

Why is DRAM called dynamic?

Because it requires periodic refreshing to maintain data, unlike SRAM which is static and holds data as long as power is on.

What happens if DRAM refresh stops?

The capacitors leak charge and data is lost within milliseconds to seconds, depending on temperature and manufacturing. The system will crash or produce errors.

Can DRAM be used as permanent storage?

No, DRAM is volatile and loses its contents when power is removed. It is used only for temporary working memory.

How fast is DRAM compared to an SSD?

DRAM latency is on the order of tens of nanoseconds, while SSDs have latencies in the tens to hundreds of microseconds—roughly a thousand times slower. DRAM bandwidth is also much higher.

Why does DRAM need multiple banks?

Banks allow concurrent operations: while one bank is busy with a read or refresh, another can be accessed, improving overall throughput and hiding latency.

Is more DRAM always better?

More DRAM allows more programs to run without swapping to disk, but beyond a point the benefit diminishes. Speed and timings also matter for performance.

In this article
  1. What Is DRAM and Why It Matters
  2. The Basic Structure of a DRAM Cell
  3. How Data Is Read and Written
  4. Why DRAM Needs Refreshing
  5. DRAM Organization and Access Protocols
  6. Types of DRAM
  7. Common Problems and Limitations
  8. DRAM vs. SRAM and Other Memory
  9. Frequently Asked Questions