← 🏛️ Memory Hierarchy & Main Memory
Subtopic 2 of 7

7.2SRAM vs DRAM

The idea

SRAM stores a bit in a flip-flop: fast but bulky. DRAM stores it as charge in a capacitor: dense and cheap but it leaks, so it needs periodic refresh.

Think of it like this: SRAM is a light switch (stays where you leave it). DRAM is a bucket with a slow leak that you must top up regularly.

Why it exists

It explains why caches use SRAM and main memory uses DRAM.

How it works

  1. SRAM: fast, no refresh, more transistors per bit, expensive → cache.
  2. DRAM: 1 transistor + 1 capacitor per bit, slower, refresh needed → main memory.
  3. Refresh steals some memory time.

Worked example: DRAM cell

Charge drops below the readable level in milliseconds unless refreshed.

Now play with it

  • →Watch the DRAM bar leak and snap back to full each time refresh happens. Turn refresh OFF and watch data die.
■ SRAM■ DRAM
Speedfast vs slower
Density (bits per area)low vs high
Cost per bithigh vs low
Needs refreshno vs yes
Power when idlestatic vs refresh

Qualitative comparison to build intuition, not measured values.

DRAM cell (capacitor)

Charge leaks. Below 40% the bit would be unreadable.

SRAM cell (flip-flop)

Holds its value while powered.

Refreshes so far: 0

Check yourself

Which memory needs periodic refresh?

Remember: SRAM = cache, no refresh. DRAM = main memory, refresh.
Exam notes (the dense version)

SRAM: flip-flops, fast, expensive, no refresh → cache. DRAM: capacitor, dense, cheap, needs periodic refresh → main memory.

Previous year questions: Memory Hierarchy & Main Memory (16)

PYQs are grouped by topic, so this is the full set for Memory Hierarchy & Main Memory; try the ones that match this subtopic. Open all 16 on the topic page.