Complete the code to trigger the always block on the positive edge of clk.
always @([1]) begin
q <= d;
endThe always block should be sensitive to the positive edge of the clock signal clk to update q correctly.
Complete the code to trigger the always block on the negative edge of reset.
always @([1]) begin if (!reset_n) begin q <= 0; end end
The always block should be sensitive to the negative edge of the active-low reset signal reset_n to reset q properly.
Fix the error in the sensitivity list to trigger on both posedge clk and negedge reset_n.
always @([1]) begin if (!reset_n) q <= 0; else q <= d; end
The always block should trigger on the positive edge of clk and the negative edge of reset_n to handle synchronous data and asynchronous reset.
Fill both blanks to create an always block sensitive to posedge clk and posedge enable.
always @([1] or [2]) begin if (enable) q <= d; end
The always block triggers on the positive edges of both clk and enable signals.
Fill all three blanks to create an always block sensitive to posedge clk, negedge reset_n, and posedge set.
always @([1] or [2] or [3]) begin if (!reset_n) q <= 0; else if (set) q <= 1; else q <= d; end
The always block triggers on the positive edge of clk, the negative edge of reset_n, and the positive edge of set to handle synchronous data, asynchronous reset, and asynchronous set.