Skip to content

Instantly share code, notes, and snippets.

@axayjha
Created April 7, 2019 15:18
Show Gist options
  • Save axayjha/a244054cb3081749802763ba7afc6780 to your computer and use it in GitHub Desktop.
Save axayjha/a244054cb3081749802763ba7afc6780 to your computer and use it in GitHub Desktop.
module counter(out, clk, reset);
parameter WIDTH = 8;
output [WIDTH-1 : 0] out;
input clk, reset;
reg [WIDTH-1 : 0] out;
wire clk, reset;
always @(posedge clk)
out <= out + 1;
always @reset
if (reset)
assign out = 0;
else
deassign out;
endmodule // counter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment