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

📄 week1.vhd

📁 能自动记时
💻 VHD
字号:
Library ieee;              --星期模块
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity week1 is
   Port(clkday,set,reset:in std_logic;
                      w1:in std_logic_vector(3 downto 0);   --输入预置星期几     
                    week:buffer std_logic_vector(3 downto 0));  --输出星期几显示
end week1;
Architecture one of week1 is
Begin
Process(clkday,reset,set,w1)
  variable  cq1: STD_LOGIC_vector( 3 downto 0);
Begin
  if reset='1' then cq1:="0000";  
     Elsif clkday'event and clkday='1' then  cq1:=cq1+1;  
       if cq1="1000" then cq1:="0001";              --星期满7,返回重复计数
       end if;
   end if;
   week<=cq1;
End process;
end one;

⌨️ 快捷键说明

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