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

📄 dcntm20.vhd

📁 电子抢答器 系统复位后进行抢答.超前抢答显示犯规信号
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dcntm20 is 
	port
	(	start,stop		:in std_logic;
	 	reset		:in std_logic;
	 	clk			:in std_logic;
	 	co			:buffer std_logic;
	 	qh			:buffer std_logic_vector(3 downto 0);
	 	ql			:buffer std_logic_vector(3 downto 0)
	);
end dcntm20;

architecture truthtable of dcntm20 is
begin
	co<='1'when(qh="0000" and ql="0000" and start='1')else'0';
	process(clk,reset)
		begin
				if(reset='1')then
						qh<="0010";
						ql<="0000";
					elsif(clk'event and clk='1')then
						if(start='1' and stop='0' and co='0')then
							if(ql="0000") then
								ql<="1001";
								qh<=qh-1;
							else
								ql<=ql-1;
							end if;
						end if;
				end if;							
	end process;
end truthtable;

⌨️ 快捷键说明

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