kaiser
Newbie level 5
module CONTROL( ld, clk_c, rst_c);
output [3:0] ld;
input clk_c;
input rst_c;
reg [3:0] ld;
reg [2:0] count;
always @ (posedge clk_c or posedge rst_c)
begin
if (rst_c)
begin
count<= 3'd0;
ld <= 4'b0;
end
else
begin
count <= count +1 ;
case (count)
3'd1 : ld[0] <= 1;
3'd2 : ld[1] <= 1;
3'd3 : ld[2] <= 1;
3'd4 : ld[3] <= 1;
default : begin
ld <= 4'b0;
count <= 3'b0;
end
endcase
end
end
endmodule
in the above code.....how can I jump over 3'd5,3'd6,3'd7 values of the counter....?
This code light 4 led ....and when the values of counter > 4 the all leds are closed
3 periods.....how can make leds stay closed 1 period?
output [3:0] ld;
input clk_c;
input rst_c;
reg [3:0] ld;
reg [2:0] count;
always @ (posedge clk_c or posedge rst_c)
begin
if (rst_c)
begin
count<= 3'd0;
ld <= 4'b0;
end
else
begin
count <= count +1 ;
case (count)
3'd1 : ld[0] <= 1;
3'd2 : ld[1] <= 1;
3'd3 : ld[2] <= 1;
3'd4 : ld[3] <= 1;
default : begin
ld <= 4'b0;
count <= 3'b0;
end
endcase
end
end
endmodule
in the above code.....how can I jump over 3'd5,3'd6,3'd7 values of the counter....?
This code light 4 led ....and when the values of counter > 4 the all leds are closed
3 periods.....how can make leds stay closed 1 period?