Prev Problem
Next Problem

83. T Flip-Flop

Back To All Submissions
Previous Submission
Next Submission

Code

module t_ff (
    input  CLK,
    input  T,
    output reg Q
);
// Write your code here
    always @(posedge CLK) begin
        case(T)
            1'b0: begin
                Q <= Q;
            end

            1'b1: begin
                Q <= ~Q;
            end
        endcase
    end

endmodule
Was this helpful?
Upvote
Downvote