首页 > 其他 > 详细

如何实现4分频?

时间:2015-05-27 00:42:00      阅读:367      评论:0      收藏:0      [点我收藏+]

偶来扔个砖头先

举例来说:16M的晶振,让它的输入信号输入4个脉冲的时候翻转一次,这个翻转的输出就是四分频拉。。
用CPLD的VHDL语言来做的话:
library ieee;
use ieee.std_logic_1164.all;

entity fp is
    port(
             clk                :in std_logic;--这个是输入的时钟信号嘛
             clk_out         :out std_logic);--这个输出的是四分频的信号嘛
end;

architecture one of fp is
signal:cnt:integer range 0 to 4;
begin
process(clk)
        if rising_edge(clk) then
            cnt <= cnt+1;
                  if cnt=4 then
                     cnt <= 0;
                     cnt_out <= not cnt_out;
                  end if;
        end if;
end process;
end;
好像是这样的吧。。呵呵

如何实现4分频?

原文:http://www.cnblogs.com/shangdawei/p/4532117.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!