Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Error 10511 - Arctan

Hello,

I have receive the message

--- Quote Start ---

Error (10511): VHDL Qualified Expression error at main.vhd(37): ARCTAN type specified in Qualified Expression must match integer type that is implied for expression by context

--- Quote End ---

I'd like to known what type of integer to give it.

Thank.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Right click on the message and click "Help". What does it tell you?

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When I click "HELP", I receive

    --- Quote Start ---

    Change the type you specify for an expression to be the same as the implied expression type, or change the context in which the expression occurs so the implied expression type is the same as the type you specify.

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You should possibly mention, where the ARCTAN typed definitions comes from. With standard libraries, I'm only aware of the ARCTAN function in IEEE.MATH_REAL, which has a real type argument and result.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Agree with FvM. arctan returns real results, but reals are non-synthesizable constructs in FPGAs. One way is to recast the result back to a synthesizable type, such as integer.

    variable x:real;
    q:=integer(arctan(x));