Complete the code to declare the module with inputs and outputs.
module dff_async_reset(input clk, input rst_n, input [1], output reg q);The input data signal is named d in a D flip-flop.
Complete the sensitivity list for the always block to include clock and asynchronous reset.
always @(negedge [1] or posedge clk) begin
The asynchronous reset triggers on the negative edge of rst_n.
Fix the error in the reset condition to correctly reset output q to 0.
if ([1] == 1'b0) q <= 1'b0;
q in conditionThe reset signal rst_n is active low, so when it is 0, q resets to 0.
Fill the blank to assign q the input d on clock rising edge when reset is inactive.
else begin q <= [1]; end
q to itselfOn clock rising edge, q takes the value of d.
Fill all three blanks to complete the always block with asynchronous reset and data assignment.
always @([1] or posedge [2]) begin if ([3] == 1'b0) q <= 1'b0; else q <= d; end
The always block triggers on negative edge of reset and positive edge of clock. The reset signal rst_n is active low.
