Re: errata/282: signing version=2.63

From: Bruce LaVigne (bruce@hp.com)
Date: Tue May 04 2004 - 13:20:01 PDT

  • Next message: Alec Stanculescu: "Re: errata/282: signing"

    The following reply was made to PR errata/282; it has been noted by GNATS.

    From: Bruce LaVigne <bruce@hp.com>
    To: Shalom.Bresticker@freescale.com
    Cc: etf-bugs@boyd.com
    Subject: Re: errata/282: signing version=2.63
    Date: Tue, 04 May 2004 13:38:01 -0700

        I appologize for not following this width/sign-extension discussion fully,
     but from a user point of view, I hope that the LRM clearly spells out which of
     these behaviours will occur, as this would be the first place I'd look to make
     sure I got a desired result from simulators & synthesis tools - neither is the
     "obvious" answer to me, and in fact, another possibility would be that in
     widening b, you sign-extend to get 8'b11111100, which gives a final result
     identical to what Shalom points out is the wrong answer!
     
        Of course, I would never write code like this myself (at least, not after
     the linter told me I had mismatching widths ;-) ;-) ;-)
     
     -bruce
     
     
     Shalom.Bresticker@freescale.com wrote:
    > The following reply was made to PR errata/282; it has been noted by GNATS.
    >
    > From: Shalom.Bresticker@freescale.com
    > To: Alec Stanculescu <alec@fintronic.com>
    > Cc: etf-bugs@boyd.com
    > Subject: Re: errata/282: signing
    > Date: Tue, 4 May 2004 22:11:24 +0300 (IDT)
    >
    > Alec,
    >
    > > I agree with everything you said, with the possible exception that you
    > > appear to be of the opinion that the writing of the LRM was
    > > successful in making "sign rules follow vector width rules". This is
    > > not the case because sign rules change the sign of operands (from what
    > > they were specified by the user!) whereas vector width rules do not
    > > affect what the user wrote, they do not change the width of any
    > > operand. They just describe what happens to the result.
    >
    > This is not so.
    > Consider this case:
    >
    > a is 8 bits, b is 4 bits, b = 4'b1100
    >
    > If I write
    >
    > a = ~b;
    >
    > then b is first widened to 8 bits, giving me 8'b00001100.
    > When I complement it, I get a = 8'b11110011.
    >
    > Whereas if I first complemented b, then widened the result,
    > I would get 8'b00000011.
    >
    > Shalom
    >
    >
    >
     
     --
     Bruce LaVigne ASIC Design Engineer
     Hewlett-Packard Company ProCurve Networking Business
     8000 Foothills Blvd, m/s 5672 phone: (916) 785-4194
     Roseville, CA 95747-5672 email: bruce@hp.com
     



    This archive was generated by hypermail 2.1.4 : Tue May 04 2004 - 13:20:10 PDT and
    sponsored by Boyd Technology, Inc.