bug in arith.vhd?

Discussion in 'VHDL' started by Attila Csosz, Jan 17, 2005.

  1. Attila Csosz

    Attila Csosz Guest

    Hi,

    Is this a bug?
    How can be this functions same?

    function "<"(L: UNSIGNED; R: UNSIGNED) return BOOLEAN is
    -- pragma label_applies_to lt
    constant length: INTEGER := max(L'length, R'length);
    begin
    return unsigned_is_less(CONV_UNSIGNED(L, length),
    CONV_UNSIGNED(R, length)); -- pragma label lt
    end;


    function ">"(L: UNSIGNED; R: UNSIGNED) return BOOLEAN is
    -- pragma label_applies_to gt
    constant length: INTEGER := max(L'length, R'length);
    begin
    return unsigned_is_less(CONV_UNSIGNED(R, length),
    CONV_UNSIGNED(L, length)); -- pragma label gt
    end;


    Thanks
    Attila
     
    Attila Csosz, Jan 17, 2005
    #1
    1. Advertising

  2. Attila Csosz wrote:

    > Is this a bug?
    > How can be this functions same?


    Not exactly the same.
    Parameters are swapped on the return statements.

    -- Mike Treseler
     
    Mike Treseler, Jan 17, 2005
    #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. MACEI'S
    Replies:
    0
    Views:
    1,370
    MACEI'S
    Jul 10, 2003
  2. Mike Treseler

    Re: Quartus warning in NUMERIC_STD.vhd

    Mike Treseler, Jul 11, 2003, in forum: VHDL
    Replies:
    2
    Views:
    1,874
    Clyde R. Shappee
    Jul 13, 2003
  3. Santosh
    Replies:
    0
    Views:
    748
    Santosh
    Mar 16, 2006
  4. Santosh
    Replies:
    0
    Views:
    608
    Santosh
    Mar 16, 2006
  5. PGK

    sizeof with arith expr

    PGK, Jun 18, 2009, in forum: C++
    Replies:
    8
    Views:
    333
    Alf P. Steinbach
    Jun 20, 2009
Loading...

Share This Page