portable (VHDL) vs. non-portable (altera LPM) approaches to signed computations

Discussion in 'VHDL' started by Eli Bendersky, Mar 1, 2006.

  1. Hello All,

    I have to do some signed arithmetic computations in my code and I'm
    wondering which is the better approach. The operations I need are
    addition, subtraction, multiplication and comparison. The two choices I
    have are:

    1) Use the VHDL signed arithmetic library. The advantage of this method
    is its portability
    2) Use the Altera LPMs (megafunctions). These are not portable, but
    rather Altera specific (OTOH, all I need is Altera), but are
    recommended by Altera and I can clearly see that they are
    synthesizable.

    What would you recommend ? Are the VHDL signed arithmetic operations
    (especially multiplication) correctly synthesizable on Altera ?

    How would you go about writing a computation, of say RMS (square root
    excluded) ?

    Thanks in advance
    Eli Bendersky, Mar 1, 2006
    #1
    1. Advertising

  2. Re: portable (VHDL) vs. non-portable (altera LPM) approaches to signedcomputations

    Eli Bendersky wrote:

    > I have to do some signed arithmetic computations in my code and I'm
    > wondering which is the better approach. The operations I need are
    > addition, subtraction, multiplication and comparison. The two choices I
    > have are:
    >
    > 1) Use the VHDL signed arithmetic library. The advantage of this method
    > is its portability


    The standard library is numeric_std, not signed:

    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;


    > 2) Use the Altera LPMs (megafunctions). These are not portable, but
    > rather Altera specific (OTOH, all I need is Altera), but are
    > recommended by Altera and I can clearly see that they are
    > synthesizable.


    Picking out device specific primitives is the job of synthesis.
    Altera Quartus 5.1 synthesis is very good, so let it earn it's keep.
    I am better off saying n:= n+1; than I am picking out an adder myself.
    The code is easier to read and if I change vector widths, it still works.

    -- Mike Treseler
    Mike Treseler, Mar 1, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt North

    LPM Modules in ispLEVER

    Matt North, Sep 1, 2004, in forum: VHDL
    Replies:
    2
    Views:
    633
    Martin Bishop
    Sep 12, 2004
  2. Michael Ruflin

    LeonardoSpectrum and Alteras LPM library

    Michael Ruflin, Nov 28, 2004, in forum: VHDL
    Replies:
    1
    Views:
    618
    Mike Treseler
    Nov 28, 2004
  3. Shannon
    Replies:
    20
    Views:
    9,673
  4. chaitu
    Replies:
    1
    Views:
    798
  5. cLaRe

    lpm rom

    cLaRe, Jul 22, 2008, in forum: VHDL
    Replies:
    0
    Views:
    549
    cLaRe
    Jul 22, 2008
Loading...

Share This Page