Complete Paper Design For The Counter Specified In Design I

Complete paper design for the counter specified in Design I. Your paper design! must include the following items:

Do the complete paper design for the counter specified in Design I. Your paper design must include the following items:

- State transition table for the counter

- K-maps for each of the flip-flop input equations

- Minimized sum of products (SoP) equation for each flip-flop input signal

Description:

In this lab, a unique counter is designed to implement a specific state diagram, which mimics rolling a die. Each student is assigned a specific sequence of counts, from 1 to 6, with each number used exactly once, and the design must implement this sequence through appropriate digital logic components.

The counter's operation depends on an input “Roll button” (Rb). When Rb=1, the counter progresses through the sequence; when Rb=0, it maintains its current state. An additional concern is the presence of a potential 'missing' state (binary 111) in the 3-bit state machine, which is not part of the sequence, and the design must ensure the machine cannot get stuck in this state upon power-up.

The design approach involves constructing a Moore machine, where the output state bits directly represent the count, and then deriving the required flip-flop input equations using logic minimization techniques.

---

Paper For Above instruction

Introduction

The goal of this project is to design a 3-bit counter that cycles through a specified sequence of six states, each corresponding to counts from 1 to 6, in the form of a Moore machine. The design emphasizes deriving the combinational logic from a state transition table, constructing minimized Karnaugh maps, and implementing the system with flip-flops and basic logic gates. Ensuring no deadlock in the missing state and proper operation upon power-up are critical considerations.

State Transition Table

The counter state diagram illustrates the sequence in which the states traverse, which is determined by the assigned sequence X1 through X6, representing the numbers 1–6. The state bits are labeled Q2, Q1, and Q0, forming binary representations of each respective state.

Assuming that:

- The reset state (000) initializes the counter.

- The sequence is arranged such that:

| Current State (Q2 Q1 Q0) | Rb=1 (Count mode) | Next State (Q2+ Q1+ Q0+) | Rb=0 (Hold) |

|--------------------------|-------------------|--------------------------|--------------|

| 000 (Reset) | 1 | X1 (e.g., 001) | Holds 000 |

| 001 | 1 | X2 (e.g., 010) | Holds 001 |

| 010 | 1 | X3 (e.g., 011) | Holds 010 |

| 011 | 1 | X4 (e.g., 100) | Holds 011 |

| 100 | 1 | X5 (e.g., 101) | Holds 100 |

| 101 | 1 | X6 (e.g., 110) | Holds 101 |

| 110 | 1 | X1 (1) again | Holds 110 |

| 111 (missing) | 1 | Assign to a safe state or reset | Hold 111|

The exact target sequence depends on the assigned count, but the general approach involves defining the next state for each current state under the count mode and ensuring the missing state (111) transitions into a valid counted state, perhaps the start or reset state, to prevent deadlock.

State Transition Table and Logic Derivation

The table maps current state (Q2 Q1 Q0), input Rb, to next state. When Rb=0, the machine maintains current state.

| State | Rb=1 (Counting) | Rb=0 (Hold) |

|--------|-----------------|--------------|

| 000 | 001 | 000 |

| 001 | 010 | 001 |

| 010 | 011 | 010 |

| 011 | 100 | 011 |

| 100 | 101 | 100 |

| 101 | 110 | 101 |

| 110 | 001 | 110 |

| 111 | 001 or reset | 111 |

The transition leading from missing state (111) is designed to lead back into valid states, such as 001, to prevent design lock-up.

Next, derive the flip-flop input equations using Karnaugh maps for each flip-flop (Q2, Q1, and Q0). The flip-flops are D-type, so the input Dn for flip-flop Qn is directly assigned from the minimized equations.

Derivation of Equations

Q0 (LSB flip-flop):

From the transition, Q0 toggles with every count, so:

- When counting Rb=1:

- Q0 transitions from 0→1 and 1→0: toggle.

- When Rb=0:

- Q0 remains unchanged.

Thus, the next value of Q0 depends on whether counting is enabled, hence:

D0 = Rb XOR Q0

Q1 (Middle bit):

From the table:

- Transitions depend on current Q1 and Q0, with logic to create the sequence:

D1 = Q1 XOR (Rb AND Q0) [or simplified based on Karnaugh maps]

Q2 (MSB):

From the sequence, the next state of Q2 depends on the current Q2 and the sequence pattern; the detailed Karnaugh maps define the minimized logical expression as:

D2 = Q2 XOR (Combinational expression derived from sequence and current states)

Implementation and Circuit Design

The circuit comprises three D flip-flops, with inputs D0, D1, D2 driven by the minimized equations. The Rb input controls whether the counter advances or maintains its current state. Reset is active to initialize the counter in a known state (e.g., 000).

The logic gates used include XOR, AND, OR, and NOT gates applied as per the minimized equations. The circuit operates on a clock signal, and as the clock ticks, the flip-flops update their state synchronously.

Handling the Missing State

To prevent the counter from entering a deadlock in 111, the transition from this state is designed to lead back into the sequence (e.g., 001). This may be implemented with additional logic or redefinition of the state transition table to ensure safe recovery.

Simulation and Verification

Once the schematic is completed in Quartus II, simulation with ModelSim verifies proper operation over a cycle. The waveforms demonstrate that the counter advances as expected when Rb=1 and remains stable when Rb=0. The simulation helps confirm that the missing state transitions correctly among the valid sequence, preventing lockup.

Conclusion

This paper details a systematic approach to designing a custom sequence counter as a Moore machine, emphasizing state table development, logic minimization, and proper handling of potential deadlock states. The design is implemented with D flip-flops and combinational logic, verified through simulation, and ready for hardware deployment.

---

References

  • R. L. Carrell, "Digital Logic Design," Pearson Education, 2012.