Files
hdl-projects/flip_flop/flip_flop.v
Jose Luis Montañes Ojados 1525373c61 add flipflop
2026-03-01 01:21:07 +01:00

17 lines
282 B
Verilog

/*
Flip-Flop D y registro
*/
module register #(parameter N = 8)(
input clk,
input rst,
input en,
input [N-1:0] d,
output reg [N-1:0] q
);
always @(posedge clk or posedge rst) begin
if (rst) q <= 0;
else if (en) q <= d;
end
endmodule