Introduction
Gate-level delay annotation helps show how long signals take to travel through logic gates. This makes your design timing more realistic.
Gate-level delay annotation helps show how long signals take to travel through logic gates. This makes your design timing more realistic.
and #(delay) and1 (output, input1, input2); not #(delay) not1 (output, input);
and #(5) and1 (out, a, b);
not #(2) not1 (out, in);
or #(3) or1 (out, a, b);
This program shows an AND gate with 4 time units delay and a NOT gate with 2 time units delay. Inputs change over time and output changes follow after the delays.
module delay_example(); reg a, b; wire out_and, out_not; and #(4) gate_and(out_and, a, b); not #(2) gate_not(out_not, a); initial begin a = 0; b = 0; #1 a = 1; #1 b = 1; #10 $finish; end initial begin $monitor($time, ": a=%b b=%b out_and=%b out_not=%b", a, b, out_and, out_not); end endmodule
Delays help simulate real hardware timing but slow down simulation.
Delays are ignored in synthesis (building real chips), only for simulation.
Gate-level delay annotation adds timing delays to logic gates in simulation.
Use #(delay) after gate type to specify delay in time units.
This helps check if your design works correctly with real-world timing.
out changes after in1 or in2 changes?and #3 (out, in1, in2);
or (out, in1, in2) #4;
Pass the test and this pattern moves unknown