← ProblemsVerification: Writing Testbenches
T flip-flop testbench
36%testbenchYou are given a T flip-flop with synchronous, active-high reset:
module tff ( input clk, input reset, input t, output q );
Write a testbench that resets the flip-flop, then leaves it toggling:
- Generate a free-running clock (e.g. 10 ps period, starting at 0).
- At time 0, assert
reset = 1witht = 0, and hold both for one full clock cycle so at least one rising edge samples the reset. - Then deassert
reset = 0and sett = 1for the rest of the simulation, soqtoggles on every subsequent rising clock edge.
Note: This problem requires a behavioral testbench, which isn't graded in-browser — write and run it in an external Verilog simulator, then mark your result here.
This problem can't be auto-graded here yet — it needs a full behavioral Verilog simulator. Solve it in an external simulator, then record your result so your learning path stays accurate.