【发布时间】:2019-05-10 19:03:50
【问题描述】:
我正在尝试从一个 fulladder 1bit 做一个 4 位的 fulladder,但是我使用的 vivado 平台给出了语法错误,但我不知道为什么? 这是第一个模块(名称是 HA2(Fulladder1bits(我必须为 FA 更改字母 HA2,但我知道该怎么做)))
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity HA2 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
s : out STD_LOGIC;
cin : in STD_LOGIC;
count : out STD_LOGIC);
end HA2;
architecture Behavioral of HA2 is
begin
s <= a xor b xor cin;
count <= (a and b) or (cin and (a or b));
end Behavioral;
错误出现在下一个模块中(名为“fulladder4bits”):
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fulladder4bits is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
S : out STD_LOGIC_VECTOR (3 downto 0);
C3 : out STD_LOGIC);
end fulladder4bits;
architecture Behavioral of fulladder4bits is
COMPONENT HA2
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
s : out STD_LOGIC;
cin : in STD_LOGIC;
count : out STD_LOGIC);
end COMPONENT;
signal C0,C1,C2 : std_logic ;
begin
fa1 : HA2 port map(A(0),B(0),'0',S(0),C0) ;**HERE the plataform vivado give me a syntaxis error but i don t know why
fa2 : HA2 port map(A(1),B(1),'C0',S(1),C1) ;**HERE
fa3 : HA2 port map(A(2),B(2),'C1',S(2),C2) ;**HERE
fa4 : HA2 port map(A(3),B(3),'C2',S(3),C3) ;**HERE
end Behavioral;
但是由于错误以及我可以进行综合和实现的所有操作,所以我真的不知道问题出在哪里。
【问题讨论】: