偶来扔个砖头先

举例来说: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;
好像是这样的吧。。呵呵

相关文章:

  • 2021-07-20
  • 2021-07-19
  • 2022-12-23
  • 2021-04-21
  • 2021-04-21
  • 2022-12-23
  • 2021-12-07
  • 2021-12-29
猜你喜欢
  • 2022-12-29
  • 2021-11-25
  • 2021-09-06
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
相关资源
相似解决方案