module dff(d, c, q, rst); input d, c, rst; output q; reg q; always @(posedge c) begin if (rst == 1'b1) q = 0; else q = d; end endmodule