Unit 3
Unit 3
Unit – 3
`timescale 1ns/100ps defines time unit/ time precision i.e., means that all the delays that
follow (like# 5.1234) are interpreted to be in nanoseconds and any fractions will be rounded
to the nearest picosecond (5123ps).
• Only trireg nets can have storage strengths large, medium, small
initial statements;
always statements;
gate instantiations;
UDP instantiations;
endmodule;
and and_gate(o1,i1,i2);
xor xor_gate(o2,i3,i4);
endmodule
end module
end module
1. Rise delay:
This delay comes into picture when the output of the gate transit from
another value to logic 1.
3. Turn-off delay
When gate output transit to Z from any other logic value.
If the gate output transit to don’t care then minimum of three delays is
considered.
Example:
module D (out,a,b,c);
input a,b,c;
output out;
Wire e;
and #(5) a1 (e,a,b);
//or#(4,5) o1(out,e,c);
or #(4,5,6) o1 (out,e,c);
endmodule
endmodule
Example:
module circuit_eg (f,a,b,c,d);
input a,b,c,d;
output f;
Wire w1,w2,w3;
endmodule
• Keyword: forever
• It executes forever until $finish or disable statement is encountered
• It does not require any expression
SYNTAX:
initial
begin
clock = 1’b0;
forever #10 clock = ~clock; //clock with period of 10 units
end