Home > VHDL > Advanced VHDL > Subprograms

Subprograms :

subprogram in VHDL coding is a sequential algorithm which performs operations. Like other programming languages such as C, C++, Java etc. VHDL also provides subprogram facilities. Subprograms consist of procedures and functions. These new units can be located in the main code itself. However, since their main purpose is to allow common pieces of code to be reused and shared, it is more usual to place them in a LIBRARY. In VHDL coding FUNCTION and PROCEDURE are the subprograms. In order to construct FUNCTION and PROCEDURE the sequential statements used in PROCESS statement can be used.