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

📄 display.vhd

📁 VHDL语言开发的全自动洗衣机的源程序 可以通过一个按键的复用实现5种功能的选择
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity display is 
port(a1:in std_logic_vector(2 downto 0);
     a2:in std_logic_vector(5 downto 0);
     clk3: in std_logic; 
     segout:out std_logic_vector(6 downto 0); --segout(6)->g,其余的一一对应
     cs:out std_logic_vector(2 downto 0));
end;
architecture a of display is 
signal b:std_logic_vector(2 downto 0);
begin
process(clk3)
begin
if (clk3'event and clk3='1') then
if (b="011") then
b<="101";
case a1 is
when "001"=>segout<="0000110";
when "010"=>segout<="1011011";
when "011"=>segout<="1001111";
when "100"=>segout<="1100110";
when "101"=>segout<="1101101";
when others=>segout<="0111111";
end case;
elsif (b="101") then 
b<="110";
case a2(5 downto 4) is
when "00"=>segout<="0111111";
when "01"=>segout<="0000110";
when "10"=>segout<="1011011";
when others=>segout<="0111111";
end case;
elsif (b="110") then
b<="011"; 
case a2(3 downto 0) is
when "0000"=>segout<="0111111";
when "0001"=>segout<="0000110";
when "0010"=>segout<="1011011";
when "0011"=>segout<="1001111";
when "0100"=>segout<="1100110";
when "0101"=>segout<="1101101";
when "0110"=>segout<="1111101";
when "0111"=>segout<="0000111";
when "1000"=>segout<="1111111";
when "1001"=>segout<="1101111";
when others=>segout<="0111111";
end case;
else 
     b<="011";
end if;
end if;
end process;
cs<=b;
end;

⌨️ 快捷键说明

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