clkdiv.v
Upload User: xuqufe
Upload Date: 2022-08-10
Package Size: 2378k
Code Size: 0k
Development Platform:

VHDL

  1. module clkdiv(clkin,clkout);
  2. input clkin;
  3. output clkout;
  4. reg [31:0] cnt;
  5. reg clkout;
  6. always @ (posedge clkin)
  7. begin
  8. if(cnt <10000)
  9. begin
  10. cnt <= cnt + 1;
  11. end
  12. else
  13. begin
  14. cnt <= 0;
  15. clkout <= 1;
  16. end
  17. if(cnt == 5000)
  18. begin
  19. clkout <= 0;
  20. end
  21. end
  22. endmodule