Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations57
  • Combinational Design58
  • Sequential Design61
    • Flip-Flops and Registers
    • Counters and Timers
    • Shift Registers and LFSRs
    • Pipelining
    • Stalls, Bubbles and Hazards
    • Retiming
  • FSM & Control66
  • Timing & Clocking64
  • Reset & CDC58
  • Memory & Buses94
  • Advanced RTL60
  • Senior & Interview175
  • Glossary and Notation
Loading lesson

‹RTL Design
  1. Topics
  2. RTL Design
  3. Sequential Design

Part 3 · Sequential · Intermediate

Sequential Design

Sequential logic with memory: registers, counters, shift registers, pipelining, hazards, and retiming.

  • 6topics
  • 61lessons

Sequential logic stores state across clock edges in registers with next-state logic and reset. This section covers flip-flops, counters, shift registers, pipelining, flow control, and retiming.

Learning path through the sequential topics.
Suggested order. Each topic uses the previous one: counters are registers with next-state logic, pipelines are registers between logic stages.

Topic

Lessons

After it you can…

Study time

Flip-flops and registers

5

Write registers with the right reset and enable style.

2 h

Counters and timers

6

Build up/down counters, prescalers and a watchdog.

2 h

Shift registers and LFSRs

3

Serialize and deserialize data; generate PRBS sequences.

2 h

Pipelining

5

Pipeline a datapath, add valid/ready flow control, and build a pipelined MAC with its precision checks.

3–4 h

Stalls, bubbles and hazards

5

Stall, flush, forward, and share a port fairly with a round-robin arbiter.

2–3 h

Retiming

3

Balance stages and cut the ready path with a skid buffer.

2 h

Study time covers reading each lesson and running its examples. The section's hands-on project takes extra hours on top.

Tip

A good habit for every sequential module: write down the reset value of each register, and what the register does on every cycle where nothing special happens (holds, counts, shifts). Most sequential bugs are one of those two being wrong.

Check yourself Why do pipelined designs reset the valid bits but usually not the data registers?

Valid bits decide whether a stage holds real work, so they must start at 0. Data registers are overwritten before they are used, so a reset only adds area and timing cost.

Interview

Typical screening tasks from this section: write a counter with load and terminal count, convert parallel to serial, build a valid/ready pipeline stage, and explain what a skid buffer does.

End-of-section checkpoint

Use these four questions to decide whether you are ready to move on: explain, predict, implement and debug. If one is shaky, each answer names the lesson to revisit. New readers can skip this until they finish the section.

Check yourself Explain: what is the difference between a clock enable and a gated clock, and why does RTL normally use the enable?

A clock enable is a mux in front of D: the flop still sees every clock edge but reloads its own value when disabled, so the clock tree is untouched. A gated clock puts logic on the clock path, which adds skew and can glitch. RTL writes an enable and lets the tools insert a proper integrated clock-gating cell. Revisit Clock enable vs gated clock.

Check yourself Predict: a three-stage pipeline runs at 500 MHz with no stalls. What are its throughput and its latency?

Throughput is one result per cycle: 500 million results per second. Latency is three cycles, 6 ns, from an input to its result. Pipelining raised the clock rate the logic allows; it did not shorten the time for one item. Revisit Throughput and latency.

Check yourself Implement: a counter that counts 0 to N-1 when en is high, wraps to 0, and raises tc for one enabled cycle at N-1.

always_ff @(posedge clk) if (!rst_n) cnt <= '0; else if (en) cnt <= (cnt == N-1) ? '0 : cnt + 1'b1; and assign tc = en && (cnt == N-1);. Gating tc with en makes it last exactly one counting step. Revisit Up/down counter with terminal count and reload.

Check yourself Debug: a valid/ready pipeline stage loses words whenever the downstream stalls. The stage loads its register whenever in_valid is high. What is wrong?

It loads without a handshake, so a new word overwrites one that has not left yet. Load only when in_valid && in_ready, with in_ready = !out_valid || out_ready: the stage accepts only when it is empty or its word is leaving in the same cycle. Revisit Valid/ready pipeline flow control.

How this was checked

Complete modules are compiled and self-checking testbenches are run by separate validation commands, not on every build.

Pipelines and handshakes are tested with random stalls and a scoreboard, so ordering, loss and duplication are checked on thousands of items.

Waveforms in these lessons come from real simulation output; structure diagrams are drawn by hand.

Related topics

  • Previous: Combinational design

  • Next: Finite state machines

PreviousNext: Flip-Flops and Registers

Up next

Up nextFlip-Flops and Registers

Sign in to save progress

Practice this lessonReport an error

See also

  • RTL Foundations
  • Combinational Design
  • FSM & Control