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

📄 second.vhd

📁 多功能电子钟 报时 闹钟 设置时间
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity second is
port(reset,clk,setmin:in std_logic;
	enmin:out std_logic;
	daout:out std_logic_vector(7 downto 0));
end second;
architecture behave of second is
begin
process(reset,clk,setmin)
variable da1:std_logic_vector(3 downto 0);
variable da2:std_Logic_vector(3 downto 0);
begin
if(reset='0')then da1:="0000";da2:="0000";enmin<='0';
else 
	if(clk'event and clk='1') then da1:=da1+1;
		if(da1>"1001") then da2:=da2+1;da1:="0000";
				if(da2>"0101") then enmin<='1';da1:="0000";da2:="0000";
				else enmin<='0';
				end if;
		end if;
		if(setmin='1') then enmin<='1';
		end if;
	end if;
end if;
daout(7 downto 4)<=da2;
daout(3 downto 0)<=da1;
end process;
end behave;

⌨️ 快捷键说明

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