Vhdl Xilinx-ISE:found';0';“运营商的定义”+&引用;,无法确定“的确切重载匹配定义”+&引用;

Vhdl Xilinx-ISE:found';0';“运营商的定义”+&引用;,无法确定“的确切重载匹配定义”+&引用;,vhdl,fpga,xilinx,xilinx-ise,Vhdl,Fpga,Xilinx,Xilinx Ise,我正在将Bin写入BCD代码乘法器,在顶部模块Xilinx ISE中出现以下错误: 第30行:找到运算符“+”的“0”定义,无法确定精确的 “+”的重载匹配定义 而我已将端口映射到顶部模块 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with

我正在将Bin写入BCD代码乘法器,在顶部模块Xilinx ISE中出现以下错误:

第30行:找到运算符“+”的“0”定义,无法确定精确的 “+”的重载匹配定义

而我已将端口映射到顶部模块

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
-- library UNISIM;
-- use UNISIM.VComponents.all;

entity EightDisplayControl is
    Port ( clk : in  STD_LOGIC;
           leftL, near_leftL : in  STD_LOGIC_VECTOR (3 downto 0);
           near_rightL, rightL : in  STD_LOGIC_VECTOR (3 downto 0);
           leftR, near_leftR : in  STD_LOGIC_VECTOR (3 downto 0);
           near_rightR, rightR : in  STD_LOGIC_VECTOR (3 downto 0);
           select_display : out  STD_LOGIC_VECTOR (7 downto 0);
           segments : out  STD_LOGIC_VECTOR (6 downto 0));
end EightDisplayControl;

architecture Behavioral of EightDisplayControl is
    signal Display      : std_logic_vector(2 downto 0);
    signal div      : std_logic_vector(16 downto 0);
    signal convert_me : std_logic_vector(3 downto 0);
begin

div<= div+1 when rising_edge(clk);
Display <= div(16 downto 14); 

process(Display, leftL, near_leftL, near_rightL, rightL, leftR, near_leftR, near_rightR, rightR)
begin
    if    Display ="111" then select_display <= "11111110"; convert_me <= leftL;
    elsif Display ="110" then select_display <= "11111101"; convert_me <= near_leftL;
    elsif Display ="101" then select_display <= "11111011"; convert_me <= near_rightL;
    elsif Display ="100" then select_display <= "11110111"; convert_me <= rightL; 
    elsif Display ="011" then select_display <= "11101111"; convert_me <= leftR; 
    elsif Display ="010" then select_display <= "11011111"; convert_me <= near_leftR; 
    elsif Display ="001" then select_display <= "10111111"; convert_me <= near_rightR; 
    else                              select_display <= "01111111"; convert_me <= rightR; 
    end if;
end process;

decoder : entity work.segment_decoder 
        port map (convert_me, segments); 

end Behavioral;
IEEE库;
使用IEEE.STD_LOGIC_1164.ALL;
使用IEEE.NUMERIC_STD.ALL;
--如果使用,请取消注释以下库声明
--具有有符号或无符号值的算术函数
--使用IEEE.NUMERIC_STD.ALL;
--如果正在实例化,请取消对以下库声明的注释
--此代码中的任何Xilinx原语。
--UNISIM图书馆;
--使用UNISIM.VComponents.all;
实体8显示控件为
端口(时钟:在标准逻辑中;
leftL,near_leftL:STD_逻辑_向量中(3到0);
近右,右:在标准逻辑向量中(3到0);
leftR,near_leftR:STD_逻辑_向量中(3到0);
近右,右:在标准逻辑向量中(3到0);
选择显示:输出标准逻辑向量(7到0);
段:输出标准逻辑向量(6到0);
末端控制;
EightDisplayControl的体系结构是
信号显示:标准逻辑向量(2至0);
信号div:std_逻辑_向量(16向下至0);
信号转换:标准逻辑向量(3到0);
开始

div正如评论中所述,问题在于您已经将信号div定义为标准逻辑向量。IEEE.numeric_标准库未定义标准逻辑向量的加法运算

看看图书馆,我们看到:

--============================================================================

-- Id: A.3
function "+" (L, R: UNSIGNED) return UNSIGNED;
-- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
-- Result: Adds two UNSIGNED vectors that may be of different lengths.

-- Id: A.4
function "+" (L, R: SIGNED) return SIGNED;
-- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
-- Result: Adds two SIGNED vectors that may be of different lengths.

-- Id: A.5
function "+" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0).
-- Result: Adds an UNSIGNED vector, L, with a non-negative INTEGER, R.

-- Id: A.6
function "+" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0).
-- Result: Adds a non-negative INTEGER, L, with an UNSIGNED vector, R.

-- Id: A.7
function "+" (L: INTEGER; R: SIGNED) return SIGNED;
-- Result subtype: SIGNED(R'LENGTH-1 downto 0).
-- Result: Adds an INTEGER, L(may be positive or negative), to a SIGNED
--         vector, R.

-- Id: A.8
function "+" (L: SIGNED; R: INTEGER) return SIGNED;
-- Result subtype: SIGNED(L'LENGTH-1 downto 0).
-- Result: Adds a SIGNED vector, L, to an INTEGER, R.

--============================================================================
这清楚地表明,只支持用于添加无符号、有符号、自然和整数的函数


正如@Tricky在评论中所述,您需要将div定义为无符号。

请查看VHDL常见问题解答:简而言之,std_logic_vector+integer:无法完成。更现代的编码是使用IEEE.numeric\U std进行矢量运算。我应该更改哪些代码@vermaete@BananaGuy将div信号更改为无符号类型。好的,将IEEE.numeric\u std更改为IEEE.std\u logic\u unsigned@当我改变它时,有更多的错误你有电子邮件吗@Tricky还有IEEE Std 1076-2008软件包numeric_Std_unsigned,它通过封装将Std_logic_vector视为无符号类型,并提供相同的功能。确实有,但仅与VHDL-2008及更高版本兼容。大多数工具默认使用VHDL-93,我不想把这个问题与讨论混淆。我必须创建什么样的测试台?@BananaGuy我不确定,我想是蓝色的。说真的,从你最初的问题和我的回答来看,你在评论中的问题毫无意义。