⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decoder.vhd

📁 1.初始状态为4个方向的红灯全亮
💻 VHD
字号:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

ENTITY decoder IS
	port(
		  INPUT: in STD_LOGIC_VECTOR( 3 DOWNTO 0);
          output : out STD_LOGIC_VECTOR( 6 DOWNTO 0)
        );
END decoder;

ARCHITECTURE decoder_arch OF decoder IS
begin
process(INPUT)
BEGIN
	if( INPUT = "0000") then 
      output <= "1111110"; 
    elsif( INPUT = "0001") then 
      output <="0110000";
    elsif(INPUT = "0010") then 
      output <="1101101";
    elsif( INPUT = "0011") then 
      output <="1111001";
    elsif( INPUT = "0100") then
      output <="0110011";
    elsif(INPUT = "0101") then 
      output <="1011011";
    elsif(INPUT = "0110") then 
      output <="0011111";
    elsif(INPUT = "0111") then 
      output <="1110000";
    elsif(INPUT = "1000") then 
      output <="1111111";
    elsif(INPUT = "1001") then 
      output <="1110011"; 
   END IF;
end process;
END decoder_arch;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -