Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* [OvO]wl, FPGA hello world */
  2.  
  3. module top (
  4. //      inout  BTN1,
  5. //      inout  BTN2,
  6. //      inout  BTN3,
  7. //      inout  BTN4,
  8.         input  clk,
  9.         output LD1,
  10.         output LD2,
  11.         output LD3,
  12.         output LD4,
  13. );
  14.  
  15.    reg [3:0] LEDS=0;
  16.    reg [3:0] Data=15;
  17.    reg [17:0] Timer=0;
  18.      
  19.    always @(posedge clk)
  20.      begin
  21.     if( !Timer ) begin
  22.        Data=Data-1;
  23.        LEDS<=Data;
  24.     end;
  25.     Timer=Timer+1; 
  26.      end
  27.  
  28.    assign {LD1, LD2, LD3, LD4} = LEDS;
  29. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement