Sequential Processing 53
In this example, the range is specified by the type. By specifying the
type as the range, the compiler determines that the leftmost value is sun,
and the rightmost value is sat. The range then is determined as from
sunto sat.
If an ascending range is desired, use the toclause. The downtoclause
can be used to create a descending range. Here is an example:
PROCESS(x, y)
BEGIN
FOR i IN x downto y LOOP
q(i) := w(i);
END LOOP;
END PROCESS;
When different values for xand yare passed in, different ranges of the
array ware copied to the same place in array q.
NEXT Statement
There are cases when it is necessary to stop executing the statements in
the loop for this iteration and go to the next iteration. VHDL includes a
construct that accomplishes this. The NEXTstatement allows the designer
to stop processing this iteration and skip to the successor. When the NEXT
statement is executed, processing of the model stops at the current point
and is transferred to the beginning of the LOOPstatement. Execution begins
with the first statement in the loop, but the loop variable is incremented
to the next iteration value. If the iteration limit has been reached, pro-
cessing stops. If not, execution continues.
Following is an example showing this behavior:
PROCESS(A, B)
CONSTANT max_limit : INTEGER := 255;
BEGIN
FOR i IN 0 TO max_limit LOOP
IF (done(i) = TRUE) THEN
NEXT;
ELSE
done(i) := TRUE;
END IF;
q(i) <= a(i) AND b(i);
END LOOP;
END PROCESS;