mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
15 lines
234 B
Text
15 lines
234 B
Text
module latch (D, G, Q, QN);
|
|
reg IQ, IQN;
|
|
input D;
|
|
input G;
|
|
output Q;
|
|
assign Q = IQ; // IQ
|
|
output QN;
|
|
assign QN = IQN; // IQN
|
|
always @* begin
|
|
if ((G)) begin
|
|
IQ <= D;
|
|
IQN <= ~(D);
|
|
end
|
|
end
|
|
endmodule
|