COMP96_0071エラー: 演算対象に対して、演算子"<operator>" が定義されていません

概要

COMP96_0071エラーは未定義の演算子を使用することにより通知されます。

entity en is
end;

architecture ar of en is
 signal a : integer;
 signal c : bit_vector(3 downto 0);
 signal d : bit_vector(3 downto 0);
begin
  d<= a+c; --COMP96_0071
end;

対応方法

次のどちらかの方法で対応してください。

  • ビットとブーリアンタイプに対して + 演算子を宣言

    entity en is
    end;
    
    architecture ar of en is
      signal a : integer;
      signal c : bit_vector(3 downto 0);
      signal d : integer;
      function "+"(l:integer;r:bit_vector) return integer is
        variable i : integer;
      begin
        --(...)
        return i;
      end function;
    begin
      d<= a+c;
    end;
    
  • 演算対象のタイプを演算子が定義されているタイプに変換

    entity en is
    end;
    
    architecture ar of en is
      signal a : integer;
      signal c : bit_vector(3 downto 0);
      signal d : integer;
      function conv_func (a:bit_vector) return integer is
        variable i : integer;
      begin
        --()
        return i;
      end function;
    begin
      d<= a+conv_func(c);
    end;
    
  • 変換ファンクションまたは定義済みライブラリの演算子を使用

    library ieee;
    use ieee.numeric_bit.all;
    entity en is
    end;
    
    architecture ar of en is
      signal a : integer;
      signal c : bit_vector(3 downto 0);
      signal d : integer;
    begin
      d<= a+to_integer(unsigned(c));
    end;
    
Ask Us a Question
x
Ask Us a Question
x
Captcha ImageReload Captcha
Incorrect data entered.
Thank you! Your question has been submitted. Please allow 1-3 business days for someone to respond to your question.
Internal error occurred. Your question was not submitted. Please contact us using Feedback form.
We use cookies to ensure we give you the best user experience and to provide you with content we believe will be of relevance to you. If you continue to use our site, you consent to our use of cookies. A detailed overview on the use of cookies and other website information is located in our Privacy Policy.