SlideShare a Scribd company logo
Verilog Hardware Description
Language
Define Modules,Ports, Gate level Modelling
-Prof.Vandana Pagar
Assistant professor
Learning Objectives:
• Identify the components of aVerilog module
definition, such as module names, port lists,
parameters, variable declarations, dataflow
statements, behavioral statements,
instantiation of other modules, and tasks or
functions.
 Understand how to define the port list for a
module and declare it inVerilog.
 Describe the port connection rules in a
module instantiation.
 Understand how to connect ports to
external signals, by ordered list, and by
name.
Learning Objectives:
 Identify logic gate primitives provided in
Verilog.
 Understand instantiation of gates, gate symbols
and truth tables for and/or and buf/not type
gates.
 Understand how to construct aVerilog
description from the logic diagram of the
circuit.
 Describe rise, fall, and turn-off delays in the
gate-level design.
 Explain min, max, and type delays in the gate-
level design.
Modules and Ports
 A module inVerilog consists of distinct parts, as shown
in Figure.
Modules and Ports
 A module definition always begins with the keyword
module.
➢ The module name,
➢ port list,
➢ port declarations, and
➢ optional parameters must come first in a module
definition.
 The five components within a module are –
variable declarations, dataflow statements, instantiation
of lower modules, behavioral blocks, and tasks or
functions.
 These components can be in any order and at any place in
the module definition.
 The endmodule statement must always come last in a
module definition.
 All components except module, module name, and
endmodule are optional and can be mixed and matched as
per design needs.
Example of an SR latch:
This example illustrates the
different components of a module
module SR-latch (Q, Qbar, Sbar, Rbar);
output Q, Qbar;
//Port declarations
input Sbar, Rbar;
// Instantiate lower-level modules
nand nl (Q, Sbar, Qbar) ;
nand n2 ( Qbar , Rbar , Q) ;
endmodule
moduleTop;
wire q, qbar;
reg set, reset;
// Instantiate lower-level modules
// In this case, instantiate SR-latch
// Feed inverted set and reset signals to the SR latch
SR-latch ml(q, qbar, -set, -reset);
// Behavioral block, initial
initial
begin
$monitor($time, " set = %b, reset= %b, q=
%bnU,set,reset,q);
set = 0; reset = 0;
#5 reset = 1;
#5 reset = 0;
#5 set = 1;
end
endmodule
Ports
 Ports provide the interface by which a
module can communicate with
environment.
 For example, the input/output pins of an
IC chip are its ports.
 The environment can interact with the
module only through its ports.
 The internals of the module are not
visible to the environment.
 The internals of the module can be
changed without affecting the
environment as long as the interface is
not modified.
 Ports are also referred to as terminals.
Ports:
 module definition contains an optional list of
ports.
 If the module does not exchange any signals
with the environment, there are no ports in
the list.
Ex. Consider a 4-bit full adder that is instantiated
inside a top-level module Top.
module fulladd4 (sum, c-out, a, b, c-in);
//module with a list of ports
moduleTop; // No list of ports, top-level
module in simulation
Ports
 Notice that in the above figure, the module
Top is a top-level module.
 The module fulladd4 is instantiated below Top.
The module fulladd4 takes input on ports a, b,
and c-in and produces an output on ports sum
and c-out.
• Thus, module fulladd4 performs an addition
for its environment.
• The module Top is a top-level module in the
simulation and does not need to pass signals
to or receive signals from the environment.
Thus, it does not have a list of ports
Port Declaration
 All ports in the list of ports must be
declared in the module. Ports can be
declared as follows:
 Each port in the port list is defined as input, output,
or inout, based on the direction of the port signal.
Thus, for the example of the fulladd4 in Example.
module fulladd4(sum, c-out, a, b, c-in);
//Begin port declarations section
output [3 : 0] sum;
output c-cout;
input [3:0] a, b;
input c-in;
//End port declarations section
...
<module internals>
...
endmodule
1.Gate level Modeling- Gate types, Gate
delays
2.Data flow modeling- Continuous
Assignments, Delays expression, operators
& operands
3.Behavioral Modeling- Structured
Procedures, Procedural Assignments,Timing
Controls, Conditional statements, Multiway
Branching, Loops
1.Gate level Modeling
 At gate level, the circuit is described in
terms of gates (e.g., and, nand).
 Hardware design at this level is intuitive for a
user with a basic knowledge of digital logic
design because it is possible to see a one-to-
one correspondence between the logic
circuit diagram and theVerilog description.
 Hence, we chose to start with gate-level
modeling and move to higher levels of
abstraction in the succeeding lectures.
1.Gate level Modeling
 GateTypes
 A logic circuit can be designed by use of
logic gates.Verilog supports basic logic gates
as predefined primitives.
 These primitives are instantiated like
modules except that they are predefined in
Verilog and do not need a module definition.
 All logic circuits can be designed by using
basic gates.
 There are two classes of basic gates: and l or
gates and buf l not gates
And/Or Gates
 and/or gates have one scalar output and
multiple scalar inputs.
 The first terminal in the list of gate
terminals is an output and the other
terminals are inputs.
 The output of a gate is evaluated as soon
as one of the inputs changes.
Gates:
and or xor
nand nor xnor
VHDL- gate level modelling
VHDL- gate level modelling
VHDL- gate level modelling
Buf/Not Gates
 Buf / not gates have one scalar input and
one or more scalar outputs.
Two basic buf l not gate primitives are
provided inVerilog.
// basic gate instantiations.
buf bl(OUT1, IN);
not nl(OUT1, IN);
// More than two outputs
buf bl_2out(OUTl, OUT2, IN);
// gate instantiation without instance
name
not (OUT1, IN); // legal gate
instantiation
VHDL- gate level modelling
VHDL- gate level modelling
.
 These gates are used when a signal is to
be driven only when the control signal is
asserted. Such a situation is applicable
when multiple drivers drive the signal.
Example
wire OUT, IN1, IN2;
// basic gate instantiations.
and a1(OUT, IN1, IN2);
nand nal (OUT, IN1, IN2 ) ;
or orl(OUT, IN1, IN2);
nor nor1 (OUT, IN1, IN2 ) ;
xor xl (OUT, IN1, IN2 ) ;
xnor nxl (OUT, IN1, IN2 ) ;
// More than two inputs; 3 input nand gate
nand nal-3 inp (OUT, IN1, IN2, IN3 ) ;
// gate instantiation without instance name
and (OUT, IN1, IN2); // legal gate instantiation
THANKYOU
References
 Verilog HDL A guide to digital design &
synthesis By Samir Palnitkar, Pearson
Second Edition
 Fundamental of digital logic with Verilog
By Stephen Brown, Zvonko Vranesic,
Tata McGraw Hill
THANKYOU
Ad

More Related Content

What's hot (20)

Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
VandanaPagar1
 
Fpga architectures and applications
Fpga architectures and applicationsFpga architectures and applications
Fpga architectures and applications
Sudhanshu Janwadkar
 
verilog
verilogverilog
verilog
Shrikant Vaishnav
 
Programmable Logic Devices Plds
Programmable Logic Devices PldsProgrammable Logic Devices Plds
Programmable Logic Devices Plds
Gaditek
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
Muhammad Uzair Rasheed
 
Verilog Tasks and functions
Verilog Tasks and functionsVerilog Tasks and functions
Verilog Tasks and functions
Vinchipsytm Vlsitraining
 
Hardware description languages
Hardware description languagesHardware description languages
Hardware description languages
Akhila Rahul
 
System On Chip
System On ChipSystem On Chip
System On Chip
anishgoel
 
PAL And PLA ROM
PAL And PLA ROMPAL And PLA ROM
PAL And PLA ROM
RONAK SUTARIYA
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
mubashir farooq
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
Ankur Gupta
 
Structural modelling
Structural modellingStructural modelling
Structural modelling
Revathi Subramaniam
 
Programmable array logic
Programmable array logicProgrammable array logic
Programmable array logic
Gaditek
 
Introduction to EDA Tools
Introduction to EDA ToolsIntroduction to EDA Tools
Introduction to EDA Tools
venkatasuman1983
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
Sudhanshu Janwadkar
 
Cpld fpga
Cpld fpgaCpld fpga
Cpld fpga
anishgoel
 
Overview of digital design with Verilog HDL
Overview of digital design with Verilog HDLOverview of digital design with Verilog HDL
Overview of digital design with Verilog HDL
anand hd
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
Adarsh Patel
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
Mantra VLSI
 
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONSUNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
Dr.YNM
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
VandanaPagar1
 
Fpga architectures and applications
Fpga architectures and applicationsFpga architectures and applications
Fpga architectures and applications
Sudhanshu Janwadkar
 
Programmable Logic Devices Plds
Programmable Logic Devices PldsProgrammable Logic Devices Plds
Programmable Logic Devices Plds
Gaditek
 
Hardware description languages
Hardware description languagesHardware description languages
Hardware description languages
Akhila Rahul
 
System On Chip
System On ChipSystem On Chip
System On Chip
anishgoel
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
Ankur Gupta
 
Programmable array logic
Programmable array logicProgrammable array logic
Programmable array logic
Gaditek
 
Overview of digital design with Verilog HDL
Overview of digital design with Verilog HDLOverview of digital design with Verilog HDL
Overview of digital design with Verilog HDL
anand hd
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
Adarsh Patel
 
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONSUNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
UNIT I- CPLD & FPGA ARCHITECTURE & APPLICATIONS
Dr.YNM
 

Similar to VHDL- gate level modelling (20)

Verilog_ppt.pdf
Verilog_ppt.pdfVerilog_ppt.pdf
Verilog_ppt.pdf
ApurbaDebnath8
 
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Jay Baxi
 
mod-4.pptx
mod-4.pptxmod-4.pptx
mod-4.pptx
MaheshRgk
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
Béo Tú
 
vlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptxvlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptx
iconicyt2
 
Session1
Session1Session1
Session1
omarAbdelrhman2
 
Practical file
Practical filePractical file
Practical file
rajeevkr35
 
gate level modeling
gate level modelinggate level modeling
gate level modeling
VandanaBR2
 
8255_Ppi new
8255_Ppi new8255_Ppi new
8255_Ppi new
Monica Gunjal
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2
alhadi81
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
Malik Tauqir Hasan
 
systemverilog and veriog presentation
systemverilog    and veriog presentationsystemverilog    and veriog presentation
systemverilog and veriog presentation
KhushiV8
 
Verilog
VerilogVerilog
Verilog
Mohamed Rayan
 
Verilog_Overview.pdf
Verilog_Overview.pdfVerilog_Overview.pdf
Verilog_Overview.pdf
QuangHuyDo3
 
verilog_tutorial1.pptx
verilog_tutorial1.pptxverilog_tutorial1.pptx
verilog_tutorial1.pptx
SuyashMishra465104
 
Assic 6th Lecture
Assic 6th LectureAssic 6th Lecture
Assic 6th Lecture
babak danyal
 
VIT_Workshop.ppt
VIT_Workshop.pptVIT_Workshop.ppt
VIT_Workshop.ppt
VINOTHRAJR1
 
Ddhdl 15
Ddhdl 15Ddhdl 15
Ddhdl 15
Akhil Maddineni
 
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvvDSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
REYANSHKUMAR11
 
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Jay Baxi
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
Béo Tú
 
vlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptxvlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptx
iconicyt2
 
Practical file
Practical filePractical file
Practical file
rajeevkr35
 
gate level modeling
gate level modelinggate level modeling
gate level modeling
VandanaBR2
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2
alhadi81
 
systemverilog and veriog presentation
systemverilog    and veriog presentationsystemverilog    and veriog presentation
systemverilog and veriog presentation
KhushiV8
 
Verilog_Overview.pdf
Verilog_Overview.pdfVerilog_Overview.pdf
Verilog_Overview.pdf
QuangHuyDo3
 
VIT_Workshop.ppt
VIT_Workshop.pptVIT_Workshop.ppt
VIT_Workshop.ppt
VINOTHRAJR1
 
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvvDSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
DSD MODULE-2 PPfhufdhhfddgjgfvhfdgjgvfdgbvv
REYANSHKUMAR11
 
Ad

More from VandanaPagar1 (8)

DDUV.pdf
DDUV.pdfDDUV.pdf
DDUV.pdf
VandanaPagar1
 
Cloud-topology.pdf
Cloud-topology.pdfCloud-topology.pdf
Cloud-topology.pdf
VandanaPagar1
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdf
VandanaPagar1
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptx
VandanaPagar1
 
Logic Synthesis
Logic SynthesisLogic Synthesis
Logic Synthesis
VandanaPagar1
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
VandanaPagar1
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
VandanaPagar1
 
Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
VandanaPagar1
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdf
VandanaPagar1
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptx
VandanaPagar1
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
VandanaPagar1
 
Ad

Recently uploaded (20)

Reticular formation_groups_organization_
Reticular formation_groups_organization_Reticular formation_groups_organization_
Reticular formation_groups_organization_
klynct
 
Black hole and its division and categories
Black hole and its division and categoriesBlack hole and its division and categories
Black hole and its division and categories
MSafiullahALawi
 
The Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infectionsThe Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infections
NABIHANAEEM2
 
Pharmacologically active constituents.pdf
Pharmacologically active constituents.pdfPharmacologically active constituents.pdf
Pharmacologically active constituents.pdf
Nistarini College, Purulia (W.B) India
 
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Professional Content Writing's
 
Issues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdfIssues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdf
Angelo Salatino
 
Seismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crustSeismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crust
Sérgio Sacani
 
Introduction to Black Hole and how its formed
Introduction to Black Hole and how its formedIntroduction to Black Hole and how its formed
Introduction to Black Hole and how its formed
MSafiullahALawi
 
Brief Presentation on Garment Washing.pdf
Brief Presentation on Garment Washing.pdfBrief Presentation on Garment Washing.pdf
Brief Presentation on Garment Washing.pdf
BharathKumar556689
 
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptxA CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
ANJALICHANDRASEKARAN
 
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
Sérgio Sacani
 
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.pptSULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
HRUTUJA WAGH
 
Fatigue and its management in aviation medicine
Fatigue and its management in aviation medicineFatigue and its management in aviation medicine
Fatigue and its management in aviation medicine
ImranJewel2
 
Transgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative BiolabsTransgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative Biolabs
Creative-Biolabs
 
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth UniversityEuclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Peter Coles
 
Mycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes FungiMycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes Fungi
SAYANTANMALLICK5
 
Components of the Human Circulatory System.pptx
Components of the Human  Circulatory System.pptxComponents of the Human  Circulatory System.pptx
Components of the Human Circulatory System.pptx
autumnstreaks
 
Water Pollution control using microorganisms
Water Pollution control using microorganismsWater Pollution control using microorganisms
Water Pollution control using microorganisms
gerefam247
 
AP 2024 Unit 1 Updated Chemistry of Life
AP 2024 Unit 1 Updated Chemistry of LifeAP 2024 Unit 1 Updated Chemistry of Life
AP 2024 Unit 1 Updated Chemistry of Life
mseileenlinden
 
An upper limit to the lifetime of stellar remnants from gravitational pair pr...
An upper limit to the lifetime of stellar remnants from gravitational pair pr...An upper limit to the lifetime of stellar remnants from gravitational pair pr...
An upper limit to the lifetime of stellar remnants from gravitational pair pr...
Sérgio Sacani
 
Reticular formation_groups_organization_
Reticular formation_groups_organization_Reticular formation_groups_organization_
Reticular formation_groups_organization_
klynct
 
Black hole and its division and categories
Black hole and its division and categoriesBlack hole and its division and categories
Black hole and its division and categories
MSafiullahALawi
 
The Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infectionsThe Microbial World. Microbiology , Microbes, infections
The Microbial World. Microbiology , Microbes, infections
NABIHANAEEM2
 
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Chemistry of Warfare (Chemical weapons in warfare: An in-depth analysis of cl...
Professional Content Writing's
 
Issues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdfIssues in using AI in academic publishing.pdf
Issues in using AI in academic publishing.pdf
Angelo Salatino
 
Seismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crustSeismic evidence of liquid water at the base of Mars' upper crust
Seismic evidence of liquid water at the base of Mars' upper crust
Sérgio Sacani
 
Introduction to Black Hole and how its formed
Introduction to Black Hole and how its formedIntroduction to Black Hole and how its formed
Introduction to Black Hole and how its formed
MSafiullahALawi
 
Brief Presentation on Garment Washing.pdf
Brief Presentation on Garment Washing.pdfBrief Presentation on Garment Washing.pdf
Brief Presentation on Garment Washing.pdf
BharathKumar556689
 
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptxA CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
A CASE OF MULTINODULAR GOITRE,clinical presentation and management.pptx
ANJALICHANDRASEKARAN
 
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
A Massive Black Hole 0.8kpc from the Host Nucleus Revealed by the Offset Tida...
Sérgio Sacani
 
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.pptSULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
SULPHONAMIDES AND SULFONES Medicinal Chemistry III.ppt
HRUTUJA WAGH
 
Fatigue and its management in aviation medicine
Fatigue and its management in aviation medicineFatigue and its management in aviation medicine
Fatigue and its management in aviation medicine
ImranJewel2
 
Transgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative BiolabsTransgenic Mice in Cancer Research - Creative Biolabs
Transgenic Mice in Cancer Research - Creative Biolabs
Creative-Biolabs
 
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth UniversityEuclid: The Story So far, a Departmental Colloquium at Maynooth University
Euclid: The Story So far, a Departmental Colloquium at Maynooth University
Peter Coles
 
Mycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes FungiMycology:Characteristics of Ascomycetes Fungi
Mycology:Characteristics of Ascomycetes Fungi
SAYANTANMALLICK5
 
Components of the Human Circulatory System.pptx
Components of the Human  Circulatory System.pptxComponents of the Human  Circulatory System.pptx
Components of the Human Circulatory System.pptx
autumnstreaks
 
Water Pollution control using microorganisms
Water Pollution control using microorganismsWater Pollution control using microorganisms
Water Pollution control using microorganisms
gerefam247
 
AP 2024 Unit 1 Updated Chemistry of Life
AP 2024 Unit 1 Updated Chemistry of LifeAP 2024 Unit 1 Updated Chemistry of Life
AP 2024 Unit 1 Updated Chemistry of Life
mseileenlinden
 
An upper limit to the lifetime of stellar remnants from gravitational pair pr...
An upper limit to the lifetime of stellar remnants from gravitational pair pr...An upper limit to the lifetime of stellar remnants from gravitational pair pr...
An upper limit to the lifetime of stellar remnants from gravitational pair pr...
Sérgio Sacani
 

VHDL- gate level modelling

  • 1. Verilog Hardware Description Language Define Modules,Ports, Gate level Modelling -Prof.Vandana Pagar Assistant professor
  • 2. Learning Objectives: • Identify the components of aVerilog module definition, such as module names, port lists, parameters, variable declarations, dataflow statements, behavioral statements, instantiation of other modules, and tasks or functions.  Understand how to define the port list for a module and declare it inVerilog.  Describe the port connection rules in a module instantiation.  Understand how to connect ports to external signals, by ordered list, and by name.
  • 3. Learning Objectives:  Identify logic gate primitives provided in Verilog.  Understand instantiation of gates, gate symbols and truth tables for and/or and buf/not type gates.  Understand how to construct aVerilog description from the logic diagram of the circuit.  Describe rise, fall, and turn-off delays in the gate-level design.  Explain min, max, and type delays in the gate- level design.
  • 4. Modules and Ports  A module inVerilog consists of distinct parts, as shown in Figure.
  • 5. Modules and Ports  A module definition always begins with the keyword module. ➢ The module name, ➢ port list, ➢ port declarations, and ➢ optional parameters must come first in a module definition.  The five components within a module are – variable declarations, dataflow statements, instantiation of lower modules, behavioral blocks, and tasks or functions.  These components can be in any order and at any place in the module definition.  The endmodule statement must always come last in a module definition.  All components except module, module name, and endmodule are optional and can be mixed and matched as per design needs.
  • 6. Example of an SR latch:
  • 7. This example illustrates the different components of a module module SR-latch (Q, Qbar, Sbar, Rbar); output Q, Qbar; //Port declarations input Sbar, Rbar; // Instantiate lower-level modules nand nl (Q, Sbar, Qbar) ; nand n2 ( Qbar , Rbar , Q) ; endmodule
  • 8. moduleTop; wire q, qbar; reg set, reset; // Instantiate lower-level modules // In this case, instantiate SR-latch // Feed inverted set and reset signals to the SR latch SR-latch ml(q, qbar, -set, -reset); // Behavioral block, initial initial begin $monitor($time, " set = %b, reset= %b, q= %bnU,set,reset,q); set = 0; reset = 0; #5 reset = 1; #5 reset = 0; #5 set = 1; end endmodule
  • 9. Ports  Ports provide the interface by which a module can communicate with environment.  For example, the input/output pins of an IC chip are its ports.  The environment can interact with the module only through its ports.  The internals of the module are not visible to the environment.  The internals of the module can be changed without affecting the environment as long as the interface is not modified.  Ports are also referred to as terminals.
  • 10. Ports:  module definition contains an optional list of ports.  If the module does not exchange any signals with the environment, there are no ports in the list. Ex. Consider a 4-bit full adder that is instantiated inside a top-level module Top. module fulladd4 (sum, c-out, a, b, c-in); //module with a list of ports moduleTop; // No list of ports, top-level module in simulation
  • 11. Ports  Notice that in the above figure, the module Top is a top-level module.  The module fulladd4 is instantiated below Top. The module fulladd4 takes input on ports a, b, and c-in and produces an output on ports sum and c-out. • Thus, module fulladd4 performs an addition for its environment. • The module Top is a top-level module in the simulation and does not need to pass signals to or receive signals from the environment. Thus, it does not have a list of ports
  • 12. Port Declaration  All ports in the list of ports must be declared in the module. Ports can be declared as follows:  Each port in the port list is defined as input, output, or inout, based on the direction of the port signal. Thus, for the example of the fulladd4 in Example.
  • 13. module fulladd4(sum, c-out, a, b, c-in); //Begin port declarations section output [3 : 0] sum; output c-cout; input [3:0] a, b; input c-in; //End port declarations section ... <module internals> ... endmodule
  • 14. 1.Gate level Modeling- Gate types, Gate delays 2.Data flow modeling- Continuous Assignments, Delays expression, operators & operands 3.Behavioral Modeling- Structured Procedures, Procedural Assignments,Timing Controls, Conditional statements, Multiway Branching, Loops
  • 15. 1.Gate level Modeling  At gate level, the circuit is described in terms of gates (e.g., and, nand).  Hardware design at this level is intuitive for a user with a basic knowledge of digital logic design because it is possible to see a one-to- one correspondence between the logic circuit diagram and theVerilog description.  Hence, we chose to start with gate-level modeling and move to higher levels of abstraction in the succeeding lectures.
  • 16. 1.Gate level Modeling  GateTypes  A logic circuit can be designed by use of logic gates.Verilog supports basic logic gates as predefined primitives.  These primitives are instantiated like modules except that they are predefined in Verilog and do not need a module definition.  All logic circuits can be designed by using basic gates.  There are two classes of basic gates: and l or gates and buf l not gates
  • 17. And/Or Gates  and/or gates have one scalar output and multiple scalar inputs.  The first terminal in the list of gate terminals is an output and the other terminals are inputs.  The output of a gate is evaluated as soon as one of the inputs changes.
  • 22. Buf/Not Gates  Buf / not gates have one scalar input and one or more scalar outputs. Two basic buf l not gate primitives are provided inVerilog.
  • 23. // basic gate instantiations. buf bl(OUT1, IN); not nl(OUT1, IN); // More than two outputs buf bl_2out(OUTl, OUT2, IN); // gate instantiation without instance name not (OUT1, IN); // legal gate instantiation
  • 26. .
  • 27.  These gates are used when a signal is to be driven only when the control signal is asserted. Such a situation is applicable when multiple drivers drive the signal.
  • 28. Example wire OUT, IN1, IN2; // basic gate instantiations. and a1(OUT, IN1, IN2); nand nal (OUT, IN1, IN2 ) ; or orl(OUT, IN1, IN2); nor nor1 (OUT, IN1, IN2 ) ; xor xl (OUT, IN1, IN2 ) ; xnor nxl (OUT, IN1, IN2 ) ; // More than two inputs; 3 input nand gate nand nal-3 inp (OUT, IN1, IN2, IN3 ) ; // gate instantiation without instance name and (OUT, IN1, IN2); // legal gate instantiation
  • 30. References  Verilog HDL A guide to digital design & synthesis By Samir Palnitkar, Pearson Second Edition  Fundamental of digital logic with Verilog By Stephen Brown, Zvonko Vranesic, Tata McGraw Hill
  翻译: