<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Open Row]]></title><description><![CDATA[Open Row]]></description><link>https://openrow.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Dec 2026 00:53:00 GMT</lastBuildDate><atom:link href="https://openrow.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[DRAM Address Mapping: How a Memory Controller Turns an Address Into a Bank and Row]]></title><description><![CDATA[Here's a question that separates people who've memorized DRAM terms from people who understand controllers: "Given a physical address, how does the memory…]]></description><link>https://openrow.hashnode.dev/dram-address-mapping-how-a-memory-controller-turns-an-address-into-a-bank-and-row</link><guid isPermaLink="true">https://openrow.hashnode.dev/dram-address-mapping-how-a-memory-controller-turns-an-address-into-a-bank-and-row</guid><category><![CDATA[hardware]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[interview]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Fri, 27 Nov 2026 18:13:07 GMT</pubDate><content:encoded><![CDATA[<p>Here's a question that separates people who've memorized DRAM terms from people who understand controllers: <strong>"Given a physical address, how does the memory controller decide which channel, bank, row and column it goes to?"</strong> The answer is address mapping, and the choice of mapping can swing bandwidth as much as the scheduler does.</p>
<h2>The pieces of a DRAM address</h2>
<p>A DDR5 system splits every physical address into fields:</p>
<ul>
<li><strong>Channel:</strong> which independent memory channel (each DDR5 DIMM has two 32-bit subchannels).</li>
<li><strong>Rank:</strong> which set of chips on the channel.</li>
<li><strong>Bank group and bank:</strong> which of the 32 banks in a DDR5 device (8 bank groups of 4 banks for 16 Gb parts).</li>
<li><strong>Row:</strong> which row inside the bank gets activated.</li>
<li><strong>Column:</strong> which burst inside that open row.</li>
</ul>
<p>The controller's job is to decide which address bits feed which field.</p>
<h2>The naive mapping and why it hurts</h2>
<p>The simplest mapping puts the fields in order from top to bottom: row bits at the top, then bank, then column at the bottom. Sequential addresses then march through the columns of one row, which is great: lots of row hits.</p>
<p>The trouble comes when a sequential stream runs off the end of a row. It moves to the next row <strong>in the same bank</strong>, which is a row conflict. Worse, two arrays that happen to be a multiple of the row-and-bank size apart map to the same bank and different rows, so accessing them alternately thrashes that bank.</p>
<h2>Better mappings</h2>
<p>Real controllers use a few standard tricks:</p>
<ul>
<li><strong>Put channel and bank-group bits low.</strong> Consecutive cache lines (or small groups of them) go to different channels and bank groups, so a streaming access spreads across the hardware and gets the short tCCD_S spacing instead of tCCD_L.</li>
<li><strong>Keep some column bits below them.</strong> You still want a few consecutive accesses in the same row to get row hits. The design question is how many.</li>
<li><strong>XOR hashing.</strong> Bank bits are XORed with some row bits. Two addresses that would collide in the naive mapping now land in different banks. This is cheap in hardware (a handful of XOR gates) and removes most pathological conflicts.</li>
</ul>
<h2>A worked example</h2>
<p>Take a naive mapping where the row bits start at address bit 20 and the bank and column bits sit below it. Two arrays exactly 1 MB apart then differ only in their row bits, so element i of each array lands in the same bank but a different row. A loop that reads a[i] then b[i] gets a row conflict on every access. XOR the bank bits with low row bits and a[i] and b[i] now land in different banks, because their row bits differ. Both rows can stay open, and most accesses become hits.</p>
<h2>The trade-off interviewers want to hear</h2>
<p>Spreading accesses across banks and channels (interleaving) improves parallelism, but it reduces row locality, since fewer consecutive accesses share a row. Keeping more column bits low improves locality but concentrates traffic. The right mapping depends on the workload, which is why controllers often make it configurable.</p>
<h2>How to answer in an interview</h2>
<p>List the fields, explain why naive row-bank-column mapping causes conflicts, then propose low-order channel and bank-group interleaving plus XOR bank hashing. Close with the locality-versus-parallelism trade-off.</p>
<h2>Free cheat sheet</h2>
<p>DDR5 bank organization and every DDR5-4800 timing on one page: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">download it free</a>. For the full guide with 30 interview questions and model answers, see the <a href="https://openrow.gumroad.com/l/ddr5">DRAM &amp; DDR5 Interview Field Guide</a>.</p>
<p><em>This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[Write Draining: Why Memory Controllers Hoard Writes (and How They Pick the Watermarks)]]></title><description><![CDATA[Ask a memory-controller engineer what quietly eats bandwidth and you'll often hear "read/write turnarounds." Interviewers like this topic because the fix…]]></description><link>https://openrow.hashnode.dev/write-draining-why-memory-controllers-hoard-writes-and-how-they-pick-the-watermarks</link><guid isPermaLink="true">https://openrow.hashnode.dev/write-draining-why-memory-controllers-hoard-writes-and-how-they-pick-the-watermarks</guid><category><![CDATA[hardware]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[interview]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Fri, 27 Nov 2026 18:10:08 GMT</pubDate><content:encoded><![CDATA[<p>Ask a memory-controller engineer what quietly eats bandwidth and you'll often hear "read/write turnarounds." Interviewers like this topic because the fix is a small policy with a big payoff: <strong>write draining with watermarks</strong>. Here's the problem, the policy, and the follow-up questions you should expect.</p>
<h2>Why switching direction is expensive</h2>
<p>The DRAM data bus is shared by reads and writes, and it can only go one way at a time. Every time the controller flips direction, it pays dead cycles:</p>
<ul>
<li><strong>Write to read</strong> is the painful one. After the last write data goes in, the DRAM needs time before it can accept a read (tWTR). In DDR5 that's longer within the same bank group (tWTR_L, around 10 ns) than across bank groups (tWTR_S, a few ns).</li>
<li><strong>Read to write</strong> costs bus turnaround so the controller and the DRAM aren't both driving the bus.</li>
</ul>
<p>If reads and writes are interleaved one by one, the bus spends a large share of its time turning around instead of moving data.</p>
<h2>The policy: buffer writes, drain in bursts</h2>
<p>Reads matter more to performance because a CPU core is usually stalled waiting on them. Writes usually aren't urgent: the data has already left the cache. So the controller:</p>
<ol>
<li>Serves reads by default and parks incoming writes in a <strong>write queue</strong>.</li>
<li>When the write queue fills past a <strong>high watermark</strong>, it switches to write mode and drains writes back to back.</li>
<li>It keeps draining until the queue falls below a <strong>low watermark</strong>, then switches back to reads.</li>
</ol>
<p>One turnaround pair now covers a whole batch of writes instead of a single one.</p>
<h2>A worked example</h2>
<p>Say the write queue holds 32 entries, with a high watermark of 28 and a low watermark of 12. When the queue hits 28, the controller drains 16 writes in a row, paying the turnaround penalty twice for 16 writes instead of 32 times.</p>
<h2>Choosing the watermarks</h2>
<p>This is where the interview gets interesting, because it's a trade-off:</p>
<ul>
<li><strong>Watermarks too close together:</strong> short drains, frequent switching, and you're back to wasting bandwidth on turnarounds.</li>
<li><strong>High watermark too high:</strong> a burst of incoming writes can fill the queue completely, and the controller has to stall new writes.</li>
<li><strong>Low watermark too low:</strong> long drains block reads for a long time, and read latency spikes.</li>
</ul>
<p>A good answer says the watermarks should be tuned to the workload: read-heavy traffic wants short, infrequent drains, while streaming writes can tolerate long ones.</p>
<h2>Follow-ups you should expect</h2>
<ul>
<li><strong>"What if a read hits an address that's in the write queue?"</strong> The controller must return the newer data from the write queue (read-after-write forwarding), or it would return stale data from DRAM.</li>
<li><strong>"What else can force a drain?"</strong> An idle read queue (drain opportunistically), a refresh coming up, or a write that has waited too long.</li>
<li><strong>"How does bank-group structure help?"</strong> During a drain, the scheduler still prefers row hits and spreads writes across bank groups so the short tCCD_S applies.</li>
</ul>
<h2>How to answer in an interview</h2>
<p>Name the cost (tWTR and bus turnaround), propose buffering with high and low watermarks, explain the trade-off in picking them, and mention read-after-write forwarding before you're asked.</p>
<h2>Free cheat sheet</h2>
<p>Every DDR5-4800 timing parameter, including the write and turnaround timings, on one page: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">download it free</a>. For 30 interview questions with model answers, see the <a href="https://openrow.gumroad.com/l/ddr5">DRAM &amp; DDR5 Interview Field Guide</a>.</p>
<p><em>This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[FR-FCFS Explained: How Memory Controllers Pick the Next Command (and Why It Starves)]]></title><description><![CDATA["How does a memory controller decide what to do next?" is a great interview question because it has no single right answer. But almost every answer starts…]]></description><link>https://openrow.hashnode.dev/fr-fcfs-explained-how-memory-controllers-pick-the-next-command-and-why-it-starves</link><guid isPermaLink="true">https://openrow.hashnode.dev/fr-fcfs-explained-how-memory-controllers-pick-the-next-command-and-why-it-starves</guid><category><![CDATA[hardware]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[interview]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Fri, 27 Nov 2026 18:04:59 GMT</pubDate><content:encoded><![CDATA[<p>"How does a memory controller decide what to do next?" is a great interview question because it has no single right answer. But almost every answer starts from the same baseline: <strong>FR-FCFS</strong>. Here's how it works, the worked example interviewers like, and the flaw they'll ask you to fix.</p>
<h2>The problem a scheduler solves</h2>
<p>A DRAM bank can hold one open row at a time. A request to that open row (a <strong>hit</strong>) only needs a column command. A request to a different row (a <strong>conflict</strong>) needs a precharge, an activate, and then the column command, roughly three times the latency at DDR5-4800 (about 16.7 ns versus 48.7 ns to first data). So the order you serve requests in changes your bandwidth dramatically.</p>
<h2>FR-FCFS in one line</h2>
<p><strong>First-Ready, First-Come-First-Served</strong> (Rixner et al., ISCA 2000): among the commands that can legally issue this cycle, prefer ones that hit an open row; break ties by age.</p>
<p>The "ready" part matters. The scheduler isn't picking whole requests, it's picking the next legal <em>command</em>, so work in different banks overlaps.</p>
<h2>A worked example</h2>
<p>Bank 0 has row 5 open. Four requests are queued, oldest first:</p>
<table>
<thead>
<tr>
<th>Request</th>
<th>Bank</th>
<th>Row</th>
<th>Arrived</th>
</tr>
</thead>
<tbody><tr>
<td>A</td>
<td>0</td>
<td>5</td>
<td>t = 1</td>
</tr>
<tr>
<td>B</td>
<td>0</td>
<td>7</td>
<td>t = 2</td>
</tr>
<tr>
<td>C</td>
<td>0</td>
<td>5</td>
<td>t = 3</td>
</tr>
<tr>
<td>D</td>
<td>1</td>
<td>2</td>
<td>t = 4</td>
</tr>
</tbody></table>
<p><strong>Plain FCFS</strong> serves A, then B (precharge row 5, activate row 7), then C, which now needs row 5 back: another precharge and activate. Two expensive conflicts.</p>
<p><strong>FR-FCFS</strong> serves A, then C, because both are hits on the open row. Then B, paying one conflict instead of two. Meanwhile D's activate to bank 1 can issue in parallel, because bank 1 is idle and the command is ready. That's bank-level parallelism falling out of "first ready."</p>
<h2>The flaw: starvation</h2>
<p>Suppose requests to row 5 keep arriving. Every one is a hit, so FR-FCFS keeps choosing them, and B, the second-oldest request in the queue, waits indefinitely. In a real system that might be the display controller, and a starved display shows up as screen glitches.</p>
<p><strong>The fix interviewers want to hear:</strong> an age cap. Once a request has waited past a threshold, it wins regardless of hit status. Real controllers go further, with per-requestor QoS classes and priority for latency-sensitive traffic.</p>
<h2>Two more details that score points</h2>
<ul>
<li><strong>Write draining.</strong> Switching the data bus between reads and writes costs turnaround time, so controllers buffer writes and drain them in bursts between a high and a low watermark.</li>
<li><strong>Refresh is a scheduling input.</strong> A good scheduler avoids opening a row in a bank that's about to be force-precharged for refresh.</li>
</ul>
<h2>How to answer in an interview</h2>
<p>Start from FR-FCFS, walk a tiny example like the one above, name starvation without being asked, and propose the age cap. Then say what you'd measure (bandwidth, row-hit rate, worst-case latency) to tune it.</p>
<h2>Free cheat sheet</h2>
<p>Hit, empty, and conflict latencies, every DDR5-4800 timing parameter, and scheduling rules of thumb on one page: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">download it free</a>. For the full treatment with 30 interview questions and model answers, see the <a href="https://openrow.gumroad.com/l/ddr5">DRAM &amp; DDR5 Interview Field Guide</a>.</p>
<p><em>This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[The 1011 Sequence Detector: The FSM Question Every RTL Interview Asks]]></title><description><![CDATA["Design an FSM that outputs 1 when it sees 1011 on a serial input" is probably the most common RTL whiteboard question there is. It looks easy, and most of…]]></description><link>https://openrow.hashnode.dev/the-1011-sequence-detector-the-fsm-question-every-rtl-interview-asks</link><guid isPermaLink="true">https://openrow.hashnode.dev/the-1011-sequence-detector-the-fsm-question-every-rtl-interview-asks</guid><category><![CDATA[verilog]]></category><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Fri, 27 Nov 2026 18:01:23 GMT</pubDate><content:encoded><![CDATA[<p>"Design an FSM that outputs 1 when it sees 1011 on a serial input" is probably the most common RTL whiteboard question there is. It looks easy, and most of the grade comes from one detail: what happens when the pattern overlaps.</p>
<h2>The trick: name states by the prefix you've matched</h2>
<p>Call each state by the longest prefix of 1011 you've seen so far: S0 (nothing), S1, S10, S101, and S1011 (match found). On a matching bit you move forward. On a mismatch you don't always go back to S0. You go to the <strong>longest suffix of what you've seen that is still a prefix of 1011</strong>.</p>
<table>
<thead>
<tr>
<th>State</th>
<th>x = 0</th>
<th>x = 1</th>
</tr>
</thead>
<tbody><tr>
<td>S0</td>
<td>S0</td>
<td>S1</td>
</tr>
<tr>
<td>S1</td>
<td>S10</td>
<td>S1</td>
</tr>
<tr>
<td>S10</td>
<td>S0</td>
<td>S101</td>
</tr>
<tr>
<td>S101</td>
<td>S10</td>
<td>S1011</td>
</tr>
<tr>
<td>S1011</td>
<td>S10</td>
<td>S1</td>
</tr>
</tbody></table>
<p>The two that trip people up: from <strong>S101</strong>, a 0 gives "1010", whose suffix "10" is still a valid prefix, so you go to S10, not S0. From <strong>S1011</strong>, a 1 gives "10111", which leaves just "1", so S1. That's what makes the input 1011011 fire twice.</p>
<h2>The SystemVerilog</h2>
<pre><code class="language-systemverilog">// Moore FSM: y=1 after seeing 1011, overlapping allowed
module seq1011 (
  input  logic clk, rst_n, x,
  output logic y
);
  typedef enum logic [2:0] {S0, S1, S10, S101, S1011} state_t;
  state_t s, ns;
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) s &lt;= S0; else s &lt;= ns;
  always_comb begin
    ns = s;
    case (s)
      S0:    ns = x ? S1    : S0;
      S1:    ns = x ? S1    : S10;
      S10:   ns = x ? S101  : S0;
      S101:  ns = x ? S1011 : S10;
      S1011: ns = x ? S1    : S10;
      default: ns = S0;
    endcase
  end
  assign y = (s == S1011);
endmodule
</code></pre>
<p>Three things interviewers look for: the state register and next-state logic are separate (nonblocking in <code>always_ff</code>, blocking in <code>always_comb</code>), <code>ns</code> has a default so no latch is inferred, and there's a <code>default</code> branch so unused encodings recover.</p>
<h2>The follow-ups</h2>
<ul>
<li><strong>"Make it Mealy."</strong> Drop S1011: the output becomes <code>(s == S101) &amp;&amp; x</code>, so it fires in the same cycle as the last bit, one cycle earlier, with four states. The trade-off is that the output now depends combinationally on the input.</li>
<li><strong>"Non-overlapping?"</strong> After a match, return to S0 instead of continuing from the suffix.</li>
<li><strong>"How would you verify it?"</strong> A reference model that slides a 4-bit window over random input, compared every cycle, plus directed tests for 1011011 and 10101011.</li>
</ul>
<h2>Want 19 more like this?</h2>
<p>The <a href="https://openrow.gumroad.com/l/rtl">RTL Design Interview Problem Pack</a> has 20 classic whiteboard problems (FIFOs, clock domain crossing, arbiters, LFSRs, handshakes, setup/hold math), each with what the interviewer is testing, a synthesizable SystemVerilog solution, and the follow-ups they ask.</p>
<p><em>This article was generated with AI from the author's study notes; the code was checked by synthesizing it with Yosys.</em></p>
]]></content:encoded></item><item><title><![CDATA[Open Page vs Closed Page: How Memory Controllers Bet on Your Access Pattern]]></title><description><![CDATA["Open page or closed page: defend your choice" is a favorite question for anyone with a memory controller on their résumé. There's no single right answer…]]></description><link>https://openrow.hashnode.dev/open-page-vs-closed-page-how-memory-controllers-bet-on-your-access-pattern</link><guid isPermaLink="true">https://openrow.hashnode.dev/open-page-vs-closed-page-how-memory-controllers-bet-on-your-access-pattern</guid><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><category><![CDATA[computer architecture]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:45:36 GMT</pubDate><content:encoded><![CDATA[<p>"Open page or closed page: defend your choice" is a favorite question for anyone with a memory controller on their résumé. There's no single right answer, which is exactly why interviewers like it.</p>
<h2>Three cases, three costs</h2>
<p>When a request arrives for a row in a bank, one of three things is true:</p>
<table>
<thead>
<tr>
<th>Case</th>
<th>Bank state</th>
<th>Commands</th>
<th>Latency to data (DDR5-4800, CL40)</th>
</tr>
</thead>
<tbody><tr>
<td>Row hit</td>
<td>That row is already open</td>
<td>RD</td>
<td>CL ≈ 16.7 ns</td>
</tr>
<tr>
<td>Row empty</td>
<td>Bank idle</td>
<td>ACT, RD</td>
<td>tRCD + CL ≈ 32.7 ns</td>
</tr>
<tr>
<td>Row conflict</td>
<td>A different row is open</td>
<td>PRE, ACT, RD</td>
<td>tRP + tRCD + CL ≈ 48.7 ns</td>
</tr>
</tbody></table>
<p>A conflict costs about three times a hit. Page policy is a bet about which case comes next.</p>
<h2>Open page</h2>
<p>Leave the row open after an access, betting the next request hits it. Great for streaming and sequential access, where hits are common. Bad for random access, where most misses become conflicts with a precharge sitting on the critical path.</p>
<h2>Closed page</h2>
<p>Precharge right after each access, often with auto-precharge. You give up hits, but every miss is a cheaper "empty" instead of a conflict, and latency becomes predictable. Good for random, many-requestor traffic.</p>
<h2>How to answer in an interview</h2>
<ol>
<li>State your workload assumption.</li>
<li>Name the metric that decides it: the <strong>row-hit rate</strong>.</li>
<li>Say what you'd measure before switching, and mention that many real controllers are adaptive, closing a row after a timeout.</li>
</ol>
<p>Bonus points: connect it to scheduling. <strong>FR-FCFS</strong> (ready row hits first, then oldest) is the classic baseline from Rixner et al. (ISCA 2000). Its weakness is starvation: a stream of hits can keep an older miss waiting, so real schedulers add an age cap.</p>
<h2>Free cheat sheet</h2>
<p>Every DDR5-4800 timing parameter, the latency formulas above, and scheduling rules of thumb on one page: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">free download</a>.</p>
<p><em>Latencies are illustrative for DDR5-4800 CL40; check your device datasheet. This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[DDR5 Bank Groups and Address Mapping: Why the "Obvious" Mapping Wastes a Third of Your Bandwidth]]></title><description><![CDATA[A memory controller slices every physical address into fields: channel, rank, bank group, bank, row, column, and the byte offset inside a burst. Which bits…]]></description><link>https://openrow.hashnode.dev/ddr5-bank-groups-and-address-mapping-why-the-obvious-mapping-wastes-a-third-of-your-bandwidth</link><guid isPermaLink="true">https://openrow.hashnode.dev/ddr5-bank-groups-and-address-mapping-why-the-obvious-mapping-wastes-a-third-of-your-bandwidth</guid><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><category><![CDATA[computer architecture]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:44:41 GMT</pubDate><content:encoded><![CDATA[<p>A memory controller slices every physical address into fields: channel, rank, bank group, bank, row, column, and the byte offset inside a burst. Which bits go where looks like bookkeeping. It actually decides whether a streaming workload runs at full speed or leaves a third of the bus idle.</p>
<h2>A concrete DDR5 setup</h2>
<p>Take a DDR5 subchannel built from four x8, 16 Gb chips:</p>
<ul>
<li>Each burst is BL16 on a 32-bit bus: 16 × 4 bytes = <strong>64 bytes</strong>, one cache line.</li>
<li>A row across the rank holds about <strong>4 KB</strong>, or 64 cache lines.</li>
<li>There are <strong>32 banks</strong>, arranged as 8 bank groups of 4.</li>
<li>A BL16 burst keeps the data bus busy for <strong>8 clocks</strong> (16 transfers, 2 per clock).</li>
</ul>
<h2>Why bank groups exist</h2>
<p>DRAM cores haven't kept up with interface speeds, so each column access prefetches a wide chunk of data. Banks inside one bank group share part of that internal data path. Back-to-back column commands to the <strong>same</strong> group must be spaced by tCCD_L; to <strong>different</strong> groups, by the shorter tCCD_S.</p>
<p>At DDR5-4800 (tCK ≈ 0.4167 ns): tCCD_S = 8 clocks, tCCD_L = max(8 nCK, 5 ns) = <strong>12 clocks</strong>.</p>
<h2>Two mappings, one streaming workload</h2>
<table>
<thead>
<tr>
<th>Mapping</th>
<th>Bit order (high → low)</th>
<th>Consecutive cache lines go to</th>
</tr>
</thead>
<tbody><tr>
<td>A: row-interleaved</td>
<td>row · BG · bank · column · offset</td>
<td>Same row, same bank, same bank group</td>
</tr>
<tr>
<td>B: BG-interleaved</td>
<td>row · bank · column-high · BG · offset</td>
<td>A different bank group each line</td>
</tr>
</tbody></table>
<p><strong>Mapping A</strong> feels ideal: every access is a row hit. But every read hits the same bank group, so reads must be 12 clocks apart while each burst uses only 8. The bus is busy 8 of every 12 clocks: <strong>about 67% utilization.</strong></p>
<p><strong>Mapping B</strong> rotates consecutive lines across all 8 bank groups. Reads only need tCCD_S = 8 clocks apart, so the bus can stay close to <strong>100% busy</strong>, and each group still sees row hits as the stream comes back around.</p>
<h2>The pathological stride</h2>
<p>Under mapping A, column plus offset cover 4 KB, and bank plus bank group cover the next 32 × 4 KB = <strong>128 KB</strong>. A program striding by exactly 128 KB changes only the row bits. Every access lands in the same bank with a different row: a row conflict every time.</p>
<p>Real controllers fix this by <strong>XOR hashing</strong> low row bits into the bank and bank-group bits, and many make the mapping programmable.</p>
<h2>How to answer "which mapping would you choose?"</h2>
<p>State your workload, compute which address field toggles for that access pattern, and say what you'd measure (bandwidth and row-hit rate) to confirm.</p>
<h2>Cheat sheet</h2>
<p>DDR5 organization, tCCD_S/L, and every other core timing parameter on one free page: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">download it here</a>. For full worked examples plus 30 interview questions with model answers, see the <a href="https://openrow.gumroad.com/l/ddr5">DRAM &amp; DDR5 Interview Field Guide</a>.</p>
<p><em>Illustrative organization for a 16 Gb x8 DDR5 device; check your part's datasheet. This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[DRAM Refresh Explained: tREFI, tRFC, and the 7% Tax You Pay to Leaky Capacitors]]></title><description><![CDATA[DRAM stores each bit as charge on a tiny capacitor, and capacitors leak. Leave a row alone long enough and a 1 becomes indistinguishable from a 0. Refresh…]]></description><link>https://openrow.hashnode.dev/dram-refresh-explained-trefi-trfc-and-the-7-tax-you-pay-to-leaky-capacitors</link><guid isPermaLink="true">https://openrow.hashnode.dev/dram-refresh-explained-trefi-trfc-and-the-7-tax-you-pay-to-leaky-capacitors</guid><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><category><![CDATA[computer architecture]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:43:29 GMT</pubDate><content:encoded><![CDATA[<p>DRAM stores each bit as charge on a tiny capacitor, and capacitors leak. Leave a row alone long enough and a 1 becomes indistinguishable from a 0. Refresh is the rent you pay to keep your data, and in interviews it's a great topic because it connects device physics, controller design, and performance.</p>
<h2>The refresh contract</h2>
<p>Every row must be refreshed within a retention window. For DDR5 that window (tREFW) is 32 ms at normal temperatures. Rather than refreshing everything at once, the controller sends a refresh command on average every <strong>tREFI</strong>, and the device refreshes a slice of rows internally each time, using its own row counter.</p>
<p>tREFI = 32 ms / 8192 refresh commands ≈ <strong>3.9 µs</strong></p>
<p>Above 85 °C, leakage speeds up and tREFI halves to about 1.95 µs.</p>
<h2>What one refresh costs</h2>
<p>An all-bank refresh (REFab) makes the whole rank unavailable for <strong>tRFC</strong>. tRFC grows with density: typical tRFC1 values are around 195 ns for an 8 Gb die and 295 ns for 16 Gb.</p>
<p><strong>The refresh tax:</strong> tRFC / tREFI = 295 ns / 3906 ns ≈ <strong>7.6%</strong> for a 16 Gb die. Above 85 °C it roughly doubles. At high density, refresh is a first-order performance and power problem.</p>
<h2>What DDR5 changed</h2>
<ul>
<li><strong>Same-bank refresh (REFsb):</strong> refreshes the same bank index in every bank group while the other banks keep serving traffic.</li>
<li><strong>Refresh Management (RFM):</strong> the controller counts activates per bank and sends extra management commands to heavily activated banks, giving the device time to mitigate read-disturb effects like RowHammer.</li>
</ul>
<h2>The classic controller bug: refresh starvation</h2>
<p>A natural first design refreshes only when the rank is idle. Under sustained traffic the rank is never idle, so refresh never happens, and in real silicon that means data loss.</p>
<p>The fix is escalating urgency: count owed refreshes, refresh opportunistically at low debt, and past a threshold stop new activates, precharge, and force the refresh well before the spec's postponement limit.</p>
<p>The lesson interviewers love: <strong>liveness properties need adversarial traffic.</strong></p>
<h2>One-page summary</h2>
<p>tREFI, tRFC, and every other DDR5-4800 timing parameter with its physical cause are on a free printable cheat sheet: <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">download it here</a>.</p>
<p><em>Typical published values; confirm against your device datasheet and JEDEC JESD79-5. This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why DRAM Reads Are Destructive (and Why That Explains Half of DDR Timing)]]></title><description><![CDATA["Why are DRAM reads destructive?" shows up in a lot of hardware interviews. The one-line answer is "charge sharing." The answer that survives follow-up…]]></description><link>https://openrow.hashnode.dev/why-dram-reads-are-destructive-and-why-that-explains-half-of-ddr-timing</link><guid isPermaLink="true">https://openrow.hashnode.dev/why-dram-reads-are-destructive-and-why-that-explains-half-of-ddr-timing</guid><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><category><![CDATA[computer architecture]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:42:06 GMT</pubDate><content:encoded><![CDATA[<p>"Why are DRAM reads destructive?" shows up in a lot of hardware interviews. The one-line answer is "charge sharing." The answer that survives follow-up questions takes about three minutes, and it explains why tRAS, tWR, and refresh exist at all.</p>
<h2>One transistor, one capacitor</h2>
<p>An SRAM bit is six transistors holding a latch: it actively keeps its value. A DRAM bit is one transistor and one capacitor (1T1C). It just stores charge. That's why DRAM is so dense and cheap per bit, and also why it's strange to read.</p>
<h2>Reading is charge sharing</h2>
<p>Before a read, the bitline is precharged to the midpoint, VDD/2. When the wordline rises, the cell's small capacitor connects to the bitline's much larger capacitance, and they settle to one shared voltage:</p>
<p>ΔV = (V_cell − VDD/2) × Cs / (Cs + C_BL)</p>
<p>With illustrative values (VDD = 1.1 V, Cs = 10 fF, C_BL = 40 fF), a stored 1 moves the bitline by 0.55 × 10/50 = <strong>110 mV</strong>. A tiny signal.</p>
<p>Now look at the cell. Its capacitor is sitting at the shared voltage, not at a full 1. Reading it mostly erased it.</p>
<h2>The sense amplifier reads <em>and</em> restores</h2>
<p>A cross-coupled sense amplifier sees that 110 mV, regenerates it with positive feedback to full rail, and, because the access transistor is still on, drives the full value back into the cell. One activate does this for an entire row at once; that row of sense amps is the <strong>row buffer</strong>.</p>
<h2>Why this explains the timing rules</h2>
<ul>
<li><strong>tRCD</strong>: you can't read columns until the sense amps have resolved.</li>
<li><strong>tRAS</strong>: you can't precharge until the restore into the cells is finished.</li>
<li><strong>tWR</strong>: written data must reach the capacitors before the row closes.</li>
<li><strong>Refresh</strong>: capacitors leak anyway, so every row is periodically activated just to restore it.</li>
</ul>
<p>An interviewer follow-up you should expect: <em>"Why can't a bank have two rows open?"</em> Because a bank has one set of bitlines and sense amps. A second open row would charge-share onto the same bitlines and corrupt both.</p>
<h2>Keep going</h2>
<p>I wrote a free one-page DDR5 timing cheat sheet that maps each parameter to its physical cause. <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">Download it free</a>. If you want the full treatment, with worked DDR5-4800 examples and 30 interview questions with model answers, there's the <a href="https://openrow.gumroad.com/l/ddr5">DRAM &amp; DDR5 Interview Field Guide</a>.</p>
<p><em>This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item><item><title><![CDATA[DDR5 Timing Parameters Explained by Physics (tRCD, tRAS, tRP, tRRD, tFAW)]]></title><description><![CDATA[If you're preparing for an RTL, verification, or memory interview, you've probably memorized what tRCD stands for. The follow-up question is the hard one…]]></description><link>https://openrow.hashnode.dev/ddr5-timing-parameters-explained-by-physics-trcd-tras-trp-trrd-tfaw</link><guid isPermaLink="true">https://openrow.hashnode.dev/ddr5-timing-parameters-explained-by-physics-trcd-tras-trp-trrd-tfaw</guid><category><![CDATA[hardware]]></category><category><![CDATA[interview]]></category><category><![CDATA[computer architecture]]></category><dc:creator><![CDATA[Open Row]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:40:57 GMT</pubDate><content:encoded><![CDATA[<p>If you're preparing for an RTL, verification, or memory interview, you've probably memorized what tRCD stands for. The follow-up question is the hard one: <em>what is the silicon actually doing during that wait?</em> Once you see that every timing parameter is analog physics with a digital name, you can rebuild most of the rules from scratch.</p>
<h2>Start with the cell</h2>
<p>A DRAM bit is charge on a tiny capacitor, connected to a bitline through one access transistor. Reading it works by <strong>charge sharing</strong>: the bitline is precharged to VDD/2, the wordline turns on, and the small cell capacitor nudges the much larger bitline up or down by roughly 100 mV. A sense amplifier then amplifies that difference to full rail, and in doing so writes the value back into the cell, because charge sharing destroyed it.</p>
<p>Every core timing parameter protects one step of that process.</p>
<h2>The parameters, one physical cause each</h2>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Rule</th>
<th>What the silicon is doing</th>
<th>DDR5-4800 typical</th>
</tr>
</thead>
<tbody><tr>
<td>tRCD</td>
<td>ACT → RD/WR</td>
<td>Charge sharing plus sense-amp latching</td>
<td>16 ns</td>
</tr>
<tr>
<td>tRAS</td>
<td>ACT → PRE</td>
<td>Sense amp finishing the restore into the cells</td>
<td>32 ns</td>
</tr>
<tr>
<td>tRP</td>
<td>PRE → ACT</td>
<td>Bitlines equalizing back to VDD/2</td>
<td>16 ns</td>
</tr>
<tr>
<td>tRC</td>
<td>ACT → ACT, same bank</td>
<td>One full open-restore-close cycle (tRAS + tRP)</td>
<td>48 ns</td>
</tr>
<tr>
<td>tWR</td>
<td>Last write data → PRE</td>
<td>New data reaching the cell capacitors</td>
<td>30 ns</td>
</tr>
<tr>
<td>tRRD_S / _L</td>
<td>ACT → ACT, other bank</td>
<td>Activate current spikes: protecting the power grid</td>
<td>8 nCK / max(8 nCK, 5 ns)</td>
</tr>
<tr>
<td>tFAW</td>
<td>≤ 4 ACTs per window</td>
<td>Same power limit over a longer window</td>
<td>device-dependent</td>
</tr>
<tr>
<td>tCCD_S / _L</td>
<td>Column → column</td>
<td>Bank groups share internal data paths</td>
<td>8 nCK / max(8 nCK, 5 ns)</td>
</tr>
</tbody></table>
<p>Two of these trip people up. <strong>tFAW and tRRD are not logic delays.</strong> Every activate fires a whole row of sense amplifiers at once, a big current spike. Too many in a short window and the internal supply droops. <strong>The _S/_L split exists because of bank groups:</strong> banks in the same group share prefetch circuitry, so same-group operations need more spacing.</p>
<h2>The classic whiteboard question: tRRD_L in clocks</h2>
<p>DDR5-4800 means 4800 MT/s. Data moves on both clock edges, so the clock is 2400 MHz and tCK ≈ 0.4167 ns.</p>
<p>The rule is max(8 nCK, 5 ns). 5 / 0.4167 = 12, so <strong>tRRD_L = 12 clocks</strong>, not 8. Hard-coding the "8 nCK" you see in a table is an easy bug that every test written from the same assumption will happily pass.</p>
<h2>Want the one-page version?</h2>
<p>I put every core DDR5-4800 parameter on a free printable cheat sheet: the rule, the one-line physics, the typical value, and the clock count. <a href="https://openrow.gumroad.com/l/ddr5-cheat-sheet">Grab it free here</a>.</p>
<p><em>Values are typical published figures for DDR5-4800; always check your device datasheet and JEDEC JESD79-5. This article was generated with AI from the author's study notes.</em></p>
]]></content:encoded></item></channel></rss>