Help! Vhdl loop error

Thread Starter

xudzu09

Joined Mar 31, 2011
1
i try to complies this code:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
--------------------------------------------
ENTITY LeadingZeros IS
PORT ( data: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
zeros: OUT INTEGER RANGE 0 TO 8);
END LeadingZeros;
--------------------------------------------
ARCHITECTURE behavior OF LeadingZeros IS
BEGIN
PROCESS (data)
VARIABLE count: INTEGER RANGE 0 TO 8;
BEGIN
count := 0;
FOR i IN data'RANGE LOOP
CASE data(i) IS
WHEN '0' => count:=count+1;
WHEN OTHERS => EXIT;
END CASE;
END LOOP;
zeros <= count;
END PROCESS;
END behavior;
but it has an error: unsupported feature error:a neXt or an exit statement is supported only in an unconditionaL loop
i tried to slove this prob, channged the code but it still has error.
hope that you guys can help me!
thanks 4read
 
Top