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

📄 display.vhd

📁 quartus下实现的简易人羊白菜过河问题
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity display is
  port(
    n:in std_logic_vector(1 downto 0);
    b1_temp:in std_logic_vector(3 downto 0);
    a:in std_logic_vector(2 downto 0);
    b:out std_logic_vector(6 downto 0);
	u:in std_logic_vector(6 downto 0);
	v:in std_logic_vector(6 downto 0)
  );
end;
architecture dd of display is
begin
process(a,n,b1_temp,u,v)			
begin
  if(n="00")then					--显示数字 
    case a is
	when"100"=>b<="1111110";
	when"101"=>b<="1111110";
	when others=>b<="0000000";
	end case;
  elsif(n="01")then					--显示失败 
    case a is
    when"000"=>b<="1000111";
    when"001"=>b<="1110111";
    when"010"=>b<="0110000";
    when"011"=>b<="0001110";
	when"100"=>b<=v;				
	when"101"=>b<=u;
    when others=>b<="0000000";
    end case; 
  else								
    if(b1_temp="1111")then			--显示通过 
	  case a is
      when"000"=>b<="1100111";
      when"001"=>b<="1110111";
      when"010"=>b<="1011011";
      when"011"=>b<="1011011";
	  when"100"=>b<=v;				
	  when"101"=>b<=u;
      when others=>b<="0000000";
      end case;
    else							--计数继续
      case a is
	  when"100"=>b<=v;
	  when"101"=>b<=u;
      when others=>b<="0000000";
	  end case;
    end if;
  end if;
end process;
end;

⌨️ 快捷键说明

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