BitFlow

D Flip-Flop with Synchronous Reset

intermediate · sequential · 120 XP

Sign in to write your solution, run it in the simulator and submit it for grading.

Sign in or create a free account →

Problem

D Flip-Flop with Synchronous Reset A **synchronous reset** flip-flop only resets on the rising clock edge — not immediately when `rst` goes high. The sensitivity list is `always @(posedge clk)` only; `rst` is checked as a regular condition inside the block. **Interface** | Port | Direction | Description | |------|-----------|------------------------------------| | `clk` | input | Clock (rising-edge triggered) | | `rst` | input | Reset (synchronous, active-high) | | `d` | input | Data input | | `q` | output | Registered output | **Key insight:** assert `rst=1` mid-cycle — the output does **not** change until the next rising edge. Compare against the async-reset DFF: the outputs will diverge at the exact moment `rst` is asserted between edges. In your comments, explain which reset style a synchronous design methodology prefers and why.

Constraints

  • Sensitivity list must be `always @(posedge clk)` only — no `rst` in the sensitivity list.
  • On posedge clk: if rst=1, q <= 0; else q <= d.
  • No async behaviour — rst mid-cycle must not affect q.

Examples

Input: rst=1 asserted mid-cycle

Output: q unchanged until next posedge clk

Synchronous reset waits for clock edge

Input: posedge clk with rst=1

Output: q=0

Reset takes effect on the clock edge

Input: posedge clk with rst=0, d=1

Output: q=1

Normal D capture

Common questions

What does the D Flip-Flop with Synchronous Reset problem ask you to build?
D Flip-Flop with Synchronous Reset A **synchronous reset** flip-flop only resets on the rising clock edge — not immediately when `rst` goes high. The sensitivity list is `always @(posedge clk)` only; `rst` is checked as a regular condition inside the block.
What constraints does D Flip-Flop with Synchronous Reset have?
Sensitivity list must be `always @(posedge clk)` only — no `rst` in the sensitivity list.; On posedge clk: if rst=1, q <= 0; else q <= d.; No async behaviour — rst mid-cycle must not affect q.
What is an example input and output for D Flip-Flop with Synchronous Reset?
Input rst=1 asserted mid-cycle gives output q unchanged until next posedge clk. Synchronous reset waits for clock edge
Which Verilog concepts does D Flip-Flop with Synchronous Reset practise?
sequential, flip-flop, DFF, synchronous-reset, interview.