Design of 4-bit BCD counters (asynchronous reset)

Prerequisites: Study of the functionality of BCD counter (asynchronous reset).

Learning Objective: To develop the source code for BCD counter (asynchronous reset) by using VERILOG and obtain the simulation, synthesis, place and route and implement into FPGA.

Software and Hardware: Xilinx ISE 9.2i and FPGA Spartan-3E.

Theory:

An Asynchronous counter can have 2n-1 possible counting states e.g. MOD-16 for a 4-bit counter, (0-15). For BCD counter forcing the counter to reset itself to zero at a pre-determined value producing a type of asynchronous counter that has truncated sequences. Then an n-bit counter that counts up to its maximum modulus ( 2n ) is called a full sequence counter and a n-bit counter whose modulus is less than the maximum possible is called a Truncated Counter.

But why to create an asynchronous truncated counter that is not a MOD-4, MOD-8, or some other modulus that is equal to the power of two. Modulo-16 asynchronous counter can be modified with additional logic gates to give a decade (divide-by-10) counter output for use in standard decimal counting and arithmetic circuits.

Such counters are generally referred to as Decade Counters. A decade counter requires resetting to zero when the output count reaches the decimal value of 10b, i.e. when DCBA = 1010b  and feed this condition back to the reset input. A counter with a count sequence from binary “0000” (BCD = “0”) through to “1001” (BCD = “9”) is generally referred to as a BCD (Binary-Coded-Decimal) counter because its ten state sequence, is that of a BCD code sequence.

 

Counter Resets its Outputs back to Zero

 

Block Diagram:

 

Verilog Code:

 

(a) Using Synchronous Reset:

 

Test Bench Code:

 

Simulation Results:

 

Result: Thus the OUTPUT of BCD counter  is verified by synthesizing and simulating the VERILOG code.

Learning Outcome: After completion of this experiment students are able to design BCD using Verilog code.


Viva Questions:

  1. What is the function of counter?
  2. What are the major elements of counters?
  3. How many flip flops are used to design a 10 bit counter?
  4. Realize asynchronous counter using T flip-flop.
  5. What are applications of counters?
  6. Design mod-5 synchronous counter using T FF