Prev Problem
Next Problem

83. T Flip-Flop

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

Code

module t_ff (
    input  CLK,
    input  T,
    output reg Q
);
// Write your code here
    wire q1;
    assign q1 = ~Q;
    always @(posedge CLK or negedge T)
        if (!T)
            Q <= Q;
        else Q <= q1;
endmodule

 

Was this helpful?
Upvote
Downvote