OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [moving_led/] [slow/] [moving_led_slow.v] - Rev 2

Compare with Previous | Blame | View Log

// Moving LED module
 
module moving_led
(
	input				clk,
	input				rst,
	output reg [7:0]	leds
);
 
reg [32:0] count;
 
always @(posedge clk)
begin
	if (rst) count <= 0;
	else count <= count + 1;
end
 
always @(posedge count[26] or posedge rst)
begin
	if (rst)
	begin
		leds <= 8'h0f;
	end
	else
	begin
		leds[7:1] <= leds[6:0];
		leds[0] <= leds[7];
	end
end
 
endmodule
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.