Skip to content

Instantly share code, notes, and snippets.

@hikalium
Created May 21, 2017 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hikalium/b2ab0a88c8e1876601b2100f4fc5baa1 to your computer and use it in GitHub Desktop.
Save hikalium/b2ab0a88c8e1876601b2100f4fc5baa1 to your computer and use it in GitHub Desktop.
verilog sample 001
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