Created
April 8, 2019 19:50
-
-
Save axayjha/fb5190638f59249d31c4bfc63043d90f to your computer and use it in GitHub Desktop.
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 counter (dout, din, ld, dec, clk); | |
input [15:0] din; | |
input ld, dec, clk; | |
output reg [15:0] dout; | |
always @(posedge clk) | |
if (ld) dout <= din; | |
else if (dec) dout <= dout - 1; | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment