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

📄 cnt10bcd.vhd

📁 这是关于VHDL时钟的源代码
💻 VHD
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity cnt10bcd is
    Port (	clkin	:in std_logic;
			co		:out std_logic;
    		qout	:out std_logic_vector(3 downto 0)
			);
end cnt10bcd;

architecture behavioral of cnt10bcd is
signal	cnt10	:std_logic_vector(3 downto 0);
begin
	process(clkin)
	begin
		if clkin'event and clkin='1' then
			if	cnt10="1001"	then
				cnt10<="0000";
				co<='1';
			else
				cnt10<=cnt10 + 1;
				co<='0';
			end if;
		end if;
	end process;
	qout<=cnt10;

end behavioral;

⌨️ 快捷键说明

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