找到运算符“+"的“0"定义;在 VHDL 中 [英] found '0' definitions of operator "+" in VHDL

查看:41
本文介绍了找到运算符“+"的“0"定义;在 VHDL 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我想指出这是我第一次尝试使用 VHDL,所以请善待.我想读取 X1 ... X4 输入并在输出处生成这些输入的总和.这是我的代码

At first I wanna point out that this is my first attempt with VHDL so be kind. I want to read the X1 ... X4 inputs and produce the sum of the ones at the output. This my code

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity counter_of_aces is 
  Generic(N: integer := 3);
     port( X1, X2, X3, X4 : IN BIT; 
        count: out std_logic_vector(N-1 downto 0)); 
end counter_of_aces;

architecture behavioral of counter_of_aces is 
signal counter : std_logic_vector(Ν-1 downto 0);
begin 
  process (X1, X2, X3, X4) 
  begin
    counter <= "0";
    if(X1='1' OR X2='1' OR X3='1' OR X4='1')then 
        counter <= counter + "1"; --O counter λειτουργεί ως στοιχείο μνήμης 
    else
        counter <= counter;
    end if; 
  end process; 
end behavioral;

我收到以下错误

ERROR:HDLCompiler:69 - Line 11: <í> is not declared.
ERROR:HDLCompiler:1731 - Line 17: found '0' definitions of operator "+", cannot determine exact overloaded matching definition for "+"
ERROR:HDLCompiler:854 - Line 10: Unit <behavioral> ignored due to previous errors.

它指的是哪个i",其他的呢?提前致谢.

Which "i" is it referring to and what about the others? Thanks in advance.

推荐答案

使用

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_unsigned.all;

这篇关于找到运算符“+"的“0"定义;在 VHDL 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆