Countbcd
From HDLBits
exams/ece241_2014_q7bPrevious
Nextcount_clock
Build a 4-digit BCD (binary-coded decimal) counter. Each decimal digit is encoded using 4 bits: q[3:0] is the ones digit, q[7:4] is the tens digit, etc. For digits [3:1], also output an enable signal indicating when each of the upper three digits should be incremented.
You may want to instantiate or modify some one-digit decade counters.
Module Declaration
module top_module ( input clk, input reset, // Synchronous active-high reset output [3:1] ena, output [15:0] q);
exams/ece241_2014_q7bPrevious
Nextcount_clock