2-Lecture Notes Lesson5 3
2-Lecture Notes Lesson5 3
Counter Control
We have seen how to include a count-enable control input to enable/disable counting in
the counter.
Figure 2 shows a stage of the basic counter, where we see that the J and K inputs of flip-
flop at stage 1 are connected to an AND gate with Q0 and Count as inputs.
Figure 2: a stage of basic counter
Now let’s add the Load control input to this stage. Thus the operation would become as
shown in Table 1.
When Count = 1 and Load = 0, the circuit will operate as counter because JK =11. It is
the same behavior with respect to the tradition counter.
Now, the control signal Clear can be added to the stage. We will assume asynchronous
Clear in the design.
Connect all the D inputs to Ground (Logic 0). Make Count = 1. This will make the circuit
always operating in the counter mode.
The 2-input AND gate connected to the Load input of the counter takes Q0 and Q3 as its
inputs. As long as the Load input (connected to the output of the AND gate) is 0, the
counter is incremented by one with each clock pulse.
When the output count reaches 9 (1001), the output of AND gate will equal 1. This puts
the counter in the load mode (Load =1). Thus, the next clock pulse will load the data on
the D-inputs (0000) into the counter instead of incrementing the count.
Thus the counter counts from 0000 (decimal 0) to 1001 (decimal 9) then goes back to
0000 and so on. Modulo 10 counting
• Connect the D inputs to 0011 (i.e. D3D2D1D0 = 0011). This will make the circuit
start counting from 3 whenever 12 has been counted.
• Connect the AND gate to Q3 and Q2. Thus, whenever the circuit reaches 12
(1100), Q3 = Q2 = 1, which will make the output of the AND gate equal to 1,
making Load active, so in the next clock transition the counter does not count, but
is loaded from its four inputs, with a value of 0011.
Figure 6: Counter for 3 to 12 counting
Thus the counter counts from 0011 (decimal 3) to 1100 (decimal 12), and back to 0011.
This is also a mod-10 counter, since it also counts ten numbers.
Some counters may have the “Clear” control input. With this capability, the counter can
be “cleared” at any time. The “Clear” signal can also be classified into two types:
Synchronous and Asynchronous.
To explain this behavior, consider a MOD-6 counter that counts from 000 (decimal 0) to
101 (decimal 5). The circuit is shown in the figure.
In this circuit, once the count of 5 (101) is detected by the AND gate, the counter is
cleared on the next clock pulse. Thus, the counter counts from 0 to 5 back to 0.
Assuming negative edge-triggered FFs, the timing diagram of this counter is shown in
Figure 7. Notice the delayed transitions of the counter outputs (Q’s) after the negative
clock edge due to gate propagation delays.
Figure 7: Timing diagram – Synchronous Clear
The timing diagram clarifies the case of Q2Q1Q0 = 101 where the Clear input becomes 1
causing the counter to clear on the next negative clock edge. The point to notice here is
that the effect of change in “Clear” is not immediately applied, but becomes effective in
the following clock pulse, because the “Clear” input is “Synchronous”, i.e. it only takes
effect at the next active clock edge.
This causes the count Q2Q1Q0 = 101 to switch to 000 after a small delay. In other words
the count 101 does not last for a full clock period as other counts, but rather will appear
for a very short duration as a narrow pulse (glitch) as shown in Figure 8. Thus, it would
appear that the counter counts from 0 to 4, that is, from 000 to 100.
This happens because “Clear” is “Asynchronous”. It does not wait for the clock pulse to
come, and does the “clearing” operation immediately.
As a result, the output values become Q2Q1Q0 = 101 for a very short duration of time,
almost negligible, and then the contents become Q2Q1Q0 = 000 within the same clock
period.
Figure 8: Timing diagram – Asynchronous Clear
To have a MOD6 counter designed using the asynchronous clear, we should detect a
count of 6 (instead of 5) and use that to clear the counter asynchronously.
In this case, once the count reaches Q2Q1Q0 = 110, “Clear” is activated, you will not be
able to observe Q2Q1Q0 = 110, because it will be for very short duration. This is shown in
Figure 9.
It would seem to you that after Q2Q1Q0 = 101, the next state is Q2Q1Q0 = 000.