stanford
Full Member level 2
Code:
case(1′b1) // takes 1′b1 and compares with underlying variables
var_1: <some operation> // checks if var_1==1′b1
var_2: <some operation> // checks if var_2==1′b1
default: <default operation> //if none of variable is 1′b1 then execute default
endcase
1. In such an example, what happens when both var_1 and var_2 are evaluated to be 1? Will var_1 take higher priority?
2. And why/when would you use this over if/else if/else?
Last edited: