Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. module validation(
  2. output a
  3. );
  4.  
  5.  
  6. reg a1 = 0;
  7.  
  8. assign a = a1;
  9.  
  10. integer counter = 0;
  11.  
  12.  
  13. while(1) // Infinite While Loop
  14.  
  15. begin
  16.  
  17. counter <= counter + 1; //The counter goes up.
  18.  
  19. if(counter == 0)begin
  20.  
  21. a1 <= ~a1; //If the counter reaches 1000, toggle the output.
  22.  
  23. counter <= 1000; // Resetting the counter.
  24.  
  25. end
  26.  
  27. end
  28.  
  29.  
  30. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement