Altera_Forum
Honored Contributor
11 years agoOptimization: If vs CASE, which one?
Hello people,
I was recently reading the ALTERA synthesis manual and I saw that the IF statement is more resource demanding than the CASE statement. In cases where we use a lone IF as in the following: (reseting a counter)
...........
SIGNAL DATAREF : SIGNED(15 DOWNTO 0);
.........
IF(DATAREF >= TO_SIGNED(1000,16)) THEN
DATAREF<= TO_SIGNED(0,16);
END IF;
Then, does it matter if we use an IF or a CASE statement? Thanks in advance