quasar/gated_latch.v

15 lines
242 B
Coq
Raw Normal View History

2020-11-18 18:42:14 +08:00
module gated_latch
2020-09-22 13:35:24 +08:00
(
2020-12-09 12:34:03 +08:00
input wire SE, EN, CK,
2020-09-22 13:35:24 +08:00
output Q
);
2020-12-09 12:34:03 +08:00
reg en_ff;
wire enable;
2020-09-22 13:35:24 +08:00
assign enable = EN | SE;
always @(CK, enable) begin
if(!CK)
en_ff = enable;
end
assign Q = CK & en_ff;
endmodule