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

📄 second.vhd

📁 这是一个数字中的课程设计
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity second is
port(clk,clr:in std_logic;
sec1,sec0:out std_logic_vector(3 downto 0);
co:out std_logic);
end second;
architecture art of second is
begin
process(clk,clr)
variable cnt1,cnt0:std_logic_vector(3 downto 0);
begin
if clr='1' then
cnt1:="0000";
cnt0:="0000";
elsif clk'event and clk='1' then
	if cnt1="0101" and cnt0="1001"then
		co<='1';
		cnt1:="0000";
		cnt0:="0000";
		
	elsif cnt0<"1001"then
		cnt0:=cnt0+1;
        co<='0';
	else
		cnt0:="0000";
		if cnt1<"0101" then
   			cnt1:=cnt1+1;
            co<='0';
		else
			cnt1:="0000";
			co<='0';
		end if;
	end if;
end if;

sec1<=cnt1;
sec0<=cnt0;
end process;
end art;

⌨️ 快捷键说明

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