Complete the code to declare a 4-bit register named 'count'.
reg [3:0] [1] ;
The register name should be 'count' to match the declaration.
Complete the code to create a synchronous reset in the always block.
always @(posedge clk) begin if ([1]) count <= 0; else count <= count + 1; end
The reset signal is checked synchronously on the clock's rising edge.
Fix the error in the code to avoid inferred latches.
always @(*) begin if (enable) out = in1; else [1]; end
Assigning a value in both branches prevents latch inference.
Fill both blanks to complete a parameterized module declaration.
module counter #(parameter [1] = 8) ( input wire clk, input wire reset, output reg [[2]-1:0] count );
The parameter name 'WIDTH' is used to define the bit width of the count output.
Fill all three blanks to complete a non-blocking assignment in a clocked always block.
always @(posedge clk or posedge [1]) begin if ([2]) count <= 0; else if (enable) count <= count [3] 1; end
The reset signal is used in the sensitivity list and condition. The count increments by 1.
