Forum Discussion

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

Fmax

:oops:

Hi,

In my architecture I need to do the following formula:

" ("conv_integer (byte) * 10000)/127 + 10000

I'm working with 10MHz clock.

The code Fmax is: 14.5MHz ("TimeQueast" is all blue after clock constrain to 10MHz)

Is it going to be enough for the calculation to be quick for using the date immediately inside the Process or must I use pipeline stages and divider IP block instead of "/" operator?

in simulation is works just fine.

Thanks,

Idan

2 Replies

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

    --- Quote Start ---

    :oops:

    Hi,

    In my architecture I need to do the following formula:

    " ("conv_integer (byte) * 10000)/127 + 10000

    I'm working with 10MHz clock.

    The code Fmax is: 14.5MHz ("TimeQueast" is all blue after clock constrain to 10MHz)

    Is it going to be enough for the calculation to be quick for using the date immediately inside the Process or must I use pipeline stages and divider IP block instead of "/" operator?

    in simulation is works just fine.

    Thanks,

    Idan

    --- Quote End ---

    RTL simulation has no knowledge of 'delays'

    instead of dividing by a number, multiply by a scaled reciprocal of that number.

    You are almost halfway there

    your formula
     (a * 10000) / 127 + 10000
    can be changed to
    ( a * 79) + 10000
    if you want more precision you can scale it up further like e.g.
     (a * 20157) / 256 + 10000
    As the 256 is a power of 2 the compiler will graciously implement a right shift of 8

    Result: no divider, less LEs used and maximum speed ...