SlideShare una empresa de Scribd logo
1 de 21
Task and Functions
VinChip Systems
(A Design and Verification Company)
Chennai
2005 Verilog HDL 2
Goal of presentation…
 Reusing code
 Tasks and Functions
2005 Verilog HDL 3
Introduction
 Procedures/Subroutines/Functions in SW
programming languages
 The same functionality, in different places
 Verilog equivalence:
 Tasks and Functions
 Used in behavioral modeling
2005 Verilog HDL 4
Contents
 Functions
 Tasks
 Differences between tasks and functions
Tasks and Functions
Functions
2005 Verilog HDL 6
Functions
 Keyword: function, endfunction
 Can be used if the procedure
 does not have any timing control constructs
 returns exactly a single value
 has at least one input argument
2005 Verilog HDL 7
Functions (cont’d)
 Function Declaration and Invocation
 Declaration syntax:
function <range_or_type> <func_name>;
<input declaration(s)>
<variable_declaration(s)>
begin // if more than one statement needed
<statements>
end // if begin used
endfunction
2005 Verilog HDL 8
Functions (cont’d)
 Function Declaration and Invocation
 Invocation syntax:
<func_name> (<argument(s)>);
2005 Verilog HDL 9
Functions (cont’d)
 Semantics
 much like function in Pascal
 An internal implicit reg is declared inside the function
with the same name
 The return value is specified by setting that implicit reg
2005 Verilog HDL 10
Function Examples
Parity Generator
module parity;
reg [31:0] addr;
reg parity;
initial begin
…
end
always @(addr)
begin
parity = calc_parity(addr);
$display("Parity calculated = %b",
calc_parity(addr) );
end
function calc_parity;
input [31:0] address;
begin
calc_parity = ^address;
end
endfunction
endmodule
Tasks and Functions
Tasks
2005 Verilog HDL 12
Tasks
 Keywords: task, endtask
 Must be used if the procedure has
 any timing control constructs
 zero or more than one output arguments
 May be on or more input arguments
2005 Verilog HDL 13
Tasks (cont’d)
 Task declaration and invocation
 Declaration syntax
task <task_name>;
<I/O declarations>
<variable and event declarations>
begin // if more than one statement needed
<statement(s)>
end // if begin used!
endtask
2005 Verilog HDL 14
Tasks (cont’d)
 Task declaration and invocation
 Task invocation syntax
<task_name>;
<task_name> (<arguments>);
 input and inout arguments are passed into the task
 output and inout arguments are passed back to the
invoking statement when task is completed
2005 Verilog HDL 15
Tasks (cont’d)
 I/O declaration in modules vs. tasks
 Both used keywords: input, output, inout
 In modules, represent ports
 connect to external signals
 In tasks, represent arguments
 pass values to and from the task
2005 Verilog HDL 16
module operation;
parameter delay = 10;
reg [15:0] A, B;
reg [15:0] AB_AND, AB_OR, AB_XOR;
initial
$monitor( …);
initial
begin
…
end
always @(A or B)
begin
bitwise_oper(AB_AND, AB_OR,
AB_XOR, A, B);
end
task bitwise_oper;
output [15:0]
ab_and, ab_or,
ab_xor;
input [15:0] a, b;
begin
#delay ab_and = a & b;
ab_or = a | b;
ab_xor = a ^ b;
end
endtask
endmodule
Task Examples
Use of input and output arguments
Tasks and Functions
Differences between
Tasks and Functions
2005 Verilog HDL 18
Differences between...
 Functions
 Can enable (call) just
another function (not task)
 Execute in 0 simulation
time
 No timing control
statements allowed
 At lease one input
 Return only a single value
Tasks
Can enable other tasks and
functions
May execute in non-zero
simulation time
May contain any timing
control statements
May have arbitrary
input, output, or inout
Do not return any value
2005 Verilog HDL 19
Differences between… (cont’d)
 Both
 are defined in a module
 are local to the module
 can have local variables (registers, but not nets) and events
 contain only behavioral statements
 do not contain initial or always statements
 are called from initial or always statements or other tasks or
functions
2005 Verilog HDL 20
Differences between… (cont’d)
 Tasks can be used for common Verilog code
 Function are used when the common code
 is purely combinational
 executes in 0 simulation time
 provides exactly one output
 Functions are typically used for conversions and
commonly used calculations
2005 Verilog HDL 21

Más contenido relacionado

La actualidad más candente

Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
Nirav Desai
 

La actualidad más candente (20)

Verilog
VerilogVerilog
Verilog
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
 
Synchronous and asynchronous reset
Synchronous and asynchronous resetSynchronous and asynchronous reset
Synchronous and asynchronous reset
 
Verilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONSVerilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONS
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
AHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxAHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptx
 
AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
 
Divide by N clock
Divide by N clockDivide by N clock
Divide by N clock
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology Tutorial
 
Actel fpga
Actel fpgaActel fpga
Actel fpga
 
System verilog coverage
System verilog coverageSystem verilog coverage
System verilog coverage
 
Carry look ahead adder
Carry look ahead adderCarry look ahead adder
Carry look ahead adder
 
carry look ahead adder
carry look ahead addercarry look ahead adder
carry look ahead adder
 
UNIT-III-DIGITAL SYSTEM DESIGN
UNIT-III-DIGITAL SYSTEM DESIGNUNIT-III-DIGITAL SYSTEM DESIGN
UNIT-III-DIGITAL SYSTEM DESIGN
 
dual-port RAM (DPRAM)
dual-port RAM (DPRAM)dual-port RAM (DPRAM)
dual-port RAM (DPRAM)
 

Destacado

Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
Malik Tauqir Hasan
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
Béo Tú
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
alphankg1
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
aviban
 
Design of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDLDesign of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDL
Vishesh Thakur
 

Destacado (20)

Notes: Verilog Part 5 - Tasks and Functions
Notes: Verilog Part 5 - Tasks and FunctionsNotes: Verilog Part 5 - Tasks and Functions
Notes: Verilog Part 5 - Tasks and Functions
 
AMBA 2.0 REPORT
AMBA 2.0 REPORTAMBA 2.0 REPORT
AMBA 2.0 REPORT
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
 
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...
 
Easy Learn to Verilog HDL
Easy Learn to Verilog HDLEasy Learn to Verilog HDL
Easy Learn to Verilog HDL
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
 
FPGA workshop
FPGA workshopFPGA workshop
FPGA workshop
 
Crash course in verilog
Crash course in verilogCrash course in verilog
Crash course in verilog
 
Calculator design with lcd using fpga
Calculator design with lcd using fpgaCalculator design with lcd using fpga
Calculator design with lcd using fpga
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
Four elevator controller
Four elevator controllerFour elevator controller
Four elevator controller
 
Controller Implementation in Verilog
Controller Implementation in VerilogController Implementation in Verilog
Controller Implementation in Verilog
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilog
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
 
Design of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDLDesign of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDL
 

Similar a Verilog Tasks and functions

Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
Abhiraj Bohra
 

Similar a Verilog Tasks and functions (20)

Assic 13th Lecture
Assic 13th LectureAssic 13th Lecture
Assic 13th Lecture
 
An Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl pprAn Introductory course on Verilog HDL-Verilog hdl ppr
An Introductory course on Verilog HDL-Verilog hdl ppr
 
Fpga 13-task-and-functions
Fpga 13-task-and-functionsFpga 13-task-and-functions
Fpga 13-task-and-functions
 
PLSQL.pptx
PLSQL.pptxPLSQL.pptx
PLSQL.pptx
 
1
11
1
 
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
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 
Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++
 
4. programing 101
4. programing 1014. programing 101
4. programing 101
 
plsql.ppt
plsql.pptplsql.ppt
plsql.ppt
 
Control Structures: Part 2
Control Structures: Part 2Control Structures: Part 2
Control Structures: Part 2
 
Basics of Verilog.ppt
Basics of Verilog.pptBasics of Verilog.ppt
Basics of Verilog.ppt
 
Verilog Hardware Description Language.ppt
Verilog Hardware Description Language.pptVerilog Hardware Description Language.ppt
Verilog Hardware Description Language.ppt
 
Procedure and Functions in pl/sql
Procedure and Functions in pl/sqlProcedure and Functions in pl/sql
Procedure and Functions in pl/sql
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
 
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)
 

Más de Vinchipsytm Vlsitraining (12)

VLSI_ASIC_Training_Summer_Offer
VLSI_ASIC_Training_Summer_OfferVLSI_ASIC_Training_Summer_Offer
VLSI_ASIC_Training_Summer_Offer
 
Hard ip based SoC design
Hard ip based SoC designHard ip based SoC design
Hard ip based SoC design
 
Optimizing for low power in embedded mcu designs
Optimizing for low power in embedded mcu designsOptimizing for low power in embedded mcu designs
Optimizing for low power in embedded mcu designs
 
Coding style for good synthesis
Coding style for good synthesisCoding style for good synthesis
Coding style for good synthesis
 
system verilog
system verilogsystem verilog
system verilog
 
Chip packaging technology
Chip packaging technologyChip packaging technology
Chip packaging technology
 
USB 2.0
USB 2.0USB 2.0
USB 2.0
 
SOC design
SOC design SOC design
SOC design
 
Axi
AxiAxi
Axi
 
Usb 2
Usb 2Usb 2
Usb 2
 
Low power vlsi design
Low power vlsi designLow power vlsi design
Low power vlsi design
 
Verification strategies
Verification strategiesVerification strategies
Verification strategies
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

Verilog Tasks and functions

  • 1. Task and Functions VinChip Systems (A Design and Verification Company) Chennai
  • 2. 2005 Verilog HDL 2 Goal of presentation…  Reusing code  Tasks and Functions
  • 3. 2005 Verilog HDL 3 Introduction  Procedures/Subroutines/Functions in SW programming languages  The same functionality, in different places  Verilog equivalence:  Tasks and Functions  Used in behavioral modeling
  • 4. 2005 Verilog HDL 4 Contents  Functions  Tasks  Differences between tasks and functions
  • 6. 2005 Verilog HDL 6 Functions  Keyword: function, endfunction  Can be used if the procedure  does not have any timing control constructs  returns exactly a single value  has at least one input argument
  • 7. 2005 Verilog HDL 7 Functions (cont’d)  Function Declaration and Invocation  Declaration syntax: function <range_or_type> <func_name>; <input declaration(s)> <variable_declaration(s)> begin // if more than one statement needed <statements> end // if begin used endfunction
  • 8. 2005 Verilog HDL 8 Functions (cont’d)  Function Declaration and Invocation  Invocation syntax: <func_name> (<argument(s)>);
  • 9. 2005 Verilog HDL 9 Functions (cont’d)  Semantics  much like function in Pascal  An internal implicit reg is declared inside the function with the same name  The return value is specified by setting that implicit reg
  • 10. 2005 Verilog HDL 10 Function Examples Parity Generator module parity; reg [31:0] addr; reg parity; initial begin … end always @(addr) begin parity = calc_parity(addr); $display("Parity calculated = %b", calc_parity(addr) ); end function calc_parity; input [31:0] address; begin calc_parity = ^address; end endfunction endmodule
  • 12. 2005 Verilog HDL 12 Tasks  Keywords: task, endtask  Must be used if the procedure has  any timing control constructs  zero or more than one output arguments  May be on or more input arguments
  • 13. 2005 Verilog HDL 13 Tasks (cont’d)  Task declaration and invocation  Declaration syntax task <task_name>; <I/O declarations> <variable and event declarations> begin // if more than one statement needed <statement(s)> end // if begin used! endtask
  • 14. 2005 Verilog HDL 14 Tasks (cont’d)  Task declaration and invocation  Task invocation syntax <task_name>; <task_name> (<arguments>);  input and inout arguments are passed into the task  output and inout arguments are passed back to the invoking statement when task is completed
  • 15. 2005 Verilog HDL 15 Tasks (cont’d)  I/O declaration in modules vs. tasks  Both used keywords: input, output, inout  In modules, represent ports  connect to external signals  In tasks, represent arguments  pass values to and from the task
  • 16. 2005 Verilog HDL 16 module operation; parameter delay = 10; reg [15:0] A, B; reg [15:0] AB_AND, AB_OR, AB_XOR; initial $monitor( …); initial begin … end always @(A or B) begin bitwise_oper(AB_AND, AB_OR, AB_XOR, A, B); end task bitwise_oper; output [15:0] ab_and, ab_or, ab_xor; input [15:0] a, b; begin #delay ab_and = a & b; ab_or = a | b; ab_xor = a ^ b; end endtask endmodule Task Examples Use of input and output arguments
  • 17. Tasks and Functions Differences between Tasks and Functions
  • 18. 2005 Verilog HDL 18 Differences between...  Functions  Can enable (call) just another function (not task)  Execute in 0 simulation time  No timing control statements allowed  At lease one input  Return only a single value Tasks Can enable other tasks and functions May execute in non-zero simulation time May contain any timing control statements May have arbitrary input, output, or inout Do not return any value
  • 19. 2005 Verilog HDL 19 Differences between… (cont’d)  Both  are defined in a module  are local to the module  can have local variables (registers, but not nets) and events  contain only behavioral statements  do not contain initial or always statements  are called from initial or always statements or other tasks or functions
  • 20. 2005 Verilog HDL 20 Differences between… (cont’d)  Tasks can be used for common Verilog code  Function are used when the common code  is purely combinational  executes in 0 simulation time  provides exactly one output  Functions are typically used for conversions and commonly used calculations