半整数分频的VHDL程序
2012-06-02

想出了一个半整数分频的VHDL语言描述

其实很多问题只要你耐心,也是比较容易的

写出来与大家共享,共同讨论,半整数分频当然还有其他的方法

我认为这种看起来蛮简单的

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

entity abc is

port(clk:in std_logic;

dout:out std_logic);

end abc;

architecture x of abc is

signal p,q:std_logic_vector(2 downto 0);

begin

process(clk)

begin

if (clk'event and clk='1') then

if p="100" then p<="000";else p<=p+1;

end if;end if;end process;

process(clk)

begin

if (clk'event and clk='0') then

if q="100" then q<="000";else q<=q+1;

end if;end if;end process;

dout<='1' when p="000" or q="010" else '0';end x;

在MAXPLUS2里编译通过

仿真图也是正确的

这个是2.5分频,如果是其他半整数分频修改参数即可

可能会用到的工具/仪表
相关文章
推荐文章
热门文章
章节目录
本站简介 | 意见建议 | 免责声明 | 版权声明 | 联系我们
CopyRight@2024-2039 嵌入式资源网
蜀ICP备2021025729号