原创 占空比为1:1的2的幂次分频电路 VHDL

2009-11-3 20:35 2837 4 4 分类: FPGA/CPLD

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


ENTITY CLK_DIV IS
    PORT(CLK:IN STD_LOGIC;
        RST: IN STD_LOGIC;
        CLK_2D:OUT STD_LOGIC;
        CLK_4D:OUT STD_LOGIC;
        CLK_8D:OUT STD_LOGIC;
        CLK_16D:OUT STD_LOGIC);
END CLK_DIV;


ARCHITECTURE BEHAVE OF CLK_DIV IS
SIGNAL COUNT:STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN


   PROCESS(RST,CLK)
   BEGIN
   IF(RST='1') THEN
       COUNT <= "0000";
       ELSIF RISING_EDGE(CLK) THEN
           IF (COUNT = "1111") THEN
               COUNT <= (OTHERS => '0');
               ELSE
               COUNT <= COUNT + '1';
           END IF;
       END IF;
   END PROCESS;
  
   CLK_2D <= COUNT(0);
   CLK_4D <= COUNT(1);
   CLK_8D <= COUNT(2);
   CLK_16D <= COUNT(3);
END  BEHAVE;

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
4
关闭 站长推荐上一条 /3 下一条