From: Stephen W. <st...@ic...> - 2008-03-07 19:00:00
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Cary R. wrote: > In section 4.5.1 of 1364-2001 it states that for non-self-determined > operands if any operand is real the results will be real, but my > interpretation of a simple parameter is that it can be self-determined. If > not specified it takes the type and size of the RHS. So would the > following give one real and one bit based parameter or two real > parameters? > > parameter real_val = 1'b1 ? 1.0 : 4'b1010; > parameter int_val = 1'b0 ? 1.0 : 4'b1010; // is this 4'b1010 or 10.0? I would say that they are both real. In both cases above, the operands that carry type in the ternary are both logically checked for type and width, and I think therefore the ternary as a whole is real valued. The standard doesn't seem to say so, but I think it is reasonable to assume that "5.5.1 Rules for expression types" applies to ternary operators' true and false operands and not the condition operand (which is defined to be logic): - From 5.5.1 Rules for expression types: - -- Expression type depends only on the operands. - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFH0ZCurPt1Sc2b3ikRAgZQAJ9czffo1gQJtxeO+b7kbkK/4OSSKQCfcVAp WRDk9LeL/Q6LjRNMoaP/qjk= =7RcD -----END PGP SIGNATURE----- |