2019-10-18 05:50:24 -05:00
|
|
|
module dff ( input d, clk, output reg q );
|
|
|
|
always @( posedge clk )
|
|
|
|
q <= d;
|
2019-09-23 04:12:02 -05:00
|
|
|
endmodule
|
|
|
|
|
2019-10-18 05:50:24 -05:00
|
|
|
module dffe( input d, clk, en, output reg q );
|
2021-09-24 14:50:26 -05:00
|
|
|
`ifndef NO_INIT
|
2019-09-23 04:12:02 -05:00
|
|
|
initial begin
|
2019-10-18 05:50:24 -05:00
|
|
|
q = 0;
|
2019-09-23 04:12:02 -05:00
|
|
|
end
|
2021-09-24 14:50:26 -05:00
|
|
|
`endif
|
2019-10-18 05:50:24 -05:00
|
|
|
always @( posedge clk )
|
|
|
|
if ( en )
|
|
|
|
q <= d;
|
2019-09-23 04:12:02 -05:00
|
|
|
endmodule
|