|






| |
Two-bit Counter Using D Flip Flops
In this exercise, D flip flops are used to implement two-bit up counter. The
design follows the timing diagram covered in the class notes.
 | Start with <Ctrl G> to get a part. Enter the part name of the D flip
flop as7474. Place two of them in the circuit for a two bit counter.
Add bubble parts to the clk and reset inputs, and the two outputs:
out0 and out1. |
 | Hit <Ctrl w> to get a wire to complete the circuit as shown below.
Again hit <Ctrl G> and enter the part name digclock to get the digital
clock that is applied to the input of the counter circuit, and to the reset
input of the two flip flops. Connect them as shown below. |

 | Set the digital clock to a frequency 1Khz with 0 delay, 0.5ms ONTIME,
and 0,5ms OFFTIME. This can be accomplished by selecting the digclock
part and double click on it to get to the attribute window as shown below: |

Similarly, set the Clear DigClock to ONTIME=4 ms, and OFFTIME 1 ms. This
will show that during the On time, the circuit functions as a counter, while during the
Off time, the circuit will be reset and will restart over when the clear input is set to
high.
Note that in case of practical realization of a counter circuit, you need to use a very
low frequency such as 1Hz to be able to see the observe the counts on the display.
 | Set the transient parameters for the analysis. Again go to Analysis from the
top bar menu, then Setup, then Transient, to get to the transient dialog
box.
Enter the following: |
T-stop=20ms
T-step=20us
This will allow 5 cycles of the count sequence 0, 1, 2, 3.

 | Run the Analysis by hitting F11 key. The output waveforms as plotted by the proble
will look like: |
|