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

Gate Delay: Inertial Delay: Short Pulses Are Filtered

Verilog Examples

Runnable example from the Verilog Gate Delay tutorial (Inertial Delay: Short Pulses Are Filtered)

Open in IDE
testbench.v
module pulse_demo;
  reg a, b;
  wire out;

  and #3 o1 (out, a, b);

  initial begin
    a = 0; b = 1;
    #10 a = 1;    // 2 unit pulse on a, shorter than the delay of 3
    #2  a = 0;
    #10 a = 1;    // 5 unit pulse on a, longer than the delay
    #5  a = 0;
  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.