Verilog I
Verilog I
CS/ECE/EEE/INSTR F215
INTRODUCTION TO VERILOG
PROF. ANITA AGRAWAL
As designs grew larger and more complex, paper or breadboard method became
difficult.
Designers thought of using some language which could describe the gate level models
(hardware).
• Technology independent
There are several HDL languages in use today. Abel, Palasam and
Cupl used for less complex devices & Verilog & VHDL used for larger
CPLDs. & FPGA devices.
• From 1990, Cadence opened the language to the public which led to the
standardization of the language by IEEE in 1995.
Verilog!!!
Design Entry
HDL/Schematic editor
Logic Synthesis
• Offers modularity
port declarations;
Verilog statements
-----------; body
-----------;
-----------;
endmodule
keyword
Sep 25, 2022 Anita Agrawal CS/ECE/EEE/INSTR F215 22
Port/Signal Specification
• The syntax of a signal declaration is quite simple,
it starts with a keyword denoting the type of the
signal, followed by the signal name.
22/09/06
Some important points
• Verilog model consists of 100 keywords.
• keywords predefined lowercase identifiers
that define the language constructs
• Comments:
• single line: //abnnmm…….
• Multi-line comments: /* */
• Case-sensitive
22/09/06
Signal Declaration
•The declaration of the signal must start with a keyword
denoting the signal
•Legal keywords are input, output, wire, tri, tri1, tri2,
supply1, supply0, integer, real etc..
•All letters must be lowercase
•A blank space follows the keyword
•All declarations are terminated with a semicolon
22/09/06
Signal Name
• Signal name cannot start with a $ or a number
• Cannot contain space inside
• It
cannot be of the reserved keywords type, for
ex. Wire, tri etc……
• More than one signal of the same type can be
written with the same keyword, in the same line
separated by commas.
22/09/06
Signal Specification
22/09/06
Example
G1
G3
G2
module Simple_Circuit(A, B, C, D, E);
output D, E;
input A, B, C;
wire w1;
and G1 (w1, A, B);
not G2 (E, C);
or G3 (D, w1, E);
endmodule
Sep 25, 2022 Anita Agrawal CS/ECE/EEE/INSTR F215 28
Gate Delays
• In Verilog, the propagation delay is specified of a gate is specified in
terms of time units and a symbol #.
• Number is a dimensionless quantity
• Association of time unit with physical time is made using ‘timescale compiler
directive.
• ‘timescale 1ns/100 ps.
• 1 ns: unit of measurement for time delays
• 100 ps: Precision with which the delays are rounded off.
• If no timescale used: default time (1 ns ) is used.
Sep 25, 2022 Anita Agrawal CS/ECE/EEE/INSTR F215 29
How to tackle Propagation delays
• You can include delays in your code. This will be the delay
in addition to the propagation delay that the gate
requires to change the output when the input signal
changes.