GCB_MFF.v
346 Bytes
`timescale 1ns/1ns
module GCB_MFF (q, qn, da, db, sa, cp, sdn, cdn);
input da, db, sa, cp, sdn, cdn;
output q, qn;
reg tq;
assign qn = (!sdn && !cdn) ? 1'b0 : ~q;
assign q = (sdn && cdn) ? tq : (!sdn && cdn) ? 1'b1 : 1'b0;
always @ (posedge cp)
if (sa)
tq <= #1 da;
else
tq <= #1 db;
endmodule