2019-03-04 11:56:56 -06:00
|
|
|
module demo (
|
2019-03-05 22:21:11 -06:00
|
|
|
input wire CLK_IN,
|
|
|
|
output wire R_LED
|
2019-03-04 11:56:56 -06:00
|
|
|
);
|
|
|
|
parameter time1 = 30'd12_000_000;
|
|
|
|
reg led_state;
|
|
|
|
reg [29:0] count;
|
2019-03-05 22:21:11 -06:00
|
|
|
|
2019-03-04 11:56:56 -06:00
|
|
|
always @(posedge CLK_IN)begin
|
|
|
|
if(count == time1)begin
|
2019-03-05 22:21:11 -06:00
|
|
|
count<= 30'd0;
|
2019-03-04 11:56:56 -06:00
|
|
|
led_state <= ~led_state;
|
|
|
|
end
|
|
|
|
else
|
|
|
|
count <= count + 1'b1;
|
|
|
|
end
|
|
|
|
assign R_LED = led_state;
|
2019-03-05 22:21:11 -06:00
|
|
|
endmodule
|