Interactive · Circuit-Level · Physics Simulation

SRAM vs DRAM
Visualization Lab

Animate a 6-transistor SRAM cell and a 1T1C DRAM cell side-by-side. Write, read, and hold data. Watch the DRAM capacitor slowly leak charge and trigger a refresh. Understand the physics that shapes every CPU memory hierarchy decision.

6T SRAM Cell
Cross-coupled CMOS inverters + 2 access transistors
WL: LOW
BL: PRE
BL̄: PRE
Q: 1
Q̄: 0
Select an operation to see what happens inside the 6T SRAM cell. Each action animates the actual transistor switching sequence.
Operation Log
[SRAM] Cell initialized. Q=1, Q̄=0. Wordline LOW. Cell in HOLD state.
1T1C DRAM Cell
1 access transistor + 1 storage capacitor (Cs ≈ 25 fF)
WL: LOW
BL: PRE
Data: 1
Charge: 95%
Capacitor Charge Level 95%
The DRAM capacitor is leaking charge slowly. Watch the bar drop below the 30% threshold — once there, stored data is corrupted and cannot be reliably sensed. The DRAM controller must refresh every row within 64 ms.
Operation Log
[DRAM] Cell initialized. Data=1 (capacitor charged). Charge leakage started.
SRAM Key Facts
  • ⚡ Access time: 0.5 – 2 ns
  • 🔋 Refresh needed: Never
  • 📐 Transistors/bit: 6T
  • 🏢 Used in: L1 / L2 / L3 Cache, Registers
DRAM Key Facts
  • ⚡ Access time: 30 – 60 ns
  • 🔋 Refresh: Every 64 ms (all rows)
  • 📐 Components/bit: 1T + 1C
  • 🏢 Used in: Main RAM (DDR4 / LPDDR5)
Leakage Simulation Speed
DRAM discharge rate (accelerated for demo)
SlowFast
Side-by-Side Analysis

SRAM vs DRAM — Complete Comparison

Every design decision in the memory hierarchy flows from these fundamental trade-offs.

Parameter 🟢 6T SRAM 🔵 1T1C DRAM
Cell Construction 6 MOSFETs (4 in cross-coupled inverters + 2 access transistors) 1 MOSFET access transistor + 1 storage capacitor (Cs)
Silicon Area / Bit ~50–100 μm² per bit (large) ~6–8 μm² per bit (ultra-dense) ✓
Access Time 0.5 – 2 ns (near-instant) ✓ 30 – 60 ns (sense-amp limited)
Refresh Required? No — static bistable state, holds data as long as power applied ✓ Yes — capacitor leaks. Must refresh every 32–64 ms
Read Operation Non-destructive — Q and Q̄ nodes are just sensed ✓ Destructive — reading empties capacitor into bitline; must rewrite immediately
Write Operation Drive BL/BL̄ to forced values, WL HIGH breaks the latch, new state locks in WL HIGH, drive BL HIGH or LOW to charge or discharge Cs
Power (Static) Near zero when idle (transistors biased off in stable state) Near zero per cell — but refresh cycles consume dynamic power ✓
Power (Active / Refresh) Only switching power during access Continuous refresh overhead (~15–20% of total DRAM power budget)
Volatility Volatile — loses data when power is removed Volatile — loses data when power removed (or refresh stops)
Process Complexity Standard CMOS process — no special steps needed ✓ Requires special deep-trench or stacked capacitor fabrication steps
Cost per Bit Very high (6× more area than DRAM) Very low — most cost-efficient volatile RAM ✓
Typical Density MBs (kB for L1, MB for L2/L3) GBs (4–64 GB typical) ✓
Primary Usage CPU L1/L2/L3 Cache, Registers, TLBs, Branch Predictors, FIFOs Main System Memory (DDR3/4/5, LPDDR, HBM2, GDDR)
Noise Immunity High — full-swing VDD/GND logic levels ✓ Low — tiny ΔV on bitline requires careful sense-amplifier design
🟢 Why SRAM is the Cache Choice

SRAM's cross-coupled inverters provide instant, stable logic levels. No sense-amp amplification delay, no refresh overhead, no capacitor physics to fight. A CPU L1 cache access completes in 3–5 clock cycles. Putting DRAM that close to the core would stall the processor 30–100 cycles per access — every instruction would wait.

🔵 Why DRAM is the Main Memory Choice

A 16 GB SRAM system would require 96 billion transistors and occupy dozens of square meters of silicon. DRAM's 1T1C architecture packs 16 GB onto a single ~8 mm² die stack. The 30–60 ns latency is hidden by caches, out-of-order execution, and prefetching — making DRAM the only practical choice for system memory.

🔵 The 6T SRAM Cell — How It Works

The 6T SRAM cell forms a bistable latch using two cross-coupled CMOS inverters: M1/M2 and M3/M4. Two access NMOS transistors M5 and M6 are gated by the Wordline (WL).

HOLD (WL = 0): Access transistors M5 and M6 are OFF. The cross-coupled inverters hold the state indefinitely as long as VDD is supplied. The latch is in a stable equilibrium — Q is pulled to VDD (logic 1) by M3/M4's PMOS path while Q̄ is pulled to GND.

READ (WL = 1): Bitlines BL and BL̄ are precharged to VDD/2. WL goes HIGH, turning on M5 and M6. The cell node Q begins discharging BL (if Q=0) or Q̄ discharges BL̄. The sense amplifier detects the tiny differential voltage (ΔV ≈ 100–200 mV) and amplifies to full rail. This is non-destructive — the cell state is preserved.

ΔV_BL = (Ccell / (Ccell + CBL)) × VDD
Where: Ccell ≈ cell node cap (~2–3 fF), CBL ≈ bitline cap (~200 fF)
⟹ ΔV_BL ≈ 1–2% × VDD → sense amplifier needed!

WRITE (WL = 1): Drive BL=1 and BL̄=0 for writing logic 1. The external drive strength must overpower the feedback inverter to flip the bistable. WRITE assist techniques (negative WL voltage, BL boosting) help at low VDD.

🟣 The 1T1C DRAM Cell — How It Works

A DRAM cell stores one bit as the presence or absence of charge on storage capacitor Cs (typically 25–30 fF for modern DRAM). The access NMOS transistor is gated by the Wordline.

WRITE: WL goes HIGH (access transistor ON). BL is driven HIGH (to write '1') or LOW (to write '0'). The capacitor charges or discharges through the transistor to the BL voltage level.

READ (Destructive!): BL is precharged to VDD/2. WL goes HIGH. Cs shares its charge with the bitline capacitance CBL. The resulting ΔV is:

ΔV_BL = Cs / (Cs + CBL) × (Vdata − VDD/2)
Typical: ΔV ≈ 25fF / (25fF + 200fF) × (VDD/2) ≈ 5–6% VDD
⟹ The sense amplifier LATCHES the result and REWRITES Cs (required every read!)

Capacitor Leakage (Retention Time): The sub-threshold leakage of the access transistor slowly discharges Cs even when WL=0. At room temperature, Cs retains data for ~64 ms (worse at elevated temperatures). The DRAM controller must issue a REFRESH command to every row within this window.

Retention Time τ = Cs × VMIN / Ileak
Typical: τ ≈ 32–64 ms at 85°C
Refresh bandwidth overhead ≈ (tRC × Nrows) / (64 ms × Nrows) ≈ 2–5%

🏗️ The Sense Amplifier — The Critical Circuit

Both SRAM and DRAM read operations rely on a differential sense amplifier (cross-coupled inverter pair) to detect tiny voltage differences on the bitlines and amplify them to full VDD/GND levels.

The sense amplifier is enabled after a sufficient ΔV has developed on BL/BL̄ (typically 50–100 mV). It acts as a positive-feedback latch that regeneratively amplifies the difference to full swing in ~1–2 ns. For DRAM, this sense-amp phase dominates the total row access time (tRCD ≈ 13–16 ns in DDR4).

This is why DRAM is slower than SRAM: SRAM's cross-coupled inverters are already the sense amplifier (the internal cell nodes ARE full-swing); DRAM requires an external sense amplifier to resolve a 5% signal from the capacitor.

📡 HBM, GDDR, and LPDDR — DRAM Variations

Modern DRAM is not monolithic. Different applications demand different DRAM packaging and interface optimization:

  • DDR5: Server/desktop main memory. On-die ECC, higher VDD=1.1V, up to 128 GB per channel.
  • LPDDR5: Mobile/laptop. Lower power via partial-array refresh, deep power-down states.
  • HBM2E / HBM3: GPU main memory (AMD RDNA, Intel Ponte Vecchio). 3D-stacked DRAM dies on silicon interposer. Extremely wide bus (1024-bit per stack) with ultra-low latency.
  • GDDR6X: NVIDIA discrete GPU memory. PAM4 signaling, high bandwidth at the cost of higher power.

All these are still 1T1C DRAM cells at the core — the innovations are in the I/O PHY, packaging, and refresh management.

Interview Preparation

SRAM vs DRAM — Commonly Asked Questions

Asked at Intel, Qualcomm, Apple Silicon, NVIDIA, Samsung, Micron, and ARM in hardware engineering interviews.

ArchitectureWhy is SRAM used for cache instead of DRAM?
SRAM access time is 0.5–2 ns — close to a single clock cycle at 1–3 GHz. DRAM requires 30–60 ns because of bitline charging and sense-amplifier activation. A CPU needs cache to be accessed in 3–5 cycles for L1, 10–15 cycles for L2. If L1 used DRAM, every cache hit would stall the pipeline for 30–100 cycles — effectively making the cache useless. Additionally, SRAM requires no refresh, which would add latency and bandwidth overhead incompatible with the cache's role as a high-bandwidth buffer.
VLSIWhy is DRAM read considered destructive? What happens after a read?
During a DRAM read, the wordline opens the access transistor and the charged capacitor (Cs ≈ 25 fF) shares its charge with the much larger bitline capacitance (CBL ≈ 200 fF). After charge sharing, Cs is at roughly VDD/2 for a '1' cell — its original charge is partially depleted. The sense amplifier latches the differential and drives BL to full VDD. This sense-amp output is used to recharge Cs back to full VDD (for a '1') or fully discharge it to 0 (for a '0'). This rewrite happens automatically and is called read-restore or sense-amplifier writeback. It is mandatory after every DRAM read.
ArchitectureHow does temperature affect DRAM retention time?
DRAM capacitor leakage is dominated by sub-threshold leakage of the access transistor, which approximately doubles for every 10°C temperature increase (Arrhenius relationship). At 25°C, a cell might retain data for 5–10 seconds. At 85°C (JEDEC high temp), retention drops to ~64 ms. This is why JEDEC specs require a 64 ms refresh interval at high temperatures, while some controllers use 32 ms for reliability margin. At very low temperatures (cryogenic operation), DRAM retention extends to hours or days — relevant for quantum computing support chips.
VLSIHow many transistors does a 6T SRAM cell use, and what does each do?
A 6T SRAM cell uses:

M1 (PMOS Pull-up, Left inverter): Pulls Q̄ node to VDD when Q is at 0.
M2 (NMOS Pull-down, Left inverter): Pulls Q̄ node to GND when Q is at 1.
M3 (PMOS Pull-up, Right inverter): Pulls Q node to VDD when Q̄ is at 0.
M4 (NMOS Pull-down, Right inverter): Pulls Q node to GND when Q̄ is at 1.
M5 (NMOS Access, Left): Gated by WL. Connects Q̄ to BL̄ during read/write.
M6 (NMOS Access, Right): Gated by WL. Connects Q to BL during read/write.

M1–M4 form two cross-coupled CMOS inverters. The key sizing rule: M2 and M4 (pull-downs) are sized wider than M1/M3 (pull-ups) and narrower than M5/M6, to achieve the "cell ratio" and "pull-up ratio" constraints for stable read and reliable write margins.
InterviewWhat is the DRAM refresh bandwidth overhead, and why does it matter?
A DRAM module must refresh all rows within 64 ms. Each row refresh takes tRC ≈ 46–50 ns (DDR4). A 16 Gb DRAM die has ~128K rows per bank × 16 banks. Total refresh time = 128K × 50 ns ≈ 6.4 ms per 64 ms window ≈ ~10% of total bandwidth consumed by refresh alone. This means your 51.2 GB/s DDR5 system is actually delivering ~46 GB/s effective bandwidth. For HPC and data center workloads, this overhead is significant. Partial Array Self Refresh (PASR) and LPDDR's deep power-down modes help reduce refresh overhead for mobile applications where not all DRAM rows are populated.
VLSIWhat is the "half-VDD precharge" scheme in DRAM and why is it used?
Before every DRAM access, the bitline is precharged to exactly VDD/2 (half VDD). When WL opens, the cell capacitor shares charge with the bitline. Precharging to VDD/2 maximizes the ΔV signal for both '0' and '1' states — a '1' cell pulls BL above VDD/2 and a '0' pulls BL below VDD/2 by equal amounts. This differential sensing approach doubles the signal compared to precharging to 0V or VDD. The reference line (BL̄) stays at VDD/2 as a reference for the differential sense amplifier. The precharge circuit uses a PMOS transistor with its gate at VDD/2, automatically setting both BL and BL̄ to VDD/2 when the EQ (equalize) signal is asserted.
InterviewIf DRAM is slower, why not use SRAM for everything in a smartphone?
Area and cost. A 16 GB SRAM main memory would require: 16 × 10⁹ × 8 bits × 6 transistors = ~768 billion MOSFET transistors. At 5nm node, a single NMOS transistor occupies ~15–20 nm². This translates to roughly 11,500 mm² (11.5 cm²) of silicon — more than 10 full reticle-sized wafer dies. At $50/mm² for a 5nm foundry, that's ~$575,000 per device for memory alone. DDR5 DRAM packs 16 GB into a ~60 mm² die. SRAM is simply not scalable as main memory. The 6T cell's area penalty is a fundamental physical reality that no process node can eliminate — it's a structural 6:1 transistor count disadvantage.