Forum Discussion
Altera_Forum
Honored Contributor
16 years agocomparator
i need to do Greater or equal than Less or Equal than not equal but it is not working with me could you check this code i have done greater or equal than but it is not workin but a...
Altera_Forum
Honored Contributor
16 years ago
if a > b THEN
compare <= "1110";
ELSIF a < b THEN
compare <= "1101";
ELSIF a = b THEN
compare <= "1011";
ELSIF ( a >= b ) THEN
compare <= "0111";
ELSE
compare <= "1111";
END IF;The conditions in an IF statements are evaluated in order. The ">=" case in your code will never trigger as in that case either ">" or "=" will always be evaluated first.