1 2 3 4 5 6 7 8 9 10 11 12
module dff_rst(d,rst,clk,q); input d,clk,rst; output reg q; always @(posedge clk) begin if(rst) begin q<=1'b0; end else begin q<=d; end end endmodule