|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
程序如下:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY half_adder IS
PORT(dataA, dataB: IN STD_LOGIC;
sum: OUT STD_LOGIC;
carry: OUT STD_LOGIC
);
END ENTITY half_adder ;
ARCHITECTURE dataflow OF half_adder IS
BEGIN
sum <= dataA XOR dataB;
carry <= dataA AND dataB;
END ARCHITECTURE dataflow;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY full_adder IS
PORT(dataA, dataB, carryin: IN STD_LOGIC;
sum:OUT STD_LOGIC;
carryout:OUT STD_LOGIC
);
END ENTITY full_adder;
ARCHITECTURE struct OF full_adder IS
COMPONENT half_adder
PORT(a,b : IN STD_LOGIC;
s: OUT STD_LOGIC;
ca: OUT STD_LOGIC
);
END COMPONENT;
SIGNAL u1sum, u1carry, u2carry : STD_LOGIC;
BEGIN
u1: half_adder PORT MAP(dataA, dataB, u1sum, u1carry);
u2: half_adder PORT MAP(u1sum, carryin,sum, u2carry);
carryout<= u2carry OR u1carry;
END ARCHITECTURE struct;
软件版本是:QUARTUS II 7.2
编译时报错:
Error: Port "a" does not exist in macrofunction "u2"
Error: Port "b" does not exist in macrofunction "u2"
Error: Port "ca" does not exist in macrofunction "u2"
Error: Port "s" does not exist in macrofunction "u2"
Error: Port "a" does not exist in macrofunction "u1"
Error: Port "b" does not exist in macrofunction "u1"
Error: Port "ca" does not exist in macrofunction "u1"
Error: Port "s" does not exist in macrofunction "u1"
Error: Quartus II Analysis & Synthesis was unsuccessful. 8 errors, 0 warnings
Info: Allocated 154 megabytes of memory during processing
Error: Processing ended: Fri Aug 07 09:04:14 2009
Error: Elapsed time: 00:00:01
路过的大狭帮帮忙吧,万分感谢! |
|