result type of power operator...

From: Dennis Marsa (drm@xilinx.com)
Date: Wed Feb 27 2002 - 15:12:22 PST


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.



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