Applications 6
De la WikiLabs
Exercise 1
D flip-flop
the output takes the value of the input, q <= d
, but only at discrete moments of time,
when the control signal clk changes from 0 to 1, always @(posedge clk)
.
clock generation in testbench
initial begin
clk = 0; // initialization at time 0
forever #5 clk = ~clk; // toggle the clock at each 5 simulation steps
end