Added ROM based LED patterns
This commit is contained in:
+14
-4
@@ -1,14 +1,24 @@
|
||||
module spectrum(
|
||||
input CLOCK_50,
|
||||
output reg[7:0] LED
|
||||
output wire[7:0] LED
|
||||
);
|
||||
|
||||
reg[27:0] counter;
|
||||
reg[2:0] address;
|
||||
wire[7:0] mem_data;
|
||||
|
||||
rom0 rom(
|
||||
.address(address),
|
||||
.clock(CLOCK_50),
|
||||
.q(mem_data)
|
||||
);
|
||||
|
||||
reg[20:0] counter;
|
||||
always @(posedge CLOCK_50)
|
||||
begin
|
||||
counter <= counter + 1;
|
||||
LED <= counter[27:21];
|
||||
counter = counter + 1;
|
||||
if (counter == 0)
|
||||
address = address + 1;
|
||||
end
|
||||
assign LED = mem_data;
|
||||
|
||||
endmodule
|
||||
Reference in New Issue
Block a user