Академический Документы
Профессиональный Документы
Культура Документы
Figure 1: Labeled Modulo-16 D-Flipflop Counter DESIGN AND SYNTHESIS Generally, the problem statement will read: Design a circuit to count from zero to fifteen. Include a switch to enable pausing the circuit. As it is always a good idea to try to visualize what the question is asking, we will start our design by drawing a diagram using what we know. We know the following: if the current count is zero (0), then the next count must be one (1); the next count after one must be two (10); then three (11); then four (100); then so on until the count reaches fifteen (1111). Another detail we know is that we need to include a switch to enable freezing/pausing the circuit between counts. We can draw this sequence of numbers as shown in Figure 2 below.
Figure 2 is formally known as a state diagram because each ellipse represents one of the states that the circuit can ever possibly be in, and each arrow shows how the circuit moves from state to state depending on whether the enable switch (E) is 1 or 0. The colored arrow shows that after the circuit has reached the number fifteen (1111), it will restart at zero (0000) and continue on from there.
Figure 2: Four-Bit Counter State Diagram Although a state diagram is very easy to understand, in order to use the state diagram to build a circuit, we need to transform the diagram into a table because it is easier to write the Boolean expressions from a table description of the problem (kind of like truth tables). We show the state transition table in Table 1 below. Notice that when E = 0, the circuit will not change state; only when E = 1 does the counting continue. NEXT STATE E=0 0000 0001 0010 0011 0100 0101 0110 0111 0001 0010 0011 0100 0101 0110 0111 1000 E=1
Present State 0000 0001 0010 0011 0100 0101 0110 0111
Just as we would in a truth table, we must label the bits of the state transition table so as to be able to derive Boolean expressions from the table. So we recreate the table as Table 2, with the bits labeled. We use lower cases for the present states and upper cases for the next states. NEXT STATE E=0 WXYZ 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0000 E=1 WXYZ
Present State wxyz 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Table 2