Forum Discussion

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

Synthesizing an exponential equation (base and mantissa are large numbers)

Hello,

I am trying to synthesize an exponential equation (This is used in my look up table). The equation involves real number and therefore I have to find another way to represent it. The actual equation is 1.211^4000.

I am therefore,trying to implement 1211 ^ 4000. The equation is simulated using cadence tool and DC compiler is used for synthesis.

I have an exponential function running that calculates the value up to a particular range. After that,it picks up a random value as the simulator goes out of range and is not able to represent such huge number.

Is there a way to implement such large numbers? I want it to synthesize as well.

Any input is appreciated! Thanks in advance!:)

8 Replies

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

    you could do it with fixed point, but you'll need a lot of bits.

    you'll need N (base number of bits) *4000 bits.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    Thank you for your reply. Is there a work around for it, to avoid using a lot of bits?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Why do you need such a crazy number, any why does it need to be in an FPGA?

    Why not just use matlab to do it?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well, we already had the Matlab implement it. But,trying to do it in Verilog/SV to avoid timing problem later. If there is a way to break the number to find the exponent, that would be great!

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

    If you don't need digit accuracy, you could use a quadruple-precision floating point number. Those are good up to 10^4962. But the maximum integer that can be stored without loosing accuracy is 2^113.

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

    Cryptography and digital currency (bitcoin etc) do this kind of stuff. In answer to the OP's question, you will need to use on chip memory blocks for this to maintain speed. Set up a series of multipliers with DMA to read inputs and write outputs. Whole books and PHD papers have been written on how to do this stuff. Have fun.

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

    --- Quote Start ---

    If you don't need digit accuracy, you could use a quadruple-precision floating point number. Those are good up to 10^4962. But the maximum integer that can be stored without loosing accuracy is 2^113.

    --- Quote End ---

    Hello,

    Thank you so much for your response :). Could you please elaborate more on this? I think we can compromise a little bit of accuracy.

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

    I would also like to know if there is a way to represent this equation without using a flaoting point representation. Having said that , is there a way to process such huge numbers as an integer?