1 2 3 4 5 6 7 8 9 10 11
module dlatchsr( input d, set, clr, en, output reg q ); always @* begin if ( clr ) q = 0; else if (set) q = 1; else if (en) q = d; end endmodule