|
本帖最后由 avrwoo 于 2014-3-14 21:23 编辑
偶然间碰到了这么一个问题,请哪位帮助解释一下。
library ieee;
use ieee.std_logic_1164.all;
entity test1 is
port(
clk,a:in std_logic;
c:out std_logic
);
end test1;
architecture bh of test1 is
--signal b,c:std_logic;
begin
process(clk)
variable b:std_logic;
begin
if clk'event and clk='1' then
b:=a;
c<=b;
end if;
end process;
end bh;
在QUARTUS7.2中。上面程序的RTL Viewer中生成的电路图是图1显示的
而把上面程序中进程的两个赋值语句颠倒一下,即
library ieee;
use ieee.std_logic_1164.all;
entity test1 is
port(
clk,a:in std_logic;
c:out std_logic
);
end test1;
architecture bh of test1 is
--signal b,c:std_logic;
begin
process(clk)
variable b:std_logic;
begin
if clk'event and clk='1' then
c<=b;
b:=a;
end if;
end process;
end bh;
在RTL viewer中生成的电路中就多了一个寄存器,如图2显示的,搜了一下信号赋值和变量赋值的特点,但是上面的原因没找到合理的解释。不知道哪位帮助给解释一下。谢谢。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|