Some queries related to expression type

From: Kausik Datta (kausikd@cal.interrasystems.com)
Date: Tue Jun 28 2005 - 07:26:53 PDT

  • Next message: Steven Sharp: "Re: Some queries related to expression type"

    Hi,
    I have some queries related to the sign type of an expression for which the
    LRM is not clear.

    See the following example:

         1 module top;
         2 parameter p7 = (3.33333 == 3.33333000) ? (0 || 1.234) : (4 && (1 -
    1));
         3 parameter p8 = 1'sb1;
         4 reg [3:0] r;
         5 reg [3:0] r1;
         6
         7 initial $display ("p7 = <%f> p8 = <%f> ", p7, p8);
         8 initial $display (" 1'sb1==1 = <%d> 1'sb1==1'sb1 = <%d>
    1'sb1==1'b1 = <%d> ", 1'sb1==1, 1'sb1==1'sb1, 1'sb1==1'b1);
         9
        10 initial
        11 begin
        12 r = 1==1 ? 2'sb11 : 1;
        13 $display ("r = <%b> ", r);
        14 end
        15
        16 initial
        17 begin
        18 if ( 1 == 1)
        19 r1 = 2'sb11;
        20 else
        21 r1 = 1;
        22
        23 $display ("r1 = <%b> ", r1);
        24 end
        25
        26 endmodule

    My queries are :

    1. What will be the sign type of expression : (0 || 1.234) at line 2.
        Is the logical or operator (||) treated as comparison operator?
    2. What will be the sign type of expression (3.33333 == 3.33333000) ? (0 ||
    1.234) : (4 && (1 - 1)) at line 2?
        How does it depend on (3.33333 == 3.33333000) , (0 || 1.234) or (4 &&
    (1 - 1))
    3. What will be the decimal value of 1'sb1
    4. Will be the value of r and r1 same? According to LRM they will be
    different.
         r will be 0011 and r1 will be 1111. Is it a bug in LRM?

    Thanks
    Kausik

     





    This archive was generated by hypermail 2.1.4 : Tue Jun 28 2005 - 06:59:11 PDT and
    sponsored by Boyd Technology, Inc.