// String of LEDs implemented as a series of flip-flops. // Shifts the input from left-to-right. // - SW[9] is the reset signal // - SW[0] is the input signal // - ~KEY[0] is the clock signal module string_lights (output logic [9:0] LEDR, input logic [3:0] KEY, input logic [9:0] SW); logic clk, reset, in; assign clk = ~KEY[0]; assign reset = SW[9]; assign in = SW[0]; always_ff @(posedge clk) if (reset) LEDR <= 10'd0; else LEDR <= {in, LEDR[9:1]}; endmodule // string_lights