Prev Problem
Next Problem

78. D Flip-Flop with Asynchronous Reset

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

Code

module dff_async_reset (
    input  CLK,
    input  RST,
    input  D,
    output reg Q
);
    // async active-high reset with posedge sensitivity
    always @(RST) begin
        Q<=0;
    end
    always @(posedge CLK)begin
        if(!RST)begin
            Q<=D;
        end
    end
    
endmodule

 

Was this helpful?
Upvote
Downvote