Altera_Forum
Honored Contributor
14 years ago"When others" best practice?
Hello,
I need to create a design that takes a different action according to the data input. I made a few tests here using both CASE and IF statements. From 64 different input values the system must do something only for 5 of them. The other cases it should "do nothing". My question is how should I program the "when others" case or the last "else" of the IF statements? There seems to be a big difference on the resulting system size depending on this From my tests I got the following compilation results (total logic elements): IF statement with no "else" on the last IF: 23521 IF statement with (signal <= signal) on the last else: 23510 IF statement with (signal <= value) on the last else: 22496 (please note that this is not the correct behavior of the system, I only did it for testing) CASE statement with nothing on the "when others": 24262 CASE statement with (signal <= signal) on the "when others": 24342 CASE statement with (signal <= value) on the "when others": 22882 Thank you Best regards, Thiago