Applications 6
De la WikiLabs
Versiunea din 2 aprilie 2019 21:58, autor: Zhascsi (discuție | contribuții) (Pagină nouă: == Exercise 1 == === D flip-flop === Fișier: dreg1.png the output takes the value of the input, <syntaxhighlight lang="Verilog" inline>q <= d</syntaxhighlight>, but only at...)
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