Created
May 21, 2017 22:23
-
-
Save hikalium/b2ab0a88c8e1876601b2100f4fc5baa1 to your computer and use it in GitHub Desktop.
verilog sample 001
This file contains 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 led (led1,led2,clk,btn); | |
input clk; | |
input btn; | |
output led1; | |
output led2; | |
reg[24:0]count; | |
assign led1 = count[24]; | |
assign led2 = btn; | |
always @(posedge(clk)) begin | |
if(btn == 0) count <= count + 1; | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment