library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity dientuaz is
port (
I: in std_logic_vector(7 downto 0);
Q: out std_logic_vector(2 downto 0)
);
end dientuaz;
architecture dientuaz of dientuaz is
begin
process(I)
begin
case I is
when "00000001" =>Q<= "000";
when "00000010" =>Q<= "001";
when "00000100" =>Q<= "010";
when "00001000" =>Q<= "011";
when "00010000" =>Q<= "100";
when "00100000" =>Q<= "101";
when "01000000" =>Q<= "110";
when "10000000" =>Q<= "111";
when others => null;
end case;
end process;
end dientuaz;
0 nhận xét:
Đăng nhận xét