LRM Size Casting

Hi all ,

LRM 6.24.1 says


"When changing the size, the cast shall return the value that a packed array type with a single [n-1:0]
dimension would hold after being assigned the expression, where n is the cast size. The signedness shall
pass through unchanged, i.e., the signedness of the result shall be the self-determined signedness of the
expression inside the cast."

So this says the Size cast doesn;t change the signedess of the expression being cast .

I can use the above line to form the following Code ::


  
   int a ;
   byte b = 8'hFF ;

   initial 
        a =  32'( b ) ;  // a is 32'hFFFF_FFFF since the MSb is 1'b1 , Sign-Extension is done !! 

  

My confusion is with the next line in LRM


 The array elements shall be of type bit if the expression inside the cast is 2-state,
otherwise they shall be of type logic."

[ Q ] I am not sure what these 2 lines imply
Any code with respect to it would be helpful

In reply to Have_A_Doubt:

Just like signedness passes through unchanged, the stateness passes through unchanged as well. The effect of this is not really observable to the user except if you were to query the resulting type through the PLI.