Forum Discussion

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

Fixed point

Hello all,

I'm a beginner and have been reading up on how to implement fixed point in vhdl designs. I've downloaded the Altera package for fixed point from the eda stds website.

The problem is, I'm having trouble going further. What must be done so that I can use the ufixed data types? nothing seems to be working. Do I need to make a library out of the downloaded files or do some sort of component instantiation?

Thanks in advance.

EDIT - I am using Quartus 9.1sp2

3 Replies

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

    I have included the following three files in my project folder: fixed_float_types_c.vhdl, fixed_pkg_c.vhdl, and float_pkg_c.vhdl.

    Then as my top level VHDL file I have the following headings:

    LIBRARY IEEE;

    USE IEEE.STD_LOGIC_1164.ALL;

    USE IEEE.NUMERIC_STD.ALL;

    LIBRARY WORK;

    USE WORK.fixed_pkg.ALL;

    ENTITY help IS

    ...

    I get an error in quartus saying:

    design library "work" does not contain primary unit "fixed_pkg"

    Any help is greatly appreciated.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Try this:

    library floatfixlib;

    use floatfixlib.fixed_pkg.all;

    But have you included the files in the project, rather than just put them in the project folder? Quartus doesnt have native support for them yet (hopefully soon) so you have to include them in your list of files included in each project.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually including the files in Quartus worked, I was unaware that was necessary. Either library heading worked also, Thanks so much for the help.