Hi there, new to Verilog and Basys 3 board. I am trying to write a code that allows for a single blinking trail that keeps repeating itself starting from LD9 and going towards LD0 on the Basys 3 board.
However, the code does not work properly and I am unable to code it onto the board. My code is as follows below. I would appreciate some help as I am confused since there is no errors popping up.
module trail(input CLOCK);
reg [25:0] COUNT = 26'b0000;
integer M;
reg [9:0]led;
always @ (posedge CLOCK) begin
for (M = 9; M >= 0; M = M -1) begin
led[M] <= (COUNT == 26'b0000) ? ~ led[M] : led[M];
led[M-1] <= (COUNT == 26'b0000) ? ~ led[M-1] : led[M-1];
end
end
Question
xanderplush
Hi there, new to Verilog and Basys 3 board. I am trying to write a code that allows for a single blinking trail that keeps repeating itself starting from LD9 and going towards LD0 on the Basys 3 board.
However, the code does not work properly and I am unable to code it onto the board. My code is as follows below. I would appreciate some help as I am confused since there is no errors popping up.
module trail(input CLOCK);
reg [25:0] COUNT = 26'b0000;
integer M;
reg [9:0]led;
always @ (posedge CLOCK) begin
for (M = 9; M >= 0; M = M -1) begin
led[M] <= (COUNT == 26'b0000) ? ~ led[M] : led[M];
led[M-1] <= (COUNT == 26'b0000) ? ~ led[M-1] : led[M-1];
end
end
endmodule
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.