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

📄 divice.vhd

📁 一些很好的FPGA设计实例
💻 VHD
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;

entity divice is
    Port ( clk : in std_logic;
           reset : in std_logic;
           clk_1hz : out std_logic);
end divice;

architecture Behavioral of divice is
signal q :integer range 0 to 25000000;         --秒分频系数 
signal clkr :std_logic; 
begin
process(clk)                     --此进程产生一个持续时间为一秒的的闸门信号 
begin
  if reset='1' then q<=0; clk_1hz<='0';	clkr<='0';
  elsif clk'event and clk='1' then 
     if q<24999999 then q<=q+1;
     elsif q=24999999 then 
	  q<=0;
	  clkr<=not clkr;
     end if;
  end if;
 clk_1hz<=clkr	;
 
end process;

end Behavioral;



⌨️ 快捷键说明

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