0
我想用VHDL制作一个2位比较器。我有以下架构:指定默认值
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity eq2 is
Port (a : in STD_LOGIC_VECTOR (1 downto 0);
b : in STD_LOGIC_VECTOR (1 downto 0);
aeqb : out STD_LOGIC);
end eq2;
architecture struc_arch of eq2 is
signal e0,e1 : std_logic ;
begin
eq_bit0_unit : entity work.eq1(sop_arch);
port map (i0=>a(0) , i1=> b(0) , eq=>e0);
eq_bit1_unit : entity work.eq1(sop_arch);
port map (i0=>a(1),i1=>b(1),eq=>e1);
aeqb <= e0 and e1;
end struc_arch ;
这种架构显然取决于eq1实体。这里是我的lab1实体和体系结构:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity eq1 is
Port (i0 : in STD_LOGIC ;
i1 : in STD_LOGIC;
eq : out STD_LOGIC);
end eq1;
architecture sop_arch of eq1 is
signal p0,p1 : std_logic;
begin
p0<= (not i0) and (not i1);
p1<= not i0 and i1;
eq <= p0 and p1;
end sop_arch;
我收到以下错误:
- 列表项 错误:HDLParsers:3324 - “C:/Users/user/Documents/tp_vhdl/studies/eq2.vhd” 16行模式正式没有默认值的实体的i0必须与实际值相关联。
- 列表项 错误:HDLParsers:164 - “C:/Users/user/Documents/tp_vhdl/studies/eq2.vhd” 第17行解析错误,意想不到的PORT
我想在这个解决方案链接,但它也没有工作: VHDL - Assigning Default Values