A digital circuit can perform calculations, compare values, select data, and make decisions. But there is one thing a purely combinational circuit cannot do: remember.
Imagine pressing a button and wanting a circuit to remember that the button was pressed even after you release it. Or consider a processor that needs to hold a bit of data for exactly one clock cycle before passing it to the next stage. These situations require a circuit with memory.
That is the role of the flip-flop.

A flip-flop is a fundamental sequential logic element capable of storing one binary bit, either 0 or 1. By combining thousands, millions, or even billions of such storage elements, digital systems can create registers, counters, memory structures, pipelines, processors, and state machines.
In this article, we will study flip-flops properly—from the basic idea of memory to SR, D, JK, and T flip-flops, their truth tables, characteristic equations, excitation tables, triggering methods, timing parameters, and practical applications.
Table of Contents
1. What Is a Flip-Flop?
A flip-flop is a bistable sequential circuit used to store one bit of information.
“Bistable” means that the circuit has two stable states:
or
The stored value is represented by the output .
The complementary output is generally represented by:
Ideally,
So if:
then:
and vice versa.
2. Why Do We Need Flip-Flops?
Consider a simple combinational circuit.
If its inputs change, its output changes according to the logic function.
For example:
There is no concept of remembering what or were previously.
A flip-flop is different.
It can retain its previous state:
when no state change is requested.
This gives us the fundamental property:
3. Flip-Flop and the Clock
Most flip-flops used in synchronous digital systems operate with a clock signal.
The clock provides a reference point at which the flip-flop is allowed to change its state.
For a positive-edge-triggered flip-flop, the state changes at the rising edge:
For a negative-edge-triggered flip-flop, the state changes at the falling edge:
This controlled timing is what allows thousands or millions of storage elements to operate together in a digital system.
4. Level Triggering vs Edge Triggering
This distinction is important.
Level-sensitive
A level-sensitive storage element can respond while the control signal remains at a particular logic level.
This is characteristic of a latch.
Edge-triggered
An edge-triggered storage element responds only around a transition of the clock.
This is characteristic of a flip-flop.
Therefore:
5. The Four Important Flip-Flops
The four classical flip-flop types are:
- SR Flip-Flop
- D Flip-Flop
- JK Flip-Flop
- T Flip-Flop
Each one solves a slightly different design problem.
| Flip-Flop | Main Purpose |
|---|---|
| SR | Set and reset |
| D | Data storage |
| JK | General-purpose control and toggle |
| T | Toggle and counting |
Understanding these four types gives you a strong foundation for sequential-circuit design.
6. SR Flip-Flop
The SR flip-flop has two primary inputs:
The purpose is straightforward.
When the Set input is activated, the output becomes 1.
When the Reset input is activated, the output becomes 0.
For the active-high SR form:
| S | R | Operation | |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Invalid | Not permitted |
The most important case is:
The flip-flop simply remembers its previous value.
7. Understanding the SR Flip-Flop
Suppose the flip-flop currently contains:
If we apply:
the circuit is set:
Now suppose both inputs return to zero:
The output remains:
The circuit has remembered the previous operation.
This is the basic idea behind digital memory.
8. The Problem With the SR Flip-Flop
The basic active-high SR flip-flop has an undesirable input combination:
This is considered invalid for the conventional NOR-based implementation.
This limitation led to the development of other flip-flop structures.
One of the most useful solutions is the D flip-flop.
9. D Flip-Flop
The D flip-flop is probably the most important flip-flop to understand in practical digital design.
D stands for:
Its basic rule is remarkably simple:
At the active clock edge, whatever value is present at becomes the new value of .
10. D Flip-Flop Truth Table
| D | |
|---|---|
| 0 | 0 |
| 1 | 1 |
That’s it.
If:
then after the active clock edge:
If:
then:
This simplicity is exactly why D flip-flops are so widely used.
11. A Simple Example of a D Flip-Flop
Suppose the current output is:
and:
When the active clock edge arrives:
Now suppose changes back to 0 immediately afterward.
The output does not necessarily change immediately.
Instead, it remains:
until the next appropriate clock event.
This gives synchronous systems a controlled method of storing data.
12. D Flip-Flop as a 1-Bit Memory
You can think of a D flip-flop as a tiny memory cell.
Data → [ D Flip-Flop ] → Stored Data
↑
Clock
One D flip-flop stores one bit.
Therefore:
and so on.
A collection of flip-flops forms a register.
13. JK Flip-Flop
The JK flip-flop is a more versatile version of the SR concept.
It has two inputs:
and:
Its behavior is:
| J | K | Operation | |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Toggle |
Notice the important difference.
For the SR flip-flop, the combination corresponding to both control inputs being active is invalid.
For the JK flip-flop:
means:
14. Understanding the Toggle Operation
Suppose:
and:
After the active clock edge:
At the next active clock edge:
Then:
The output changes state on every appropriate clock event.
This makes the JK flip-flop particularly useful in counter circuits.
15. JK Characteristic Equation
The characteristic equation of a JK flip-flop is:
This equation completely describes its next-state behavior.
For example, if:
then:
which confirms the toggle operation.
16. T Flip-Flop
The T flip-flop is even simpler.
T stands for:
Its behavior is:
| T | Operation | |
|---|---|---|
| 0 | Q | Hold |
| 1 | Toggle |
Its characteristic equation is:
17. How the T Flip-Flop Works
If:
the output does not change.
If:
the output changes state.
Therefore, the T flip-flop is particularly convenient for designing counters and frequency-division circuits.
18. Frequency Division Using a T Flip-Flop
Suppose a T flip-flop is permanently configured to toggle:
Then the output changes state once for every active clock edge.
As a result, one complete output cycle takes two clock cycles.
Therefore:
For example, if:
then ideally:
This frequency-division property is one of the reasons toggle-based flip-flops are important in digital systems.
19. Comparing SR, D, JK and T Flip-Flops
| Feature | SR | D | JK | T |
|---|---|---|---|---|
| Inputs | S, R | D | J, K | T |
| Hold | Yes | Yes | Yes | Yes |
| Set | Yes | Through D | Yes | Indirect |
| Reset | Yes | Through D | Yes | Indirect |
| Toggle | No | No | Yes | Yes |
| Main use | Basic control | Data storage | General-purpose | Counters |
20. Characteristic Equations
The equations are worth remembering.
SR
with the invalid input condition excluded.
D
JK
T
These equations are useful when moving from simple circuit understanding to actual sequential-circuit design.
21. Excitation Tables
A characteristic table tells us:
Given the inputs, what will the next state be?
An excitation table asks the opposite:
Given the present state and desired next state, what inputs should we apply?
This becomes extremely useful when designing counters and finite-state machines.
22. D Flip-Flop Excitation Table
Since:
we get:
| Q | D | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Therefore:
23. T Flip-Flop Excitation Table
| Q | T | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
This produces the useful relationship:
In simple terms:
If the state must change, T must be 1. If the state must remain the same, T must be 0.
24. JK Flip-Flop Excitation Table
| Q | J | K | |
|---|---|---|---|
| 0 | 0 | 0 | X |
| 0 | 1 | 1 | X |
| 1 | 0 | X | 1 |
| 1 | 1 | X | 0 |
Here:
The don’t-care conditions can be exploited when simplifying the logic used to drive the flip-flop.
25. Edge Triggering
There are two common edge-triggering types.
Positive-edge triggered
The flip-flop responds to:
the rising edge.
Negative-edge triggered
The flip-flop responds to:
the falling edge.
The choice depends on the architecture of the digital system.
26. Setup Time
A flip-flop cannot accept an input that changes arbitrarily close to the clock edge.
The input must be stable for a minimum amount of time before the active clock edge.
This is called:
and is represented by:
27. Hold Time
The input must also remain stable for a minimum period after the active clock edge.
This is called:
and is represented by:
Therefore, reliable operation requires both:
and:
to satisfy the flip-flop’s specifications.
28. Clock-to-Q Delay
The output does not change infinitely fast after the clock edge.
There is a finite delay between the active clock edge and the resulting transition at .
This is called:
or clock-to-Q delay.
A simplified timing relationship is:
29. Why Timing Matters
Consider two flip-flops connected in sequence:
FF1 ─────────► FF2
↑ ↑
Clock Clock
Data produced by FF1 must arrive at FF2 early enough to satisfy FF2’s setup requirement.
A simplified maximum-frequency relationship is:
where:
- = clock period
- = clock-to-Q delay
- = combinational logic delay
- = setup time
This relationship is fundamental to synchronous timing analysis.
30. Race-Around Condition
The JK flip-flop has a historical timing problem known as the race-around condition.
When:
the output should toggle.
However, in certain level-triggered implementations, if the clock remains active for too long compared with the internal propagation delay, the output can toggle multiple times during one clock pulse.
Conceptually:
This creates uncertainty about the final state.
31. Preventing Race-Around
Several approaches can prevent this problem:
- Edge-triggered flip-flops
- Master-slave flip-flop arrangements
- Appropriate clock-pulse control
The objective is simple:
32. Preset and Clear Inputs
Many practical flip-flops include additional control inputs such as:
- Preset
- Clear
These are often asynchronous controls.
Preset
Forces the flip-flop toward:
Clear
Forces the flip-flop toward:
These inputs can be useful for initializing a digital system to a known state.
33. Flip-Flops as Building Blocks
A single flip-flop stores one bit.
But digital systems rarely need only one bit.
Multiple flip-flops can be connected together to create larger structures.
For example:
By adding suitable combinational logic, these same storage elements can be used to construct counters and state machines.
34. Where Flip-Flops Are Used
Flip-flops are everywhere in digital electronics.
Common applications include:
Registers
Store binary data.
Counters
Track events or clock cycles.
Frequency Dividers
Reduce clock frequency.
Shift Registers
Move data between storage elements.
Finite-State Machines
Store the current state of a controller.
Processor Pipelines
Hold intermediate data between processing stages.
Synchronizers
Help safely transfer asynchronous signals into a clock domain.
35. Flip-Flops and Registers
A register is essentially a collection of flip-flops working together.
Suppose we need to store:
This requires:
Each flip-flop stores one position of the binary number.
The complete group therefore represents one 8-bit word.
36. Flip-Flops and Counters
Counters take advantage of controlled state transitions.
A binary counter might move through:
The flip-flops hold the current state while additional logic determines the next state.
This is why understanding flip-flops is essential before studying counter design in depth.
37. Flip-Flops and Finite-State Machines
A finite-state machine (FSM) must remember which state it is currently in.
For example, a controller might have states:
The current state must be stored somewhere.
That storage is commonly implemented using flip-flops.
Therefore:
and the state memory is commonly built from flip-flops.
38. Metastability
One of the most important real-world concepts in sequential logic is metastability.
If a flip-flop’s setup or hold requirements are violated, its output may temporarily take an unpredictable intermediate behavior before resolving to a valid logic state.
This is especially important when an asynchronous signal enters a synchronous digital system.
A common solution is a synchronizer using multiple flip-flop stages.
The important lesson is:
Timing matters.
39. The Big Picture
At this point, the role of flip-flops should become much clearer.
Logic Gates
↓
Combinational Logic
↓
Flip-Flops
↓
Registers / Counters
↓
State Machines
↓
Processors & Digital Systems
Flip-flops sit at the heart of this progression because they introduce controlled memory.
40. Quick Revision
SR Flip-Flop
D Flip-Flop
JK Flip-Flop
T Flip-Flop
Setup Time
Input stability required before the clock edge.
Hold Time
Input stability required after the clock edge.
Clock-to-Q Delay
Time between the active clock edge and the corresponding output change.
41. Final Comparison
| Parameter | SR | D | JK | T |
|---|---|---|---|---|
| Number of inputs | 2 | 1 | 2 | 1 |
| Hold | ✓ | ✓ | ✓ | ✓ |
| Set | ✓ | Via D | ✓ | — |
| Reset | ✓ | Via D | ✓ | — |
| Toggle | — | — | ✓ | ✓ |
| Invalid input | Yes, for conventional SR form | No | No | No |
| Common application | Basic storage/control | Registers | General sequential logic | Counters |
Conclusion
Flip-flops are among the most important building blocks in digital electronics because they give a circuit something that combinational logic alone cannot provide: memory.
The four fundamental types—SR, D, JK, and T—offer different ways of controlling that stored state. The D flip-flop provides simple data storage, the JK flip-flop provides flexible set/reset/toggle behavior, and the T flip-flop makes state toggling particularly straightforward.
But understanding the truth tables is only the beginning. Real digital systems also depend on clock edges, setup time, hold time, propagation delay, metastability, and timing constraints.
Once flip-flops are understood properly, the next concepts become much easier:
That is where sequential logic starts becoming the foundation of actual computer and processor architecture.


