1module top(input clk, d, reset, output reg q); 2 initial q = 1'b1; 3 always @(posedge clk) 4 if (reset) 5 q <= 1'b0; 6 else 7 q <= d; 8endmodule 9