Verilog: n-Bit Up Counter

This is a simple n-bit wrapping up counter. The n parameter can be changed to make this 4, 8, … bit counter were n = <number of bits> – 1. The CLK signal can be any signal you want and will increment the value of the counter on the positive edge of a pulse, RST is the negative edge reset signal which will reset the counter to 0 or any number of your choosing also be sure to change the initial value, which is the starting value when the module initialized. The output count is the current value of the counter.

Code

Verilog

Test Bench

 Change Log

12/28/2013: Update signals names to better represent function; Added test bench.

Share

4 thoughts on “Verilog: n-Bit Up Counter

Leave a Reply

Your email address will not be published. Required fields are marked *