Forum Discussion

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

Devide in VHLD

I want to implement this function : A<= B/x"A", when I compile, the Quartus put a notice: "/" used but didn't declare.

When I try with "*" (multiply) or "+" (add), it is ok.

I don't know this error, Please help me.

Thank you very much.

37 Replies

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

    When I use Modelsim to simulate VHDL code, It show an error with LPM library?

    I want to use devide command with lpm library, what should I do?

    Thank you very much.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you very much. I had finish my exercise. I used lpm_devide.

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

    "/" for integers is not part of std_logic_arith, it is part of the standar library.

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

    --- Quote Start ---

    The Std_logic_arith library does not have a divide function.

    --- Quote End ---

    It has, but only for integer data type. numeric_std supports inference of divider MegaFunction for signed and unsigned data types.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The Std_logic_arith library does not have a divide function. The numeric_std library has a divide function, so try that instead.

    BUT - Divide is very resource intensive, and doing it in 1 clock cycle will cause the FMax to drop. Use the lpm_divide megafunction instead.