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

📄 cnt10.vhd

📁 电子打铃器 在max plus 2 下编译通过
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity cnt10 is
port(
	clk: in std_logic;
	en,reset: in std_logic;	
--	set: in std_logic;
--	setdata:in std_logic_vector(3 downto 0);
	co: out std_logic;
	data1: out std_logic_vector(3 downto 0));
end cnt10;

architecture rtl of cnt10 is
    signal tempen:std_logic;
	signal temp1: std_logic_vector(3 downto 0);

begin
    process(clk)
    begin
        if clk'event and clk='1' then
		  if reset='1' then
			 temp1<="0000";
           	  elsif en='1' then
                if temp1="1001" then
                   temp1<="0000";
                else 
						temp1<=temp1+1;
				end if ;	
				
           end if;
        end if;
    end process;    
    data1<=temp1;
	 --   tempco<='1' when (temp1="0001" and ena='1') else '0';
	co<='1' when (temp1="1001") else '0';
end rtl;



⌨️ 快捷键说明

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