counter.vhd

来自「低频数字相位测量仪仿真的软件部分」· VHDL 代码 · 共 30 行

VHD
30
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity counter is	  
	port(
		CLR32: in std_logic;			
		FIN32: IN std_logic;				
		START32: in std_logic;				
		Q32: OUT std_logic_vector(31 downto 0)
		);
end;		

architecture behav of counter is   
signal Qtemp:std_logic_vector(31 downto 0);
begin
	process(clr32,fin32,start32)
	begin
		if clr32='1' then Qtemp<=(others=>'0'); 
		elsif (fin32'event) and (fin32='1') then
			if start32='1'then
				Qtemp<=Qtemp+1;
			end if;
		end if;
	end process;
	Q32<=Qtemp;
end ;

			

⌨️ 快捷键说明

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