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

📄 seltime.vhd

📁 有关数字钟的
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity seltime is
port(ckdsp,reset:in std_logic;
	second,minute,hour:in std_logic_vector(7 downto 0);
	daout:out std_logic_vector(3 downto 0);
	sel:out std_logic_vector(2 downto 0));
end seltime;
architecture behave of seltime is
   signal count:std_logic_vector(2 downto 0);
begin
   sel<=count;
   process(CKDSP)
          begin
			if(reset='0')then daout<="0000";
            else 
			 if(CKDSP'event and CKDSP='1') then
				 if(count>="111") then
                    count<="000";
				 else
                    count<=count+1;
				 end if;
              end if;
			end if;
    		case count is
  			when"000"=>daout<=second(3 downto 0);
  			when"001"=>daout<=second(7 downto 4);  
  			when"010"=>daout<=minute(3 downto 0);
			when"011"=>daout<=minute(7 downto 4);
  			when"100"=>daout<=hour(3 downto 0);
			when"101"=>daout<=hour(7 downto 4);
  			when others=>null;
			end case;
  end process;
end;

⌨️ 快捷键说明

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