Digital Logic Design: Counters, Flip-Flops, and FSMs
Designing a Mod-10 Asynchronous Counter
Designing a mod-10 asynchronous counter using T flip-flops involves creating a counter that counts from 0 to 9 (binary 0000 to 1001) and then resets to 0.
Counter States
The counter will have four T flip-flops (T0, T1, T2, T3) since 24 = 16, which covers the 10 states needed.
State Transitions
The counter will transition as follows:
Present State (Q3 Q2 Q1 Q0) | Next State (Q3 Q2 Q1 Q0) |
---|---|
0000 | 0001 |
0001 | 0010 |
0010 | 0011 |
0011 | 0100 |
0100 | 0101 |
0101 | 0110 |
0110 | 0111 |
0111 | 1000 |
1000 | 1001 |
1001 | 0000 |
T Flip-Flop Input Requirements
For T flip-flops, the input T must be set to toggle the output on each clock pulse based on the current state.
T Input Derivation
- T0 toggles on every clock pulse: T0 = 1
- T1 toggles when Q0 changes from 1 to 0: T1 = Q0
- T2 toggles when Q1 and Q0 are both 1: T2 = Q1 AND Q0
- T3 toggles when Q2 and Q1 are both 1: T3 = Q2 AND Q1
T Inputs Summary
Flip-Flop | T Input Expression |
---|---|
T0 | 1 |
T1 | Q0 |
T2 | Q1 * Q0 |
T3 | Q2 * Q1 |
Master-Slave JK Flip-Flop
Overview
The Master-Slave JK Flip-Flop is used for memory storage and synchronization. It consists of two JK flip-flops: the Master and the Slave. The Master is triggered on the clock’s rising edge, while the Slave is triggered on the falling edge.
Structure
- Master Flip-Flop: Captures the input state during the clock’s high phase.
- Slave Flip-Flop: Captures the output state during the clock’s low phase.
- Inputs: J, K, and Clock (CLK).
- Outputs: Q and Q’ (complement of Q).
Working Mechanism
- Clock Pulse: The Master captures inputs when the clock is high, and the Slave outputs the state when the clock is low.
- Input States:
- J = 0, K = 0: No change; Q remains the same.
- J = 0, K = 1: Reset state; Q becomes 0.
- J = 1, K = 0: Set state; Q becomes 1.
- J = 1, K = 1: Toggle state; Q changes to the opposite state.
Reduced State Table and State Diagram
To create a reduced state table and state diagram, follow these steps:
- Identify States: List all states and transitions.
- Create Initial State Table: Show current state, input, next state, and output.
- Minimize State Table: Identify and eliminate equivalent states.
- Create Reduced State Table: Update the table with reduced states.
- Draw Reduced State Diagram: Represent reduced states and transitions visually.
Designing a 4-Bit Synchronous Mod-6 Counter
Step 1: Understand Mod-6 Counter
Counts from 0 to 5 (0000 to 0101) and resets to 0.
4-Bit Right Shift Register
A 4-bit right shift register shifts bits to the right using four D flip-flops.
Finite State Machines (FSM)
A Finite State Machine (FSM) is a computational model with finite states, transitions, and actions.
Types
- Deterministic FSM (DFSM): One transition per state and input.
- Non-Deterministic FSM (NFSM): Multiple possible transitions.
Applications
- Digital Circuit Design
- Control Systems
- Protocol Design
- Software Engineering
- Compiler Design
- Pattern Recognition
- Automata Theory
- Embedded Systems