Advertisement
Guest User

Untitled

a guest
Sep 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module test_wires(
  2.   input wire [3:0] key,
  3.   input wire clock,
  4.   output wire [7:0] led
  5. );
  6.  
  7. reg[12:0] counter;
  8. reg[12:0] counter2;
  9. reg on;
  10. reg on2;
  11.  
  12. assign led[0] = on2;
  13.  
  14. always @(posedge clock)
  15. begin
  16.   counter = counter+1'b1;
  17.   if (counter == 4095)
  18.   begin
  19.     on = !on;
  20.   end;
  21. end
  22.  
  23. always @(posedge on)
  24. begin
  25.   counter2 = counter2+1'b1;
  26.   if (counter2 == 4095)
  27.   begin
  28.     on2 = !on2;
  29.   end;
  30. end
  31.  
  32. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement