82.

[Top] [Next] [Prev]

7.3 Self-Starting Counters

In drawing state transition diagrams for the example counters in the previous section, we assumed implicitly that they would begin the sequence in state 000. When working with real hardware, you should never assume that the counter will start in a particular state unless you design it to do so! At the time of power-up, the states of the flip-flops are undefined: they could be 0 or 1 at random.

This leads to a particularly nasty problem, especially for counters that do not use all state combinations of the storage elements, such as the last example. What would happen if, by chance, our example counter had entered state 001 on start-up? Of course, it depends on how don't cares have been mapped into 0's and 1's by the implementation procedure, but the counter could sequence through the noncounter states, 001, 100, and 111, never entering the sequence it was designed for at all.

7.3.1 Verifying If a Counter Is Self-Starting

A self-starting counter is one in which every possible state, even those not in the desired count sequence, has a sequence of transitions that eventually leads to a valid counter state. This guarantees that no matter how the counter starts up, it will eventually enter the proper counter sequence.

Figure 7.26 shows two different state transition diagrams that lead to self-starting implementations for the counter of Figure 7.18. In the state diagram of Figure 7.26(a), the counter is guaranteed to be in sequence after one transition. In Figure 7.26(b), the counter may require up to two transitions before it is in the correct sequence.

In general, it is desirable to enter the counter sequence in as few transitions as possible, so we would prefer the state diagram in Figure 7.26(a). However, there may be an advantage in departing from this rule if a particular sequence of noncounter states can lead to reduced hardware.

The implementation of the counter given in Figure 7.24 leads to the state diagram of Figure 7.26(b). To see how this is derived, let's look at the step-by-step process, illustrated in Figure 7.27.
First, we replace the don't cares in the K-maps of Figure 7.23 with the actually assigned 1's and 0's (these are underlined in Figure 7.27). Since these K-maps represent the inputs to the toggle flip-flops, we must remap them to express their effects on the flip-flops' state. The remapping is shown in the middle K-maps. For example, when A = 0, B = 0, C = 1, the input to the C toggle flip-flop is 1. Thus, the C+ state will change from 1 to 0 under this input combination. By reading across the K-maps, it is easy to see that the current state CBA = 100 changes to the new state 011.

7.3.2 Counter Reset

In the preceding discussion, our primary goal was to enter the count sequence at a valid state. The particular starting state did not matter. Although this may be true in some applications, it is more usual to have a distinguished starting state for the counter or finite-state machine.

If this is the case, it is desirable to include additional hardware to reset the counter to this state. We can accomplish this with an explicit reset button or a special resistor/capacitor circuit that asserts the reset signal for a short time after power-up. Flip-flops typically come with preset and clear inputs. Thus, we can use an asserted reset signal to place the flip-flops in the desired starting state. The implementation in Figure 7.24 includes such circuitry to reset the flip-flops to state 000. Of course, by judicious use of preset inputs as well as clear, we can choose any state as the starting state.

[Top] [Next] [Prev]


This file last updated on 07/14/96 at 16:36:05.
randy@cs.Berkeley.edu;


What is Sarbanes-Oxley[q]
What is Sarbanes-Oxley[q]
ISBN: 71437967
EAN: N/A
Year: 2006
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net