Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
RST) if(RST) begin Q = 1'b0; Qbar=~Q; end else begin Q = D; Qbar=~D; end endmodule module d_flipflop_tb; reg D,CLK,RST; wire Q,Qbar; d_flipflop STAGE(Q,Qbar,D,CLK,RST); initial begin D=1'b0;CLK=1'b0;RST=1'b0; #100 $finish; end always #2 CLK=~CLK; always #4 D=~D; always #8 RST = ~RST; initial $monitor($time, " D = %b CLK = % b RST = %b Q = %b Qbar = %b \n",D,CLK,RST,Q,Qbar); endmodule