Counter Example
Simple components with a register and extra computation
- Customized interface and behavior, e.g.
// 8-bit counter with clear and count enable controls
module count8 (CLK, clr, cntEn, Dout);
input clr; // clear counter
input cntEn; // enable count
output [7:0] Dout; // counter value
else if (cntEn) Dout <= Dout + 1;