CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Sequential Logic

Asynchronous Active Low Reset

EasyVerilog / SystemVerilogBuild

Every reliable digital system requires a robust initialization mechanism. In many ASIC flows, standard cell libraries and power-on sequences rely heavily on asynchronous active-low resets to force registers into a known safe state even before a stable clock is available.

This module implements a fundamental D-type flip-flop with an asynchronous active-low reset. When the reset is not asserted, the flip-flop captures the value of the data input on the rising edge of the clock and reflects it on the output. When the reset is asserted, the output immediately transitions to zero regardless of the clock signal state.

  • Clock edge: posedge clk
  • Reset type: Asynchronous
  • Reset polarity: Active-low (rst_n)
  • Output on reset: q becomes 1'b0 immediately
  • Priority rules: The asynchronous reset has absolute priority over the clock and data inputs

Worked Trace: Cycle 1: rst_n=0, clk=0, d=1 → q=0 (asynchronous reset overrides data) Cycle 2: rst_n=1, clk=↑, d=1 → q=1 (normal capture on clock edge) Cycle 3: rst_n=1, clk=↑, d=0 → q=0 (normal capture on clock edge) Cycle 4: rst_n=0, clk=0, d=1 → q=0 (asynchronous reset asserts between clock edges, immediately clearing q)

{
  "signal": [
    { "name": "clk",   "wave": "p......" },
    { "name": "rst_n", "wave": "01...01" },
    { "name": "d",     "wave": "1..0.1." },
    {},
    { "name": "q",     "wave": "0.10..1" }
  ],
  "head": { "text": "Asynchronous active-low reset behavior" }
}

| Signal | Direction | Width | Description | |--------|-----------|-------|-------------| | clk | input | 1 | Positive-edge triggered clock | | rst_n| input | 1 | Asynchronous active-low reset; forces q to 0 | | d | input | 1 | Data input | | q | output | 1 | Registered data output; resets to 1'b0 |

Constraints

  • The output q must be registered and updated on the positive edge of clk.
  • The reset condition must be evaluated asynchronously; q must become 0 immediately when rst_n goes low, without waiting for the next clock edge.
  • The reset signal rst_n is active-low.
  • The reset condition must take priority over any data capture.

Topics

flip-flopasynchronousreset

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against a real testbench — you get the waveform back, not a stored answer.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Basic D Flip FlopEasy
  • Debug: Missing Edge in Sensitivity ListMedium
  • Read After Write Hazard DetectionEasy
  • Parameterized Interface with ModportsHard
  • Struct Array PipelineHard
  • T Flip Flop from D Flip Flop TemplateEasy
  • Recursive Generate Reduction TreeHard
  • Four Stage Shift RegisterEasy

Browse all problems · Learning tracks