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

📄 day1.vhd

📁 VHDL写的数字钟
💻 VHD
字号:
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity day1 is
  Port(
		clkd,set,reset:in std_logic;
		setd:in std_logic;            --――置数端(星期)
		day:buffer std_logic_vector(2 downto 0)
		);       -- ――星期输出端
end;
Architecture a of day1 is
 Begin
  Process(clkd,reset,set,setd)
  	variable d:std_logic_vector(2 downto 0);
  Begin
    If reset='0' then 
		day<="000";                --  ――对星期计时器清0
    Elsif set='1' then 
		if rising_edge(setd) then                    --――对星期计时器置d1的数
			if d=6 then
				d:="000";
			else
				d:=d+1;
			end if;
		end if;
		day<=d;	 
    Elsif clkd'event and clkd='1' then
		If day=6 then 
			day<="000";                 --――重复计数  
		Else 
			day<=day+1;
		End if;
   End if;
 End process;
End;

⌨️ 快捷键说明

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