Created
April 7, 2019 15:18
-
-
Save axayjha/a244054cb3081749802763ba7afc6780 to your computer and use it in GitHub Desktop.
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 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