Ready-to-run snippets

Code Examples

Ready-to-run Verilog, SystemVerilog, and UVM examples. Click any to open it live in the IDE.

← All examples

Interview Questions Set 7: What is #0 in Verilog and its usage?

Verilog Examples

Runnable example from the Verilog Interview Questions Set 7 tutorial (What is #0 in Verilog and its usage?)

Open in IDE
testbench.v
module tb;
	reg [3:0] x;

	initial begin
      $monitor("[%0t] x = %0d", $time, x);

		x = 0;		
		#10 x = 10;
	end

	initial begin
		#10;
		#0 x = 15;   
	end	
endmodule
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.