Help Need: Please help me to understand this code

Status
Not open for further replies.

tokwatbaboy

Newbie level 6
Joined
Sep 5, 2011
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Singapore
Activity points
1,353
Not a RTL coder but I need to understand this piece of code:

finalGater = scanEn ? testModeEn: ~scanEn ? funcMode : 1'hx;

what does it means? any sample code/syntax I can use as reference?

thanks!
 

finalGater = scanEn ? testModeEn: ~scanEn ? funcMode : 1'hx;
And regarding code readability, personally I'd write that like so:

Code SystemVerilog - [expand]
1
finalGater = scanEn ? testModeEn : (~scanEn ? funcMode : 1'hx);


That way it's easier to see how the ~scanEn ? funcMode : 1'hx part of the expression is evaluated. Not just for yourself, but also for future victims. Even if that future victim is future you.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…