Forum Discussion
Altera_Forum
Honored Contributor
14 years agoyes that really helped thank you .. actually i used these libraries because i needed them .. the declaration of the function was a small part of my project .. and it kept telling me that there was a problem in the declaration .. but now it doesn't ..
so thanks alot :) package Average is function avg (value1,value2 : std_logic_vector) return std_logic_vector ; end; package body Average is function avg (value1,value2 : std_logic_vector) return std_logic_vector is variable result : std_logic_vector (31 downto 0); variable res: integer; begin res:= (CONV_INTEGER(value1)+CONV_INTEGER(value2))/2; result:=CONV_STD_LOGIC_VECTOR(res,32); return result; end package body ;