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

Buf/Not Multiple Outputs

Verilog Gate Level Simulation

Example of 'buf' and 'not' with multiple output ports driven by a single input

Open in IDE
Related tutorial:
design.v
module gates (	input  a, 
				output c, d);

  not (c, d, a); 		// c,d is the output, a is input
  
endmodule
testbench.v
module tb;
	reg a;
	wire c, d;
	integer i;
	
	gates u0 ( .a(a), .c(c), .d(d));
	
	initial begin
		a = 0;
		
      $monitor ("[T=%0t a=%0b c(buf)=%0b d(not)=%0b", $time, a, c, d);
		
		for (i = 0; i < 10; i = i+1) begin
			#1 	a <= $random;
		end
	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.