SIGNAL
a1: bit_vector(3
DOWNTO
0) ;
...
PROCESS
(a)
BEGIN
z<= "0000" :
FOR
i in 0
TO
3
LOOP
IF
(a = i)
THEN
z(i) <= '1' ;
END IF
;
END LOOP
;
END PROCESS
;
...
|
By using predefined attributes the loop-instruction
can be written in a different way as well:
FOR i IN a1'LOW TO a1'HIGH
FOR i IN a1'RIGHT TO a1'LEFT
FOR i IN a1'REVERSE_RANGE
FOR i IN a1'RANGE
|