From: Shalom.Bresticker@motorola.com
Date: Thu Feb 28 2002 - 23:01:51 PST
Precedence: bulk
Dennis,
I remember looking at this some time ago.
I thought I sent an email about it, but I can not find it, so maybe I did not.
Anyway, my conclusion was that the paragraph is badly worded, and where it says
"integer", it means a variable of type "integer".
Where it says "signed", it means a signed reg or a signed constant.
"Unsigned" means an unsigned reg or an unsigned constant.
Then in your case, 2**5, both operands are unsigned constants, so the result is
of type ihteger.
The text of the standard should be fixed.
Shalom
On Wed, 27 Feb 2002, Dennis Marsa
wrote:
> Date: Wed, 27 Feb 2002 16:12:22 -0700
> From: Dennis Marsa <drm@xilinx.com>
> To: btf@boyd.com
> Subject: result type of power operator...
>
> Precedence: bulk
>
> Hello,
>
> In Section 4.1.5 Arithmetic Operators, the 3rd paragraph talks
> about the result type of the power operator, saying:
>
> "The result of the power operator shall be real if either
> operand is a real, integer or signed. If both operands
> are unsigned then the result shall be unsigned."
>
> This would seem to imply that the following use of the power
> operator would be illegal:
>
> reg [2**5-1:0] data;
>
> since the msb expression is of type real.
>
> The equivalent declaration using a real constant:
>
> reg [31.0:0] data;
>
> is rejected by both Verilog-XL and MTI.
>
> If 2**5 has real type, this would also seem to imply that
> it could not be used as an operand to any of the operators
> which cannot take real operands (listed in Table 11 of
> Section 4.1.1).
>
> Am I interpreting the definition of the power operator
> correctly?
>
> MTI version 5.5 does not seem to interpret the power
> operator in this way. It allows the expression 2**5
> to be used in range specifications, and as an operand
> to any operator.
>
> So, they apparently treat 2**5 as having integer type.
>
> Are they wrong?
>
> Regards,
>
> Dennis Marsa
> Xilinx, Inc.
>
-- Shalom Bresticker Shalom.Bresticker@motorola.com Principal Staff Engineer Tel: +972 9 9522268 Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890 POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:55:35 PDT
and
sponsored by Boyd Technology, Inc.