Advertisement
AtomSoft

Blinky Verilog (DE1)

Nov 27th, 2012
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // AtomSoftTech (Jason Lopez) Blinky Test in Verilog for DE1
  2. //
  3. // PIN ASSIGNMENTS:
  4. //   set_location_assignment PIN_L1 -to CLOCK_50
  5. //   set_instance_assignment -name IO_STANDARD LVTTL -to CLOCK_50
  6. //   set_location_assignment PIN_U22 -to CLOCK_2HZ
  7. //   set_instance_assignment -name IO_STANDARD LVTTL -to CLOCK_2HZ
  8. module SimpleUART(CLOCK_50,CLOCK_2HZ);
  9.  
  10. input CLOCK_50;
  11. output  CLOCK_2HZ;
  12.  
  13. reg [31:0]  count;
  14. reg [31:0]  cSpeed = 32'd25000000;
  15. reg ClkOut = 1'b0;
  16.  
  17. always@(posedge CLOCK_50)
  18.  
  19. begin
  20.     if(count == cSpeed)
  21.         begin
  22.             count = 0;
  23.             ClkOut = ~ClkOut;
  24.         end
  25.     else
  26.         count = count + 1;
  27. end
  28.  
  29. assign CLOCK_2HZ = ClkOut;
  30. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement