Forum Discussion

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

Is there any way to have datatype more than integer range ?

Hello,

For the purpose of my project I was designing a power b, where value of b is expected to be 100-200 digit and a is and integer of 2 digit max. The output value from the calculations is stored as an integer hence restricting me to only calculate till integer range values i.e 2^31. I was wondering if there is any other data type in VHDL which has greater range than integer.

Thanks

Siva

3 Replies

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

    Quartus is supporting arithmetic operations on the signed/unsigned data type up to 256 bit length. See Integer Arithmetic Megafunctions User Guide. Arithmetic operations for larger entities have to be coded manually.

    The complexity may be limited by available FPGA resources.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you reply FvM : ) ,

    I have one more question suppose i have a signal assignment as

    signal acc : unsigned ((DATA_WIDTH) downto 0 ) ;

    I am aware that DATA_WIDTH can be declared as generic or a constant type and cannot be changed even if I try to modify the DATA_WIDTH value inside the process block. But I need a clarification regarding is there any other method through which I can change the DATA_WIDTH value ? basically i am looking at re usability of the signal by assigning the value for the DATA_WIDTH inside the process statement flexibly rahter than giving its value through generic or constant

    Siva

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

    no, you cannot do that - think about electronics. you cannot change a circuit while it is running. so you have to design it for worst case scenarion