IF-THEN:
The format of the IF-THEN construct is as follows:
IF (condition) THEN
{sequence of statements}
ELSIF (condition) THEN
{sequence of statements}
ELSE
{sequence of statements}
END IF;
There may be 0 or more ELSIF clauses and 0 or 1 ELSE clause. The following is an example of an IF-ELSE statement.
PROCESS (sela, selb, a, b, c) -- process executes if any of these signals change
BEGIN
IF sela = ‘1’ THEN
q <= a;
ELSIF selb = ‘1’ THEN
q <= b;
ELSE
q <= c;
END IF;
END PROCESS;
0 comments