Prev Problem
Next Problem

74. Gated SR Latch

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

Code

module sr_latch_enable (

input EN,

input S,

input R,

output Q,

output Qn

);

reg q;

always @(*) begin

if(EN) begin

if (S && !R) q = 1;

else if(!S && R) q =0;

else if(S && R) q =0;

end

end

assign Q = q;

assign Qn = ~q;


endmodule

 

Was this helpful?
Upvote
Downvote