0
0
Verilogprogramming~5 mins

T flip-flop behavior in Verilog - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main function of a T flip-flop?
A T flip-flop toggles its output on each clock pulse when the T input is high (1). If T is low (0), the output remains the same.
Click to reveal answer
beginner
Explain the behavior of a T flip-flop when T = 0.
When T = 0, the T flip-flop holds its current state and does not change output on the clock edge.
Click to reveal answer
intermediate
Write the Verilog sensitivity list for a T flip-flop triggered on the positive edge of the clock.
The sensitivity list is: always @(posedge clk) begin ... end which means the block runs on the rising edge of the clock signal.
Click to reveal answer
beginner
What happens to the output Q of a T flip-flop if T = 1 and a clock pulse occurs?
The output Q toggles its value: if Q was 0, it becomes 1; if Q was 1, it becomes 0.
Click to reveal answer
intermediate
Show a simple Verilog code snippet for a T flip-flop behavior.
always @(posedge clk) begin if (T) Q <= ~Q; // Toggle output else Q <= Q; // Hold output end
Click to reveal answer
What does a T flip-flop do when T = 1 at the clock's rising edge?
AIt holds the current output Q
BIt resets the output Q to 0
CIt sets the output Q to 1
DIt toggles the output Q
Which Verilog keyword is used to describe behavior on a clock edge?
Aalways @(posedge clk)
Bif (clk)
Cwhile (clk)
Dcase (clk)
If T = 0, what happens to the output Q of a T flip-flop at the clock edge?
AQ toggles
BQ holds its previous value
CQ resets to 0
DQ sets to 1
What is the output Q after two clock pulses if T = 1 and initial Q = 0?
A0
B1
CToggles twice, so back to 0
DUndefined
Which statement best describes a T flip-flop?
AIt stores data and toggles output based on T input
BIt only resets output
CIt only sets output
DIt is asynchronous
Describe how a T flip-flop behaves with respect to its T input and clock signal.
Think about when the output changes and when it stays the same.
You got /3 concepts.
    Write a simple Verilog always block that models a T flip-flop triggered on the positive edge of the clock.
    Use if condition inside the always block to check T input.
    You got /3 concepts.