【发布时间】:2015-10-29 05:29:30
【问题描述】:
您好,任何人都可以帮助我解决 VHDL 问题。我正在尝试一些实用的结构编程,并想从一个简单的半加器开始。这是我的代码
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
--异或描述
entity xor_2 is
port (a, b : in std_logic;
f : out std_logic );
end xor_2;
Architecture func of xor_2 is
begin
f <= a xor b;
end func;
--和描述
entity and_2 is
port (a, b : in std_logic;
f : out std_logic);
end and_2;
architecture func of and_2 is
begin
f1 <= a and b;
end func;
--半加器描述
entity struct_1 is
port ( a, b : in std_logic;
s, c : out std_logic);
end struct_1;
architecture struct_1 of struct_1 is
component xor_2 is
port( a, b : in std_logic;
f : out std_logic);
end component;
component and_2 is
port( a, b : in std_logic;
f : out std_logic);
end component;
begin
g1 : xor_2 port map (a, b, s);
g2 : and_2 port map (a, b, c);
end struct_1;
我正在使用 Quartus II 设计软件,并且在运行测试时不断收到以下警告:
Error (10482): VHDL error at Struct_1.vhd(15): object "std_logic" is used but
not declared
我查看了各种网站和论文以了解我在做什么,但我访问过的每个地方给出的细节都略有不同,我还没有找到一个真正适用于比较的地方。我可以让它与数据流方法一起工作,但不是结构性的。 请小伙子和女士们在这里帮助一个男人
【问题讨论】: