RE: lrm error: sign of logical op

From: J. Bhasker (jbhasker@cadence.com)
Date: Tue Dec 11 2001 - 12:08:46 PST


Precedence: bulk

Paul:

When doing a logical operation, d1 and d2 are first converted to logical
values and then the
logical operation is performed. So signedness is not an issue in this
context.

A non-zero d1(d2) is considered true and a zero d1(d2) is considered false.
So

-5 && -7 is true(1)
5 && 7 is also true(1)
-5 && 0 is false(0)

I guess section 4.1.9 does not explicitly state how logical values of
operands are computed especially
when it is a multibit operand. Maybe this can be clarified in the lrm.

- bhasker

--

J. Bhasker Cadence Design Systems 7535 Windsor Drive, Suite A200, Allentown, PA 18195 (610) 398-6312, (610) 530-7985(fax), jbhasker@cadence.com

<p>-----Original Message----- From: Paul Graham [mailto:pgraham] Sent: Tuesday, December 11, 2001 2:28 PM To: jbhasker Cc: btf@boyd.com Subject: Re: lrm error: sign of logical op

<p>> Comparison results are unsigned. Says so in section 4.5.1. Did you find a > conflicting > statement somewhere else?

I'm not denying that comparison results are unsigned. I was wondering about a logical operator like (d1 && d2). The lrm doesn't say that the result is unsigned. I think it should say that a logical operator produces an unsigned result.

It's a also a bit confusing that the result of a logical operation is defined in terms of the integer constants 0 and 1, which are normally considered 32-bit signed quantities :-)

Paul



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:54:48 PDT and
sponsored by Boyd Technology, Inc.