半整数分频的VHDL程序VHDL实例
内容导读:
想出了一个半整数分频的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分频,如果是其他半整数分频修改参数即可
标签:
来源: 作者: 时间:2006/9/25 16:50:53