errata/140: PROPOSAL - Section 4.1.5: Definition of power operator result type

From: drm@xilinx.com
Date: Thu May 22 2003 - 14:16:20 PDT

  • Next message: Steven Sharp: "Re: errata/140: Section 4.1.5: Definition of power operator result type"

    Precedence: bulk

    The new proposal erased the original proposal from the
    issue state. I am inserting the original proposal back
    into the proposal field so that everyone can see what is
    different between the two proposals. The new proposal
    follows the original one, and is unchanged.

    Should the default "add proposal" function append
    rather than replace?

    -------------------------------------------------------------------------

    ORIGINAL PROPOSAL (submitted 1/29/03):

    Part I:

    REPLACE (3rd paragraph of 4.1.5):
       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. The result of the power operator is
       unspecified if the first operand is zero and the second operand is
       non-positive, or if the first operand is negative and the second
       operand is not an integral value.

    WITH (new 3rd and 4th paragraphs of 4.1.5):
       If either operand of the power operator is real, then the result type
       shall be real. The result value is undefined if the first operand
       is zero and the second operand is non-positive, or if the first operand
       is negative and the second operand is not an integral value.

       If neither operand of the power operator is real, then the result type
       shall be determined as outlined in 4.4.1 and 4.5.1, with the second
       operand treated as self-determined. In this case, the power operator
       shall always interpret the second operand as an unsigned value, and the
       result value shall be 1 if both operands are zero.

    ------------------------------------------------------------------------

    Part II:

    REPLACE (Title of Table 15 in 4.1.5):
       Examples of modulus operators

    WITH (new Title of Table 15 in 4.1.5):
       Examples of modulus and power operators

    ------------------------------------------------------------------------

    Part III:

    REPLACE (The sentence immediately prior to Table 15):
       Table 15 gives examples of modulus operations.
       
    WITH
       Table 15 gives examples of some modulus and power operations.

    ------------------------------------------------------------------------

    Part IV:

    REPLACE (heading of first column in Table 15):
       Modulus expression

    WITH (new heading of first column in Table 15):
       Expression

    ------------------------------------------------------------------------

    Part V:

    Append the following power operator examples to Table 15:

       Expression Result Comments
       3**2 9 3*3
       2**3 8 2*2*2, same result as 1<<3
       2**0 1 By definition, and same result as 1<<0
       2**-3'sb1 128 -3'sb1 treated as unsigned 7, same as 1<<-3'sb1
       2.0**-3'sb1 0.5 -3'sb1 coerced to -1.0, giving real reciprocal
       0.0**-1 Undefined Division by zero is undefined
       9**0.5 3.0 Real square root
       9.0**(1/2) 1.0 Integer division truncates exponent to zero
       -9.0**0.5 Undefined Square root of negative number is undefined
       -3.0**2.0 9.0 Defined, because real 2.0 is still integral value
       2**(-3'so4/3'so2) 64 Exponent is -3'so2, but is interpreted as 3'o6

    --------------------------------------------------------------------------

    NEW PROPOSAL (submitted 5/19/03):

    Part I:

    REPLACE (3rd paragraph of 4.1.5):
       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. The result of the power operator is
       unspecified if the first operand is zero and the second operand is
       non-positive, or if the first operand is negative and the second
       operand is not an integral value.

    WITH (new 3rd and 4th paragraphs of 4.1.5):
       If either operand of the power operator is real, then the result type
       shall be real.
     
       If neither operand of the power operator is real, then the result type
       shall be determined as outlined in 4.4.1 and 4.5.1, with the second
       operand treated as self-determined. The result value is 'bx if
       the first operand is zero and the second operand is negative.
       The result value is 1 if the second operand is zero.
     
       op1 ** op2 where op1, op2 are not real:
     
         op1 is negative<-1 -1 zero 1 positive>1
       --------------------------------------------------------------------------
       op2 is
       positive int(op1 ** op2) op2 is odd -> -1 0 1 int(op1 ** op2)
                                   op2 is even -> 1
     
       zero 1 1 1 1 1
     
       negative 0 op2 is odd -> -1 'bx 1 0
                                   op2 is even -> 1
     

    ------------------------------------------------------------------------

    Part II:

    REPLACE (Title of Table 15 in 4.1.5):
       Examples of modulus operators

    WITH (new Title of Table 15 in 4.1.5):
       Examples of modulus and power operators

    ------------------------------------------------------------------------

    Part III:

    REPLACE (The sentence immediately prior to Table 15):
       Table 15 gives examples of modulus operations.
       
    WITH
       Table 15 gives examples of some modulus and power operations.

    ------------------------------------------------------------------------

    Part IV:

    REPLACE (heading of first column in Table 15):
       Modulus expression

    WITH (new heading of first column in Table 15):
       Expression

    ------------------------------------------------------------------------

    Part V:

    Append the following power operator examples to Table 15:

       Expression Result Comments
       3**2 9 3*3
       2**3 8 2*2*2
       2**0 1 anything to the zero exponent is 1
       2**-3'sb1 0 2**-1 = 1/2 Integer division truncates to zero
       2.0**-3'sb1 0.5 -3'sb1 coerced to -1.0, giving real reciprocal
       0**-1 'bx Integer division by zero is 'bx
       9**0.5 3.0 Real square root
       9.0**(1/2) 1.0 Integer division truncates exponent to zero
       -3.0**2.0 9.0 Defined, because real 2.0 is still integral value
       2**(-3'so4/3'so2) 0 Exponent is -2, Integer division truncates to zero

    http://boydtechinc.com/cgi-bin/issueproposal.pl?cmd=view&pr=140



    This archive was generated by hypermail 2.1.4 : Thu May 22 2003 - 14:18:33 PDT and
    sponsored by Boyd Technology, Inc.