zoukankan      html  css  js  c++  java
  • 如何实现4分频?

    偶来扔个砖头先

    举例来说: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;
    好像是这样的吧。。呵呵
  • 相关阅读:
    16解释器模式Interpreter
    15适配器模式Adapter
    14桥接模式Bridge
    13组合模式Composite
    12外观模式Facade
    11代理模式Proxy
    10享元模式Flyweight
    09观察者模式ObServer
    08策略模式Strategy
    07装饰模式Decorator
  • 原文地址:https://www.cnblogs.com/shangdawei/p/4532117.html
Copyright © 2011-2022 走看看