SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
1|Page

Notes: Verilog Part 2
4 CHAPTER 4:
4.1 MODULES:



Modules are the basic building blocks of any Verilog code.
A Module in Verilog consists of different parts.
Module Name,
Port List, Port Declarations,
Parameters (Optional),
Declaration of Variables
Instantiation of lower level modules

Data Flow Statements
always and initial blocks.

Tasks and Functions.
endmodule statement.










A Module definition always begins with the keyword module. It should
be duly noted that there must not be any changes in the sequence of
parts mentioned above.
Port List and Port Declarations are present only if the module has any
ports to interact with.
All components except the module, module name and endmodule are
optional.
The five components within the module viz. Declaration of Varibales,
Data Flow Statements, Instantiation of lower level modules, always and
initial blocks and Tasks and Functions can appear in any order.
Verilog allows multiple modules to be defined in any order in a file.
However, nesting of modules (defining one module in another) is
prohibited.

4.2 EXAMPLE: SR LATCH


The SR Latch has S and R as the input ports and Q and Qbar as the
output ports.
The stimulus and the design can be modelled as shown in SR_Latch



Ports provide the interface by which a module can communicate with its
environment. The environment can interact with the module only with
the port.
They are also referred to as terminals.

4.3 PORTS



Notes: Verilog Part-2

Prepared By: Jay Baxi
2|Page

4.4 LIST OF PORTS:






A module definition can optionally have a list of ports. If module does
not need to exchange any signals with the environment, there are no
ports in the list.
In case of a top level module TOP, which has a full adder module
4fulladd. The module 4fulladd takes input a, b, c_in as inputs and
produces sum and c_out as outputs.
The top level module does not need to pass or receive signals. Thus it
does not have a list of ports.

4.5 PORT DECLARATION







All ports in the list of ports must be declared in the module.
They can be input (input port), output (output port) or inout port
(bidirectional port).
By default these ports are declared as wire.
However, if output holds their value, they must be declared as reg.
For example, in D_FF, when q was supposed to retain its value after a
clock edge.
Ports of input and inout cannot be declared as reg because reg variables
are supposed to store values and input ports should not store values but
simply reflect the changes in the external signals they are connected to.
(ERROR)

Internal
External
Inputs
net
reg/net
Outputs
reg/net
reg
Inouts
net
net
 Width Matching: It is legal to connect internal and external items of
different sizes when making inter-module port connections. A warning is
usually displayed that widths do not match.
 Unconnected ports: Verilog allows the ports to remain unconnected. For
ports that are used only for debugging, it can be remained unconnected.
The module, in this case can be instantiated by
4fulladd(SUM, , A, B, C_in) // port C_out is unconnected

4.6 CONNECTING PORTS TO EXTERNAL SIGNALS


Notes: Verilog Part-2

There are two methods to connect ports to external signals
1.) Connecting Ports by ordered lists:
The signals to be connected must appear in the module instantiation in the
same order as the ports in the port list in the module definition
2.) Connecting Ports by name:
For large modules, it is not feasible to remember the order of each port.
Hence, in those cases, Verilog provides connecting external signals to ports
by the port names.

Prepared By: Jay Baxi
3|Page

5 CHAPTER 5:
5.1 TRUTH TABLES OF LOGIC GATES
5.1.1

5.1.2

5.1.3

5.1.4

5.1.5

AND Gate
AND
0
1
X
Z

0
0
0
0
0

1
0
1
X
X

X
0
X
X
X

Z
0
X
X
X

OR Gate
OR
0
1
X
Z

0
0
1
X
X

1
1
1
1
1

X
X
1
X
X

Z
X
1
X
X

NAND Gate
NAND
0
1
X
Z

0
1
1
1
1

1
1
0
X
X

X
1
X
X
X

Z
1
X
X
X

NOR Gate
NOR
0
1
X
Z

0
1
0
X
X

1
0
0
0
0

X
X
0
X
X

Z
X
0
X
X

XOR Gate
XOR
0
1
X
Z

0
0
1
X
X

1
1
0
X
X

X
X
X
X
X

Z
X
X
X
X

Notes: Verilog Part-2

Prepared By: Jay Baxi
4|Page
5.1.6

5.1.7

XNOR Gate
XNOR
0
1
X
Z

0
1
0
X
X

1
0
1
X
X

Z
X
X
X
X

BUF Gate and NOT Gate
In
0
1
X
Z

5.1.8

X
X
X
X
X

BUF
0
1
X
X

NOT
1
0
X
X

BUFif and NOTif



The BUFif and NOTif are the gates that propagate only if their control
signal is asserted. They propagate Z if the signal is deasserted.
These signals are used when a signal is driven only when the control
signal is asserted, this is a case when multiple drivers drive the signal
//Instantiation of gates
bufif1 b1 (out, in, ctrl);
bufif0 b0 (out, in, ctrl);
notif1 n1(out, in, ctrl);
notif0 n0(out, in, ctrl);



The Truth Tables of these gates are given as follows

Bufif1
0
1
X
Z

0
Z
Z
Z
Z

1
0
1
X
X

X
L
H
X
X

Z
L
H
X
X

Bufif0
0
1
X
Z

0
0
1
X
Z

1
Z
Z
Z
Z

X
L
H
X
X

Z
L
H
X
X

Notif1
0
1
X
Z

0
Z
Z
Z
Z

1
1
0
X
X

X
H
L
X
X

Z
H
L
X
X

Notes: Verilog Part-2

Prepared By: Jay Baxi
5|Page
Notif0
0
1
X
Z
5.1.9

0
1
0
X
X

Array of Instances


1
Z
Z
Z
Z

X
H
L
X
X

Z
H
L
X
X

For situations when there are more than one instances required, Verilog
allows us to create array of instances where each instance differs from
other just by the index.

5.1.10 Examples:
5.1.10.1 Gate Level Multiplexer
 We will design a 4-to-1 Mux with 2 select signals. Using the basic logic gates the logic
diagram of a 4-to-1 Mux is given as follows

 The Verilog modules for the same are given in Multiplexer
5.1.10.2 4-bit Ripple Carry Adder
 A 4-bit full adder can be created from four 1-bit FA. The Verilog modules for the same is
given in Full Adder.

5.2 GATE DELAYS




Rise delay is when a delay is experienced while transition from 0, X or Z to 1.
Fall delay is when a delay is experienced while transition from 1, X or Z to 0.
Turn off delay is associated with a gate output transition to high impedance
(Z) value from another value.

Notes: Verilog Part-2

Prepared By: Jay Baxi
6|Page




Notes: Verilog Part-2

Min value: The minimum value of delay, the designer expects to have.
Max value: The maximum value of delay, the designer expects to have.
Typ value: The typical value of delay, the designer expects to have.

Prepared By: Jay Baxi

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Notes part5
Notes part5Notes part5
Notes part5
 
C programming session7
C programming  session7C programming  session7
C programming session7
 
PM1
PM1PM1
PM1
 
C programming session8
C programming  session8C programming  session8
C programming session8
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
C programming session6
C programming  session6C programming  session6
C programming session6
 
Hd6
Hd6Hd6
Hd6
 
Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3
 
FPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix NepalFPGA training session generic package and funtions of VHDL by Digitronix Nepal
FPGA training session generic package and funtions of VHDL by Digitronix Nepal
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
C programming session10
C programming  session10C programming  session10
C programming session10
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
 
Control structures ii
Control structures ii Control structures ii
Control structures ii
 
Quiz 9
Quiz 9Quiz 9
Quiz 9
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)
 
Ch10 Program Organization
Ch10 Program OrganizationCh10 Program Organization
Ch10 Program Organization
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Ch4 Expressions
Ch4 ExpressionsCh4 Expressions
Ch4 Expressions
 

Destacado

Radiation Hardening by Design
Radiation Hardening by DesignRadiation Hardening by Design
Radiation Hardening by DesignJay Baxi
 
Functions and tasks in verilog
Functions and tasks in verilogFunctions and tasks in verilog
Functions and tasks in verilogNallapati Anindra
 
Seminar: Fabrication and Characteristics of CMOS
Seminar: Fabrication and Characteristics of CMOSSeminar: Fabrication and Characteristics of CMOS
Seminar: Fabrication and Characteristics of CMOSJay Baxi
 
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLDesigning of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLJay Baxi
 
Web design and development cs506 handouts
Web design and development   cs506 handoutsWeb design and development   cs506 handouts
Web design and development cs506 handoutsSohaib Danish
 
4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-IntroductionDr. Shivananda Koteshwar
 
Fundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - GodseFundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - GodseHammam
 
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...Hanumantha Raju
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. shobhan pujari
 
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...BMS Institute of Technology and Management
 
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...BMS Institute of Technology and Management
 
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...Arunkumar Gowdru
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)Sohaib Danish
 
Embedded systems class notes
Embedded systems  class notes Embedded systems  class notes
Embedded systems class notes Dr.YNM
 

Destacado (15)

Radiation Hardening by Design
Radiation Hardening by DesignRadiation Hardening by Design
Radiation Hardening by Design
 
Functions and tasks in verilog
Functions and tasks in verilogFunctions and tasks in verilog
Functions and tasks in verilog
 
Seminar: Fabrication and Characteristics of CMOS
Seminar: Fabrication and Characteristics of CMOSSeminar: Fabrication and Characteristics of CMOS
Seminar: Fabrication and Characteristics of CMOS
 
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLDesigning of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDL
 
First Year Basic Electronics Notes VTU Syllabus 2014 Scheme
First Year Basic Electronics Notes VTU Syllabus 2014 SchemeFirst Year Basic Electronics Notes VTU Syllabus 2014 Scheme
First Year Basic Electronics Notes VTU Syllabus 2014 Scheme
 
Web design and development cs506 handouts
Web design and development   cs506 handoutsWeb design and development   cs506 handouts
Web design and development cs506 handouts
 
4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction4Sem VTU-HDL Programming Notes-Unit1-Introduction
4Sem VTU-HDL Programming Notes-Unit1-Introduction
 
Fundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - GodseFundamentals of HDL (first 4 chapters only) - Godse
Fundamentals of HDL (first 4 chapters only) - Godse
 
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...
MOSFETs (10EC63) Notes for Electronics & Communication Engineering Students o...
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits.
 
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...
Microelectronic Circuits Notes (10EC63) by Dr. M. C. Hanumantharaju of BMS In...
 
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...
Microelectronic Circuits (10EC63) Notes for Visvesvaraya Technological Univer...
 
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...
Embedded System Design Notes written by Arun Kumar G, Associate Professor, De...
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
 
Embedded systems class notes
Embedded systems  class notes Embedded systems  class notes
Embedded systems class notes
 

Similar a Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level Modeling)

Modules and ports in Verilog HDL
Modules and ports in Verilog HDLModules and ports in Verilog HDL
Modules and ports in Verilog HDLanand hd
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdfankit482504
 
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.pptxiconicyt2
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderMalik Tauqir Hasan
 
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Alok Singh
 
Gate level design -For beginners
Gate level design -For beginnersGate level design -For beginners
Gate level design -For beginnersDr.YNM
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDLYaser Kalifa
 
Ccnp3 lab 3_5_en (hacer)
Ccnp3 lab 3_5_en (hacer)Ccnp3 lab 3_5_en (hacer)
Ccnp3 lab 3_5_en (hacer)Omar Herrera
 
Practical file
Practical filePractical file
Practical filerajeevkr35
 
CSCI 2121- Computer Organization and Assembly Language Labor.docx
CSCI 2121- Computer Organization and Assembly Language Labor.docxCSCI 2121- Computer Organization and Assembly Language Labor.docx
CSCI 2121- Computer Organization and Assembly Language Labor.docxannettsparrow
 
Kroening et al, v2c a verilog to c translator
Kroening et al, v2c   a verilog to c translatorKroening et al, v2c   a verilog to c translator
Kroening et al, v2c a verilog to c translatorsce,bhopal
 

Similar a Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level Modeling) (20)

Modules and ports in Verilog HDL
Modules and ports in Verilog HDLModules and ports in Verilog HDL
Modules and ports in Verilog HDL
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
 
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
 
Verilog
VerilogVerilog
Verilog
 
Verilog_ppt.pdf
Verilog_ppt.pdfVerilog_ppt.pdf
Verilog_ppt.pdf
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
 
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)
 
VLSI & E-CAD Lab Manual
VLSI & E-CAD Lab ManualVLSI & E-CAD Lab Manual
VLSI & E-CAD Lab Manual
 
e CAD lab manual
e CAD lab manuale CAD lab manual
e CAD lab manual
 
Gate level design -For beginners
Gate level design -For beginnersGate level design -For beginners
Gate level design -For beginners
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Ccnp labs
Ccnp labsCcnp labs
Ccnp labs
 
verilog
verilogverilog
verilog
 
Ccnp3 lab 3_5_en (hacer)
Ccnp3 lab 3_5_en (hacer)Ccnp3 lab 3_5_en (hacer)
Ccnp3 lab 3_5_en (hacer)
 
Practical file
Practical filePractical file
Practical file
 
CSCI 2121- Computer Organization and Assembly Language Labor.docx
CSCI 2121- Computer Organization and Assembly Language Labor.docxCSCI 2121- Computer Organization and Assembly Language Labor.docx
CSCI 2121- Computer Organization and Assembly Language Labor.docx
 
Kroening et al, v2c a verilog to c translator
Kroening et al, v2c   a verilog to c translatorKroening et al, v2c   a verilog to c translator
Kroening et al, v2c a verilog to c translator
 
Assic 6th Lecture
Assic 6th LectureAssic 6th Lecture
Assic 6th Lecture
 

Último

Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Último (20)

Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level Modeling)

  • 1. 1|Page Notes: Verilog Part 2 4 CHAPTER 4: 4.1 MODULES:   Modules are the basic building blocks of any Verilog code. A Module in Verilog consists of different parts. Module Name, Port List, Port Declarations, Parameters (Optional), Declaration of Variables Instantiation of lower level modules Data Flow Statements always and initial blocks. Tasks and Functions. endmodule statement.       A Module definition always begins with the keyword module. It should be duly noted that there must not be any changes in the sequence of parts mentioned above. Port List and Port Declarations are present only if the module has any ports to interact with. All components except the module, module name and endmodule are optional. The five components within the module viz. Declaration of Varibales, Data Flow Statements, Instantiation of lower level modules, always and initial blocks and Tasks and Functions can appear in any order. Verilog allows multiple modules to be defined in any order in a file. However, nesting of modules (defining one module in another) is prohibited. 4.2 EXAMPLE: SR LATCH  The SR Latch has S and R as the input ports and Q and Qbar as the output ports. The stimulus and the design can be modelled as shown in SR_Latch  Ports provide the interface by which a module can communicate with its environment. The environment can interact with the module only with the port. They are also referred to as terminals. 4.3 PORTS  Notes: Verilog Part-2 Prepared By: Jay Baxi
  • 2. 2|Page 4.4 LIST OF PORTS:    A module definition can optionally have a list of ports. If module does not need to exchange any signals with the environment, there are no ports in the list. In case of a top level module TOP, which has a full adder module 4fulladd. The module 4fulladd takes input a, b, c_in as inputs and produces sum and c_out as outputs. The top level module does not need to pass or receive signals. Thus it does not have a list of ports. 4.5 PORT DECLARATION       All ports in the list of ports must be declared in the module. They can be input (input port), output (output port) or inout port (bidirectional port). By default these ports are declared as wire. However, if output holds their value, they must be declared as reg. For example, in D_FF, when q was supposed to retain its value after a clock edge. Ports of input and inout cannot be declared as reg because reg variables are supposed to store values and input ports should not store values but simply reflect the changes in the external signals they are connected to. (ERROR) Internal External Inputs net reg/net Outputs reg/net reg Inouts net net  Width Matching: It is legal to connect internal and external items of different sizes when making inter-module port connections. A warning is usually displayed that widths do not match.  Unconnected ports: Verilog allows the ports to remain unconnected. For ports that are used only for debugging, it can be remained unconnected. The module, in this case can be instantiated by 4fulladd(SUM, , A, B, C_in) // port C_out is unconnected 4.6 CONNECTING PORTS TO EXTERNAL SIGNALS  Notes: Verilog Part-2 There are two methods to connect ports to external signals 1.) Connecting Ports by ordered lists: The signals to be connected must appear in the module instantiation in the same order as the ports in the port list in the module definition 2.) Connecting Ports by name: For large modules, it is not feasible to remember the order of each port. Hence, in those cases, Verilog provides connecting external signals to ports by the port names. Prepared By: Jay Baxi
  • 3. 3|Page 5 CHAPTER 5: 5.1 TRUTH TABLES OF LOGIC GATES 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 AND Gate AND 0 1 X Z 0 0 0 0 0 1 0 1 X X X 0 X X X Z 0 X X X OR Gate OR 0 1 X Z 0 0 1 X X 1 1 1 1 1 X X 1 X X Z X 1 X X NAND Gate NAND 0 1 X Z 0 1 1 1 1 1 1 0 X X X 1 X X X Z 1 X X X NOR Gate NOR 0 1 X Z 0 1 0 X X 1 0 0 0 0 X X 0 X X Z X 0 X X XOR Gate XOR 0 1 X Z 0 0 1 X X 1 1 0 X X X X X X X Z X X X X Notes: Verilog Part-2 Prepared By: Jay Baxi
  • 4. 4|Page 5.1.6 5.1.7 XNOR Gate XNOR 0 1 X Z 0 1 0 X X 1 0 1 X X Z X X X X BUF Gate and NOT Gate In 0 1 X Z 5.1.8 X X X X X BUF 0 1 X X NOT 1 0 X X BUFif and NOTif   The BUFif and NOTif are the gates that propagate only if their control signal is asserted. They propagate Z if the signal is deasserted. These signals are used when a signal is driven only when the control signal is asserted, this is a case when multiple drivers drive the signal //Instantiation of gates bufif1 b1 (out, in, ctrl); bufif0 b0 (out, in, ctrl); notif1 n1(out, in, ctrl); notif0 n0(out, in, ctrl);  The Truth Tables of these gates are given as follows Bufif1 0 1 X Z 0 Z Z Z Z 1 0 1 X X X L H X X Z L H X X Bufif0 0 1 X Z 0 0 1 X Z 1 Z Z Z Z X L H X X Z L H X X Notif1 0 1 X Z 0 Z Z Z Z 1 1 0 X X X H L X X Z H L X X Notes: Verilog Part-2 Prepared By: Jay Baxi
  • 5. 5|Page Notif0 0 1 X Z 5.1.9 0 1 0 X X Array of Instances  1 Z Z Z Z X H L X X Z H L X X For situations when there are more than one instances required, Verilog allows us to create array of instances where each instance differs from other just by the index. 5.1.10 Examples: 5.1.10.1 Gate Level Multiplexer  We will design a 4-to-1 Mux with 2 select signals. Using the basic logic gates the logic diagram of a 4-to-1 Mux is given as follows  The Verilog modules for the same are given in Multiplexer 5.1.10.2 4-bit Ripple Carry Adder  A 4-bit full adder can be created from four 1-bit FA. The Verilog modules for the same is given in Full Adder. 5.2 GATE DELAYS    Rise delay is when a delay is experienced while transition from 0, X or Z to 1. Fall delay is when a delay is experienced while transition from 1, X or Z to 0. Turn off delay is associated with a gate output transition to high impedance (Z) value from another value. Notes: Verilog Part-2 Prepared By: Jay Baxi
  • 6. 6|Page    Notes: Verilog Part-2 Min value: The minimum value of delay, the designer expects to have. Max value: The maximum value of delay, the designer expects to have. Typ value: The typical value of delay, the designer expects to have. Prepared By: Jay Baxi