1.

Difference Between Task And Function?

Answer»

Function: 

  • A function is unable to enable a task however functions can enable other functions. 
  • A function will carry out its required duty in zero simulation TIME. ( The program time will not be incremented during the function routine)
  • Within a function, no event, delay or timing control statements are permitted 
  • In the invocation of a function their must be at least one argument to be passed.
  • Functions will only RETURN a single value and can not use either output or inout statements. 

Tasks: 

  • Tasks are CAPABLE of enabling a function as well as enabling other versions of a Task 
  • Tasks also run with a zero simulation however they can if required be EXECUTED in a non zero simulation time. 
  • Tasks are allowed to contain any of these statements. 
  • A task is allowed to use zero or more ARGUMENTS which are of type output, input or inout. 
  • A Task is unable to return a value but has the facility to pass multiple values via the output and inout statements . 

Function: 

Tasks: 



Discussion

No Comment Found