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. Advertisements

  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. Advertisements

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,553
    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:
    2,059
    Clyde R. Shappee
    Jul 13, 2003
  3. Santosh
    Replies:
    0
    Views:
    831
    Santosh
    Mar 16, 2006
  4. Santosh
    Replies:
    0
    Views:
    686
    Santosh
    Mar 16, 2006
  5. Dal
    Replies:
    4
    Views:
    1,069
  6. Mike Treseler

    uart.vhd compile problems

    Mike Treseler, May 10, 2006, in forum: VHDL
    Replies:
    0
    Views:
    705
    Mike Treseler
    May 10, 2006
  7. feiyang
    Replies:
    1
    Views:
    1,811
    Ajeetha
    Nov 23, 2006
  8. PGK

    sizeof with arith expr

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