Welcome to My Website

About Me

My photo
I am doing my final year EEE in Dr.SACOE. If someone feels that they have never made a mistake in their life, then it means that they had never tried a new thing in their life.............. i make lot of mistakes, hope am trying something new or ?

Followers

FOR loops:

Posted by PRABHAKARAN Saturday, March 6, 2010

The FOR loop has the following format:

FOR identifier IN range LOOP
{sequential statements}
END LOOP;

The following is an example of the use of a FOR loop:

PROCESS
-- The signal clk has been declared previously. The statement below waits for a
-- change in the value of clk and for clk = ‘1’. This corresponds to a rising edge.
WAIT UNTIL clk’EVENT AND CLK = ‘1’;
FOR i IN 0 to 2 LOOP -- i does not have to be declared
reg(i) <= reg(i + 1); -- reg previously declared
END LOOP;
reg(3) <= ‘0’;
END PROCESS;

In the above process, there is no sensitivity list. Altera VHDL does not allow the use of a WAIT statement and a sensitivity list.

0 comments

Post a Comment