Complete the code to declare a 4-bit register.
reg [[1]:0] my_reg;
The register is 4 bits wide, so the index goes from 3 down to 0.
Complete the code to assign the value of input 'a' to output 'b' using continuous assignment.
assign b = [1];The continuous assignment connects output 'b' to input 'a'.
Fix the error in the always block sensitivity list to correctly trigger on clock's rising edge.
always @([1]) begin
q <= d;
endThe always block should trigger on the positive edge of the clock for synchronous logic.
Fill both blanks to create a combinational always block that triggers on changes to inputs 'a' or 'b'.
always @([1] or [2]) begin y = a & b; end
The always block triggers whenever 'a' or 'b' changes, making it combinational logic.
Fill all three blanks to create a synchronous reset flip-flop with active low reset.
always @([1] or [2]) begin if (![3]) begin q <= 0; end else begin q <= d; end end
The always block triggers on the clock's rising edge and reset's falling edge. The reset signal is active low, so we check if 'rst_n' is low.
