jelydonut
Full Member level 4
For synthesis, which would opt the best results or would it end up being the same..
including situations with many more cases..
assign x = (blah == 2'b00) ? a :
((blah == 2'b01) ? b :
((blah == 2'b10) ? c :
((blah == 2'b11) ? d :
16'hxxxx )));
OR
case(blah)
2'b00 : x <= a;
2'b01 : x <= b;
2'b10 : x <= c;
2'b11 : x <= d;
default : x <= 16'hxxxx;
endcase
ignoring any syntax i may have screwed up...
jelydonut
including situations with many more cases..
assign x = (blah == 2'b00) ? a :
((blah == 2'b01) ? b :
((blah == 2'b10) ? c :
((blah == 2'b11) ? d :
16'hxxxx )));
OR
case(blah)
2'b00 : x <= a;
2'b01 : x <= b;
2'b10 : x <= c;
2'b11 : x <= d;
default : x <= 16'hxxxx;
endcase
ignoring any syntax i may have screwed up...
jelydonut