ISSUE 8

Number 8
Category errata
Synopsis Incorrect zero extend rules for relational and equality operators
State lrmdraft
Class errata-simple
Arrival-DateJul 31 2001
Originator Paul Graham <pgraham@cadence.com>
Release 2001a 2001b, 4.1.7
Environment

Description
Section 4.1.7 says that when a relational operator has two operands of
different sizes, then the smaller operand is zero-extended. This makes no
intuitive sense for signed operands, and it conflicts with the general rules
for determining sign given at the end of chapter 4. It also conflicts with
the behavior of Verilog-XL and NC-Verilog.

Likewise, 4.1.8 says that the smaller operand to an equality operator is
zero-extended, which I also believe is wrong.

Paul
Fix
Submitted to IEEE in October 2001:
Changes incorporated into 2001a:
Passed 10/7/02:

BTF-PR8: Section 4.1.7 - 3rd & 2nd to last paragraphs
REPLACE: When two operands of unequal bit lengths are used, the
smaller operand shall be zero filled on
the most significant bit side to extend to the size of the larger
operand.

WITH: When two operands of unequal bit lengths are used and one
or both of the operands is unsigned, the
smaller operand shall be zero filled on the most significant bit
side to extend to the size of the larger
operand.

REPLACE: When both operands of a relational expression are signed
integral operands (an integer, or a
unsized, unbased integer) then the expression shall be
interpreted as a comparison between signed values.

WITH: When both operands of a relational expression are
signed integral operands (an integer, a signed reg
data type, or an unsized, unbased integer) then the expression
shall be interpreted as a comparison between
signed values.

Additional changes passed for 2001b 10/7/2002:

REPLACE: When both operands of a relational expression are
signed integral operands (an integer, a signed reg
data type, or an unsized, unbased integer) then the expression
shall be interpreted as a comparison between
signed values.

WITH: When both operands of a relational expression are
signed operands, then the expression
shall be interpreted as a comparison between
signed values.


Audit-Trail

Reply from Shalom:
Date: Fri, 27 Sep 2002 12:35:38 +0300 (IDT)
From: Shalom.Bresticker@motorola.com
To: etf-bugs@boyd.com
Cc: 1364@accellera.org
Subject: /8: Incorrect zero extend rules for relational and equality operators

Note: errata/8 was split into 2 parts.
errata/8 now only relates to 4.1.7,
errata/106 relates to 4.1.8.

I request to return errata/8 to the ETF for reconsideration.
The proposed fix has several problems:

Part of the proposed change is:

REPLACE: When both operands of a relational expression are signed
integral operands (an integer, or a
unsized, unbased integer) then the expression shall be
interpreted as a comparison between signed values.

WITH: When both operands of a relational expression are
signed integral operands (an integer, a signed reg
data type, or an unsized, unbased integer) then the expression
shall be interpreted as a comparison between
signed values.

First, in the replacement text, "signed integral operands" was supposed to be
just "signed operands". See the original Cliff proposal.
However, the word "integral" was originally there to distinguish this case from
the case of real operands.

Second, this formulation causes confusion between "an integer" and
"an unsized, unbased integer".

It also leaves out the case of signed net data types,
and explicitly signed integer constants.

So if we want to list all the possible signed operand types, we have:

integer data type
signed reg data type
signed net data type
(explicitly) signed integer constant
unsized, unbased integer constant

I have some difficulty to formulate it nicely,
but the current formulation is not good enough.

Shalom



From: Shalom.Bresticker@motorola.com
To: etf-bugs@boyd.com
Cc: 1364@accellera.org
Subject: Re: errata/8: Incorrect zero extend rules for relational and equality
operators
Date: Fri, 4 Oct 2002 11:41:38 +0300 (IDT)

>Category: errata
>Confidential: no
>Originator: Shalom.Bresticker@motorola.com
>Class: TBD
>Description:
I propose to reword this simply as follows:

> When both operands of a relational expression are
> signed operands,
> then the expression
> shall be interpreted as a comparison between
> signed values.

Reason: It is unneeded and difficult to specify here all the
cases of signed non-real operands. The following sentence,
which begins,
"When either operand of a relational expression is a real
operand ...", does not contradict this first reworded sentence.

Shalom


On Fri, 27 Sep 2002, Shalom Bresticker wrote:

> WITH: When both operands of a relational expression are
> signed integral operands (an integer, a signed reg
> data type, or an unsized, unbased integer) then the expression
> shall be interpreted as a comparison between
> signed values.

Unformatted


Hosted by Boyd Technology