RE: [sv-bc] RE: clog2 problem

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Jan 24 2008 - 07:17:01 PST
I'm not sure about this for an additional reason.

If N is unsigned, then 

N | 1'sb1

should still zero-extend 1'sb1, because the "propagated type" will be
unsigned, as this expression is a mixture of a signed and an unsigned
operand. 

11.7.2 says,

"When propagation reaches a simple operand as defined in 11.5 (a primary
as defined in A.8.4), then that operand shall be converted to the
propagated type and size. If the operand must be extended, then it shall
be sign-extended only if the propagated type is signed."

Since the propagated type is not signed, then sign-extension should not
be done?

Thanks,
Shalom


> Arturo is right, but thanks to the madness of 
> context-sensitive expression width rules, even N|1 is 
> dangerous when N is an expression.
>      (expr) | signed'(1'b1)
> may work better in a macro or other type-independent setting.
> Note that 1'sb1 would be sign-extended to match width (bad!), whereas
> signed'(1'b1) will 0-extend the literal before cloaking it 
> with signedness (so as to not poison expr with unsignedness).
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Jan 24 07:18:42 2008

This archive was generated by hypermail 2.1.8 : Thu Jan 24 2008 - 07:19:16 PST