Sie sind auf Seite 1von 1

library IEEE;

use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;

entity encoder is
port(
din : in STD_LOGIC_VECTOR(3 downto 0);
dout : out STD_LOGIC_VECTOR(1 downto 0)
);
end priority_encoder_8_3;

architecture arc of encoder is


begin
process (din)
begin

if (din='1000') then
dout <= "11";
elsif (din='0100') then
dout <= "10";
elsif (din(='0010') then
dout <= "01";
elsif (din='0001') then
dout <= "00";

end if;
end process ;

end arc;

Das könnte Ihnen auch gefallen