Skip to content

Instantly share code, notes, and snippets.

@miyukki
Last active August 29, 2015 14:10
Show Gist options
  • Save miyukki/8f0320cf0715b5ec9076 to your computer and use it in GitHub Desktop.
Save miyukki/8f0320cf0715b5ec9076 to your computer and use it in GitHub Desktop.
spartan-3an-blinking-led
NET "CLOCK_50M" LOC = "E12" | IOSTANDARD = LVCMOS33 | PERIOD = 20.000;
NET "LED" LOC = "R20" | IOSTANDARD = LVCMOS33 | DRIVE = 8 | SLEW = SLOW;
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