counter2.vhd

来自「汽车四轮定位CCD驱动CPLD源代码」· VHDL 代码 · 共 25 行

VHD
25
字号
library ieee;
use ieee.std_logic_1164.all;  --引用库
                              --二分频器
entity counter2 is
    port(clk:in std_logic;    --输入:原始频率
         reset:in std_logic;  --复位
         Gout:out std_logic); --输出:分频后输出
    signal tempGout : std_logic;--保存上次状态
end;
 
architecture behavioral of counter2 is
begin
     process(reset,clk)

     begin
     if reset='1' then          --复位
        tempGout<='0';
     elsif clk'event and clk='1' then   --clk上升沿引发输出跳变
	tempGout<=not tempGout;      --输出跳变  
     end if;
     Gout<=tempGout;                 --输出
     end process;
end behavioral;

⌨️ 快捷键说明

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