Home ] Up ] Links ] [ Procedures / Functions ] Packages (general) ] Generic ex. 1 ] Generic ex. 2 ]
Procedures / Functions

Up ]

 

Procedures / functions will normally define combinatorial logic. However will you properly need some conversions functions as well.
A conversion function will not result in extra hardware.

The difference between functions and procedure can be seen by the fact that functions must return data.

If you wants to return more then one parameter could  inout attributes turn out useful.

 
Example with the procedure defined in a package
 
   
     Will select the leftmost index in the vector like the Max index  
   
     Will give the number of elements in the vector    
   will create a vector with all zeros
   will create a vector with all ones
   
   
 
 
Example with the procedure code implemented as part of a Package and used in an Architecture
 
   
   
 

Example with the procedure implemented as part of the architecture

 
   
   
 

Example with the procedure code implemented as part of the Process