quasar/target/scala-2.12/classes/vsrc/gated_latch.v

15 lines
242 B
Coq
Raw Normal View History

2020-12-09 19:39:49 +08:00
module gated_latch
2020-10-07 15:52:38 +08:00
(
2020-12-09 19:39:49 +08:00
input wire SE, EN, CK,
2020-10-07 15:52:38 +08:00
output Q
);
2020-12-09 19:39:49 +08:00
reg en_ff;
wire enable;
2020-10-07 15:52:38 +08:00
assign enable = EN | SE;
always @(CK, enable) begin
if(!CK)
en_ff = enable;
end
assign Q = CK & en_ff;
2020-12-09 19:39:49 +08:00
endmodule