VHDL indexed name issue

落爺英雄遲暮 提交于 2020-05-18 08:57:07

问题


i get this error in this code: ter.vhd(31): Cannot resolve indexed name (type ieee.std_logic_1164.STD_ULOGIC) as type std.STANDARD.BOOLEAN. any idea how to fix it? i sincerly don't get what's wrong, tried with a web search, but nothing. thanks in advance!

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY inverter IS
GENERIC(size: integer); 
PORT ( 
     a : IN std_ulogic_vector(size-1 DOWNTO 0);
     b : OUT std_ulogic_vector(size-1 DOWNTO 0);
     carry : OUT std_ulogic;
     mode : IN std_ulogic
   );
END ENTITY inverter;


ARCHITECTURE behavioral OF inverter IS
COMPONENT alu IS
GENERIC(size: integer); 
Port ( X : in  std_ulogic_VECTOR (size-1 downto 0);
       Y : in  std_ulogic_VECTOR (size-1 downto 0);
       SUM : out  std_ulogic_VECTOR (size-1 downto 0);
       CARRY : out std_ulogic);
end COMPONENT;

SIGNAL z, c : std_ulogic_VECTOR( size-1 downto 0);

BEGIN
start: process(a,mode)
begin
z <= (others => '0');

IF a(size-1) THEN
c <= not a; 
z(0) <=  '1';
ELSIF (mode = '1') THEN 
c <= not a; 
z(0) <=  '1';
ELSE
c <= a;
END IF;
end process;
alu1: alu 
generic map(size)
PORT MAP(x => c, y => z, sum => b, carry => carry);


END ARCHITECTURE behavioral;

来源:https://stackoverflow.com/questions/40960820/vhdl-indexed-name-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!