library ieee; use ieee.std_logic_1164.all; -- Logic for x4x238 active high decoder with enable -- a is the select, e is the enable, o is the output -- 09.15.2002 William Dubel entity decoder is port( a: in std_logic_vector(2 downto 0); e: in std_logic_vector(3 downto 1); o: out std_logic_vector(0 to 7)); end decoder; architecture archdecoder of decoder is begin decode: process (a, e) begin if e = "001" then case a is when "000" => o <= "10000000"; when "001" => o <= "01000000"; when "010" => o <= "00100000"; when "011" => o <= "00010000"; when "100" => o <= "00001000"; when "101" => o <= "00000100"; when "110" => o <= "00000010"; when "111" => o <= "00000001"; when others => o <= "--------"; end case; else o <= "ZZZZZZZZ"; end if; end process decode; end archdecoder;