Asynchronous Active Low Reset
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:
qbecomes1'b0immediately - 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
qmust be registered and updated on the positive edge ofclk. - The reset condition must be evaluated asynchronously;
qmust become 0 immediately whenrst_ngoes low, without waiting for the next clock edge. - The reset signal
rst_nis active-low. - The reset condition must take priority over any data capture.
Topics
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.
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.