[an error occurred while processing this directive]
|
library IEEE;
use IEEE.std_logic_1164.all;
entity decoder is
port
(
ADDR : in std_logic_vector (2 downto 0);
ALE : in std_logic;
CS_IN : in std_logic;
CS_OUT : out std_logic_vector (7 downto 0)
);
end decoder;
architecture decode_arch of decoder is
signal ENA : std_logic;
begin
ENA <= ALE OR CS_IN;
process (ADDR, ENA)
begin
if (ENA = '1') then
CS_OUT <= (others => '1');
else
case ADDR is
when "000" => CS_OUT <= "00000001";
when "001" => CS_OUT <= "00000010";
when "010" => CS_OUT <= "00000100";
when "011" => CS_OUT <= "00001000";
when "100" => CS_OUT <= "00010000";
when "101" => CS_OUT <= "00100000";
when "110" => CS_OUT <= "01000000";
when "111" => CS_OUT <= "10000000";
when others => CS_OUT <= "00000000";
end case;
end if;
end process;
end decode_arch;
E-mail: info@telesys.ru