Home > VHDL > Concurrent Statements > Exit Statements

Exit Statement :

The exit statement is mainly used to exit from the loop statement. The completion of the loop is conditional if the statement incorporates the condition e.g. when condition. The operation of the exit statement depends on the condition of the statement. When the condition is TRUE the exit statement is executed. The syntax is :

exit [ label ] [ when condition ] ;

Example :

for sample_value in 1 to 8 loop
	Assign_1 : A(sample_value) := '0';
	next when condition_1;
	Assign_2 : A(sample_value + 8) := '0';
	end loop Loop_Z;

If the condition_1 of the sample_value is TRUE, then the next statement is executed.