Bob Atwell
New Member
Offline
Posts: 9
Tucson, AZ
|
OK I am confused. (Not an unusual condition.) Based on what I thought I knew, Version 2 below shoud run slightly faster than Version 1 since the assignment statements occur within the cross statement. However this seems not to be true and in my test case it actually runs very slightly slower. Can someone explain?
Thanks, Bob.
Version 1: @(cross(V(s) - 0.5)) ; if (V(s) < 0.5) y1 = 0; else y1 = 1; V(q1) <+ transition( y1, td, tt );
Version 2: @(cross(V(s) - 0.5, +1)) y1 = 1; @(cross(V(s) - 0.5, -1)) y1 = 0; V(q1) <+ transition( y1, td, tt );
|