Forum Discussion

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

Divide two 36 Bit values

Hello,

i have a problem. I have to divide two 36 Bit Values, but i can't find a right design in Vhdl, which can do it. All the moduls can divide up to 32 bit, but no more. It should be synthesizable.

I need the quotient and the rest. Can anyone help me? The input type's of my entity are two std_logic_vector(35 downto 0) which i would convert in unsigned values (of the package "ieee.numeric_std.all") with the same length.

And this values, i have to divide. The dividend is the bigest value, so that the result's are only positive.

Thank's a lot,

phot

5 Replies

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

    Thank's a lot for the fast answer.

    Is there also a seperate module (entity) and not a function?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    A divide function is not appropriate as it does now allow pipelining (unless your clock speed is about 2 MHz). The LPM_Divide is a module that is fully pipelined.

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

    If you use the divide function and put a chain of flip flops after the division and use the value from the end of the chain for the output you might get lucky and Quartus will retime those registers (if you enable it) and shove them into the division logic. That said I would just use the megafunction or build your own if you want something custom.