双时钟计数器

时间:2007-04-29
如何设计一个双时钟的计数器,其中一个时钟是clk_up另一个是clk_down?

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity dou is
port ( clk1 : in std_logic;
clk2 : in std_logic;
q : out std_logic_vector(0 to 3)
);
end dou;
architecture rtl of dou is
signal q1,q2 : integer:=0;
begin
process(clk1)
begin
if clk1'event and clk1='1' then
q1<=q1+1;
end if;
end process;
process(clk2)
begin
if clk2'event and clk2='1' then
q2<=q2+1;
end if;
end process;
process(q1,q2)
begin
q<=conv_std_logic_vector(q1+q2,4);
end process;
end rtl;
==============================
Neither MaxPlus nor any other RTL synthesis tool that the Doctor is
familar with can cope with processes that are sensitive to more than one
clock, or more than one clock edge.

You must recast your model into multiple processes if you wish to
synthesize it.


-- demolbl

vvv
/ \ demolbl@263.net
@ ==
/\ \ "Pay no attention to that man behind the curtain!"


  
上一篇:实际应用时Verilog在许多方面强于VHDL
下一篇:Instantiating LPMs in Verilog

免责声明: 凡注明来源本网的所有作品,均为本网合法拥有版权或有权使用的作品,欢迎转载,注明出处。非本网作品均来自互联网,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。

相关技术资料