新闻| 论坛| 博客| 在线研讨会
两个Process中对同一个信号赋值
zhchxgh| 2009-07-14 22:47:15 阅读:4469 发布文章

两个Process中对同一个信号赋值

VHDL中,在两个Process中对同一个信号赋值,要做那些事情?

对两个PROCESS问题,可以用中间信号作传递完成:
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;
signal s : std_logic;
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;

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
推荐文章
最近访客