-- vhdl model for 8 level priority circuit --************************************************************************* -- IO Interface Declaration --************************************************************************* library ieee; use ieee.std_logic_1164.all; entity priority_new is port ( -- inputs signal y1: in std_logic; signal y2: in std_logic; signal y3: in std_logic; signal y4: in std_logic; signal y5: in std_logic; signal y6: in std_logic; signal y7: in std_logic; -- outputs signal vec: out std_logic_vector(2 downto 0) ); end priority_new; --************************************************************************* -- Architecture body --************************************************************************* architecture behavior of priority_new is begin process (y1,y2,y3,y4,y5,y6,y7) begin vec <= "000"; if (y1 = '1') then vec <= "001"; end if; if (y2 = '1') then vec <= "010"; end if; if (y3 = '1') then vec <= "011"; end if; if (y4 = '1') then vec <= "100"; end if; if (y5 = '1') then vec <= "101"; end if; if (y6 = '1') then vec <= "110"; end if; if (y7 = '1') then vec <= "111"; end if; end process; end behavior;