Introduction to Flip-Flops
A flip-flop is a fundamental sequential logic circuit used to store one bit of binary information. It has two stable states, representing logic 0 and logic 1, and is widely used in registers, counters, memory systems, and digital control circuits.
Characteristics of Flip-Flops
- Bistable Device: Has two stable states, 0 and 1.
- Memory Element: Stores one bit of information.
- Sequential Circuit: Output depends on present inputs and previous state.
- Clock Controlled: Most flip-flops operate in synchronization with a clock signal.
- State Storage: Used to store the state of sequential digital circuits.
Basic Flip-Flop Concept
A flip-flop has two outputs, usually represented as Q and Q'. The outputs are complementary under normal operation.
Q = 0 → Q' = 1
Q = 1 → Q' = 0
Flip-Flop vs Latch
Both latches and flip-flops are storage elements, but they differ mainly in how they respond to control signals.
| Aspect | Latch | Flip-Flop |
|---|---|---|
| Triggering | Level-triggered | Edge-triggered |
| Control | Enable signal | Clock signal |
| Operation | Can change while enabled | Changes at the active clock edge |
| Timing | Transparent during active level | Responds to clock transition |
| Applications | Simple storage | Registers, counters, sequential circuits |
Types of Flip-Flops
The four commonly studied types of flip-flops are SR, JK, D and T.
| Flip-Flop | Inputs | Main Function |
|---|---|---|
| SR | S, R | Set and Reset |
| JK | J, K | Set, Reset and Toggle |
| D | D | Data Storage |
| T | T | Toggle |
SR Flip-Flop
SR stands for Set-Reset. It is one of the simplest types of flip-flops and has two primary inputs: Set (S) and Reset (R).
SR Flip-Flop Operation
| S | R | Qnext | Operation |
|---|---|---|---|
| 0 | 0 | Q | No Change |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Invalid | Invalid Condition |
Characteristic Equation
Qnext = S + R'Q
JK Flip-Flop
The JK flip-flop is an improved version of the SR flip-flop. It eliminates the invalid condition found in the SR flip-flop.
JK Flip-Flop Truth Table
| J | K | Qnext | Operation |
|---|---|---|---|
| 0 | 0 | Q | No Change |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Q' | Toggle |
Characteristic Equation
Qnext = JQ' + K'Q
Race-Around Condition
In a level-triggered JK flip-flop, when J = K = 1 and the clock pulse remains active for a sufficiently long time, the output may toggle repeatedly during the same clock pulse.
This condition is known as the Race-Around Condition.
Methods to Avoid Race-Around
- Use an edge-triggered JK flip-flop
- Use a master-slave JK flip-flop
- Use a sufficiently short clock pulse
D Flip-Flop
D flip-flop stands for Data or Delay flip-flop. It has a single input, D, and transfers the value of D to Q at the active clock edge.
D Flip-Flop Truth Table
| D | Qnext | Operation |
|---|---|---|
| 0 | 0 | Reset |
| 1 | 1 | Set |
Characteristic Equation
Qnext = D
Construction Using JK Flip-Flop
A D flip-flop can be constructed from a JK flip-flop by connecting:
J = D
K = D'
Applications of D Flip-Flop
- Registers: Temporary data storage
- Pipeline Registers: Data transfer between stages
- Memory: Storage elements
- Shift Registers: Serial and parallel data transfer
- Synchronization: Synchronizing digital signals
T Flip-Flop
T stands for Toggle. A T flip-flop changes its state when T = 1 and retains its previous state when T = 0.
T Flip-Flop Truth Table
| T | Qnext | Operation |
|---|---|---|
| 0 | Q | No Change |
| 1 | Q' | Toggle |
Characteristic Equation
Qnext = T ⊕ Q
Equivalent form: Qnext = TQ' + T'Q
Construction Using JK Flip-Flop
A T flip-flop can be constructed from a JK flip-flop by connecting:
J = K = T
Applications
- Binary Counters: Counting operations
- Frequency Division: Dividing clock frequency
- Toggle Circuits: State switching
- Sequential Circuits: State transitions
Master-Slave Flip-Flop
A master-slave flip-flop consists of two stages connected in cascade. The first stage is called the master and the second stage is called the slave.
Working Principle
- The master receives the input during one clock phase.
- The slave remains isolated during this phase.
- During the opposite clock phase, the master is disabled.
- The slave receives the master's stored state.
- The final output changes in a controlled manner.
Advantages
- Helps prevent race-around problems
- Provides controlled state transitions
- Useful in synchronous sequential circuits
Characteristic Tables
Characteristic tables describe the next state of a flip-flop for different input combinations.
| Flip-Flop | Characteristic Equation |
|---|---|
| SR | Qnext = S + R'Q |
| JK | Qnext = JQ' + K'Q |
| D | Qnext = D |
| T | Qnext = T ⊕ Q |
Flip-Flop Excitation Tables
An excitation table shows the required input values to change the current state Q to the desired next state Qnext. These tables are especially useful in sequential circuit design.
SR Flip-Flop
| Q | Qnext | S | R |
|---|---|---|---|
| 0 | 0 | 0 | X |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | X | 0 |
JK Flip-Flop
| Q | Qnext | J | K |
|---|---|---|---|
| 0 | 0 | 0 | X |
| 0 | 1 | 1 | X |
| 1 | 0 | X | 1 |
| 1 | 1 | X | 0 |
D Flip-Flop
| Q | Qnext | D |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
T Flip-Flop
| Q | Qnext | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Comparison of Flip-Flops
| Feature | SR | JK | D | T |
|---|---|---|---|---|
| Inputs | S, R | J, K | D | T |
| Set | Yes | Yes | D = 1 | Through toggle |
| Reset | Yes | Yes | D = 0 | Through toggle |
| Toggle | No | J = K = 1 | No | T = 1 |
| Invalid State | Yes | No | No | No |
| Common Application | Basic storage | Counters | Registers | Counters |
Applications of Flip-Flops
Flip-flops are essential components of sequential digital systems and are used in many computer and electronic systems.
- Registers: Store and transfer binary data.
- Counters: Used to count clock pulses and events.
- Frequency Dividers: Used to divide clock frequencies.
- Shift Registers: Used for serial and parallel data transfer.
- Memory Systems: Used as basic storage elements.
- State Machines: Store the current state of sequential circuits.
- Digital Control Systems: Used for timing and control operations.
- Microprocessors: Used inside registers and control logic.
Quick Revision
- SR: Set and Reset
- JK: Set, Reset and Toggle
- D: Data Storage
- T: Toggle
- JK with J = K = 1: Toggle
- T = 0: No Change
- T = 1: Toggle
- D = Qnext: Data transfer