Last active
August 29, 2015 14:10
-
-
Save miyukki/8f0320cf0715b5ec9076 to your computer and use it in GitHub Desktop.
spartan-3an-blinking-led
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NET "CLOCK_50M" LOC = "E12" | IOSTANDARD = LVCMOS33 | PERIOD = 20.000; | |
NET "LED" LOC = "R20" | IOSTANDARD = LVCMOS33 | DRIVE = 8 | SLEW = SLOW; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module program( | |
input CLOCK_50M, | |
output LED | |
); | |
reg [25:0] count = 26'b0; | |
reg led_state = 1'b1; | |
assign LED = led_state; | |
always @(posedge CLOCK_50M) begin | |
count = count + 1; | |
if (count == 50000000) begin | |
led_state <= !led_state; | |
count = 0; | |
end | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment