PPT Slide
use ieee.std_logic_1164.all;
port ( y1, y2, y3, y4, y5, y6, y7 : in std_logic;
dout: out std_logic_vector(2 downto 0)
architecture ifels of priority is
-- priority circuit, Y7 highest priority input
-- Y1 is lowest priority input
process (y1, y2,y3, y4, y5, y6, y7)
if (y7 = '1') then dout <= "111";
elsif (y6 = '1') then dout <= "110";
elsif (y5 = '1') then dout <= "101";
elsif (y4 = '1') then dout <= "100";
elsif (y3 = '1') then dout <= "011";
elsif (y2 = '1') then dout <= "010";
elsif (y1 = '1') then dout <= "001";
This priority circuit has 7 inputs; Y7 is highest priority, Y0 is lowest priority.
Three bit output should indicate the highest priority input that is a '1' (ie. if Y6 ='1' , Y4 = '1', then output should be "101"). If no input is asserted, output should be "000".