- When the same code is used multiple times across a design, using tasks and
functions:
- Reduces the amount of code.
- Facilitates maintenance.
- Tasks and functions must be declared and used in a module. The heading contains the
following parameters:
- Input parameters (only) for functions.
- Input/output/inout parameters for tasks.
- The return value of a function is declared either signed or unsigned. The
content is similar to the content of the combinatorial
always
block.