Forum Discussion
Altera_Forum
Honored Contributor
14 years agoeg:
package my_function is function to_max(a, b : integer) return integer is variable output :integer; begin if (a > b)then output := a; return output ; else output := b; return output; end if; end package my_functions library ieee library work use work.my_functions.all entity test_program is port ( x,y : in integer; y : out integer ); architecture beh of test_program is begin y =to_max(x,y) ; end architecture beh; not synthesizable code but this is just a guide. hope it helps