LIBRARY ieee; USE ieee.std_logic_1164.ALL; PACKAGE abc IS function max (a,b,c:in std_logic_vector) return std_logic_vector; END abc; PACKAGE body abc IS function max (a,b,c:in std_logic_vector) return std_logic_vector is begin if a>b then if a>c then return a; else return c; end if; else if b>c then return b; else return c; end if; end if; end function max; END abc; LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE work.abc.ALL; ENTITY amax IS  ORT( a1,a2,a3 : IN STD_LOGIC_vector(3 downto 0); b1,b2,b3: IN STD_LOGIC_VECTOR(3 downto 0); y1, y2: OUT STD_LOGIC_vector(3 downto 0)); END amax; ARCHITECTURE a OF amax IS BEGIN pro1: PROCESS (a1,a2,a3) BEGIN y1<=max(a1,a2,a3); END PROCESS ; pro2: PROCESS (b1,b2,b3) BEGIN y1<=max (b1,b2,b3); END PROCESS ; END a; 作者: kalagod 时间: 2006-6-24 10:26
错误提示:ruturn statement in an if or case statement is not supported作者: stone133 时间: 2006-6-26 10:30