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

📄 timer.vhd

📁 海尔布伦 访问状态机 设计 用FSM方式 verilog HDL 语言描述
💻 VHD
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Timer is
	generic(MAX : positive := 300);	--timeout value
	Port ( clk : in std_logic;		--10Hz
		start, reset : in std_logic;		--starts the timer
		timeout : out std_logic); --timer has timed out
end Timer;

architecture Behavioral of Timer is
	signal count : natural range 0 to MAX;
begin
	process(clk, reset) 
	begin	 
		if reset = '1' then
			count <= 0;
		elsif rising_edge(clk) then
			if start = '0' or count = MAX then
				count <= 0;
			else
				count <= count + 1;
			end if;	 
		end if;
	end process;
	timeout <= '1' when count = MAX else '0';
end Behavioral;





⌨️ 快捷键说明

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