If Then Statement (AHDL)

The If Then Statement lists a series of behavioral statements to be activated after the positive evaluation of one or more Boolean expressions.

The following example shows an If Then Statement:

IF a[] == b[] THEN
        c[8..1] = H "77";
        addr[3..1] = f[3..1].q;
        f[].d = addr[] + 1;
ELSIF g3 $ g4 THEN
        f[].d = addr[];
ELSE 
        d = VCC;
END IF;

The If Then Statement has the following characteristics:

Note: Unlike If Then Statements, which can evaluate only Boolean expressions, If Generate Statements can evaluate the superset of arithmetic expressions. The essential difference between an If Then Statement and an If Generate Statement is that the former is evaluated in hardware (silicon), whereas the latter is evaluated when the design is compiled.