having problem using while loop in vhdl

Status
Not open for further replies.

Burns111

Newbie level 1
Joined
May 27, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
Code:
clkloop: process
begin
while not complete loop
clock<=0;wait for 10ns;
clock<=1; wait for 10ns;
end loop; 
wait;
end process clkloop;
Can someone please explain this above code to me line by line?
 

all sites dedicated to VHDL can explain this while loop


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
clkloop: process
begin
   while not complete loop -- start the loop if complete is not true
      clock <= '0';      -- assign '0' to clock
      wait for 10ns;    -- wait 10 ns
      clock <= '1';      -- now assign '1' to clock
      wait for 10ns;   -- again wait for 10 ns
   end loop;             -- if complete is still not true, jump to beginning of the loop and restart, clock will toggle between '0' and '1' with period is 20 ns (50 MHz)
   wait; -- forever     -- if end of loop (complete = true) stop the process
end process clkloop;

 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…