The JK flip-flop is a basic building block in digital electronics, widely used for data storage, counters, and sequential logic design. It overcomes the limitations of the SR flip-flop by eliminating invalid states and providing flexible control functions such as Set, Reset, Hold, and Toggle. This article explains its working principle, internal structure, truth tables, types, applications, and practical usage.

JK Flip-Flop Overview
A JK flip-flop is a bistable sequential logic circuit that stores one bit of data using two stable states. It has two inputs (J for Set, K for Reset), two outputs (Q and Q′), and a clock input (CLK). Optional Preset (PR) and Clear (CLR) inputs allow asynchronous control.
JK flip-flops support two operating modes:
• Synchronous mode – Output changes only on clock input.
• Asynchronous mode – Preset and Clear override the clock and force output changes immediately.
Unlike an SR flip-flop, the JK flip-flop avoids the invalid state. When J = K = 1, it performs a toggle operation, output switches on every clock pulse due to internal feedback.
JK Flip-Flop Truth Table and State Table
Truth Table (with Asynchronous Inputs)
This table shows how the output responds to clocked inputs and asynchronous preset/clear conditions.
| PR | CLR | CLK | J | K | Q(n+1) | Operation |
|---|---|---|---|---|---|---|
| 0 | 1 | X | X | X | 1 | Asynchronous Set |
| 1 | 0 | X | X | X | 0 | Asynchronous Reset |
| 1 | 1 | 0 | X | X | Qn | No Change |
| 1 | 1 | ↑ | 0 | 0 | Qn | Hold |
| 1 | 1 | ↑ | 1 | 0 | 1 | Set |
| 1 | 1 | ↑ | 0 | 1 | 0 | Reset |
| 1 | 1 | ↑ | 1 | 1 | Q̅n | Toggle |
State Tables (Characteristic and Excitation Tables)
The truth table can be simplified into two important state tables used in design and analysis.
Characteristic Table
Defines the next-state output based on inputs and current state.
| J | K | Q(n) | Q(n+1) |
|---|---|---|---|
| 0 | 0 | Qn | Qn (Hold) |
| 1 | 0 | Qn | 1 (Set) |
| 0 | 1 | Qn | 0 (Reset) |
| 1 | 1 | Qn | Q̅n (Toggle) |
Characteristic Equation:
Q(n+1) = J·Q̅n + K̅·Qn
Excitation Table
Defines the required inputs (J, K) to achieve a specific transition.
| Q(n) | Q(n+1) | J | K |
|---|---|---|---|
| 0 | 0 | 0 | X |
| 0 | 1 | 1 | X |
| 1 | 0 | X | 1 |
| 1 | 1 | X | 0 |
(X = don’t care)
Block Diagram of JK Flip-Flop

The block diagram of a JK flip-flop shows how its key inputs and internal feedback interact to control its output. The J and K inputs determine the set and reset actions, allowing the output to store or change state based on the input logic. The Clock (CLK) signal synchronizes these operations so that changes occur only at specific clock transitions, ensuring predictable timing in digital circuits.
In addition to these primary inputs, the JK flip-flop may also include asynchronous control inputs: Preset (PR) and Clear (CLR). These inputs can immediately force the output to logic 1 or logic 0, regardless of the clock state, making them useful for initializing circuits. A distinctive feature of the JK flip-flop is its internal feedback path, where the current output Q is fed back into the logic network. This feedback enables the toggle action when both J and K are set to 1, allowing the output to alternate states on each clock pulse.
JK Flip-Flop Logic Symbol & Pin Diagram

Logic Symbol
The logic symbol highlights:
• Two inputs: J (Set) and K (Reset)
• One clock input with edge-trigger marker (triangle symbol, often with bubble if active-low)
• Optional asynchronous inputs: PR (Preset) and CLR (Clear)
• Two outputs: Q and Q′ (complementary)
Pin Diagram (Example: 74LS76 JK Flip-Flop IC)

A pin diagram shows how JK flip-flops are implemented in IC packages like DIP-14.
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | CLR₁ | Asynchronous Clear (Active LOW) for Flip-Flop 1 |
| 2 | K₁ | Input K for Flip-Flop 1 |
| 3 | J₁ | Input J for Flip-Flop 1 |
| 4 | CLK₁ | Clock Input for Flip-Flop 1 |
| 5 | PR₁ | Asynchronous Preset (Active LOW) for Flip-Flop 1 |
| 6 | Q₁ | Output Q for Flip-Flop 1 |
| 7 | GND | Ground |
| 8 | Q₂ | Output Q for Flip-Flop 2 |
| 9 | PR₂ | Asynchronous Preset (Active LOW) for Flip-Flop 2 |
| 10 | CLK₂ | Clock Input for Flip-Flop 2 |
| 11 | J₂ | Input J for Flip-Flop 2 |
| 12 | K₂ | Input K for Flip-Flop 2 |
| 13 | CLR₂ | Asynchronous Clear (Active LOW) for Flip-Flop 2 |
| 14 | VCC | Positive Supply Voltage |
Master–Slave JK Flip-Flop

A common challenge in JK flip-flops is the race-around condition, which occurs when both inputs are HIGH (J = K = 1) and the clock pulse remains HIGH long enough for the output to toggle repeatedly within one cycle. This leads to unstable behavior.
The Master–Slave configuration ensures only one output change per clock pulse and prevents unwanted oscillations even when J = K = 1. This method controls the race-around problem by dividing operation into two stages: the Master responds when CLK = HIGH, and the Slave updates when CLK = LOW.
For more advanced clock control methods that also prevent race-around, see Section 9 (Triggering Methods).
JK Flip-Flop Triggering Methods
A direct JK flip-flop using level-triggered clocks can suffer from an issue called race-around, which occurs when J = K = 1 while the clock remains HIGH long enough for the output to toggle repeatedly within a single clock pulse. This leads to unstable operation.
To eliminate this issue, two triggering strategies are used:
| Trigger Type | Description | Race-Around Prevention | Usage |
|---|---|---|---|
| Master–Slave JK | Two latches cascaded; Master active on HIGH clock, Slave on LOW | Limits toggling to once per cycle | Educational circuits, moderate speed |
| Edge-Triggered JK | Captures input only on ↑ or ↓ clock edge | Fully eliminates race-around | Modern synchronous systems |
Clock Edge Behavior Table
| Clock Edge | J | K | Q(n+1) |
|---|---|---|---|
| No edge | X | X | Qn (Hold) |
| ↑ or ↓ | 0 | 0 | Qn |
| ↑ or ↓ | 1 | 0 | 1 (Set) |
| ↑ or ↓ | 0 | 1 | 0 (Reset) |
| ↑ or ↓ | 1 | 1 | Q̅n (Toggle) |
Edge-triggered JK flip-flops dominate practical digital designs because they ensure clean transitions and compatibility with synchronous clock architectures.
JK Flip-Flop Timing Diagram

A timing diagram shows how the output of a JK flip-flop changes in response to variations in the clock (CLK) and input signals (J and K) over time. It is a valuable tool for understanding the flip-flop’s behavior in synchronous circuits.
During each active clock edge (commonly the rising edge, ↑), the flip-flop samples the inputs and updates the output Q according to these rules:
• J = 0, K = 0 → Hold state (output remains unchanged)
• J = 1, K = 0 → Set (Q becomes 1)
• J = 0, K = 1 → Reset (Q becomes 0)
• J = 1, K = 1 → Toggle (Q switches to its opposite value)
A typical JK flip-flop timing diagram includes:
• Clock waveform (CLK) – defines when output updates occur
• Input signals (J and K) – show input states over time
• Output signals (Q and Q′) – display state transitions clearly based on input and clock
This diagram helps visualize the sequence of state changes, making it easier to analyze timing issues, verify synchronous behavior, and understand setup and hold time requirements in digital design.
JK Flip-Flop Using NAND Gates

A JK flip-flop can be constructed using basic NAND gates, which reveals how the device functions internally at the gate level. This implementation is commonly used in digital logic education because it demonstrates how feedback and clock control work to create stable sequential circuits.
The internal logic is built using:
• Two cross-coupled NAND gates that form the basic bistable latch.
• Two additional NAND gates to process the J and K inputs along with the previous output feedback.
• Clock-controlled NAND gates that enable state changes only when the clock signal is active, ensuring synchronous operation.
Functional Behaviors
• Feedback logic prevents invalid states – Unlike the SR latch, the JK configuration safely handles all input combinations.
• Toggle action for J = K = 1 – Internal feedback alternates the output state on each active clock pulse.
• Synchronous operation – The clock input ensures the output changes only at defined times, allowing integration with other sequential logic circuits.
This gate-level construction helps explain why the JK flip-flop is considered universal and reliable. However, due to its relatively complex structure and propagation delay, practical digital systems commonly use edge-triggered JK flip-flops or integrated IC versions instead of building them from discrete gates.
While the gate-level JK flip-flop explains internal logic, practical digital systems must also address timing issues such as race-around. This leads to improved triggering techniques discussed next.
Popular JK Flip-Flop ICs
JK flip-flops are available as integrated circuits (ICs) in both TTL (Transistor–Transistor Logic) and CMOS families. These ICs are commonly used in counters, frequency dividers, shift registers, and memory control circuits.
| IC Number | Logic Family | Description |
|---|---|---|
| 74LS73 | TTL | Dual JK flip-flop with asynchronous Clear; used in basic sequential logic applications |
| 74LS76 | TTL | Dual JK flip-flop with asynchronous Preset and Clear; allows external control of initial states |
| 74LS107 | TTL | Dual JK flip-flop with active-low Clear and toggle capability; ideal for divide-by-2 counters |
| CD4027B | CMOS | Dual JK flip-flop with Set and Reset; offers low power consumption and wide voltage range |
Applications of JK Flip-Flops
JK flip-flops are widely used because they can function as memory elements, toggling devices, and synchronous counters. Common applications include:
• Frequency Division and Counters – Divide clock frequency by 2 in toggle mode
• Shift Registers – Used in serial–parallel data conversion
• State Machines (FSMs) – Control sequence logic in digital systems
• Signal Conditioning – Debouncing mechanical switches
• Clock Pulse Shaping – Generate square-wave signals
JK Flip-Flop vs SR, D, and T Flip-Flops Comparison

| Feature | JK Flip-Flop | SR Flip-Flop | D Flip-Flop | T Flip-Flop |
|---|---|---|---|---|
| Inputs | J, K | S, R | D | T |
| Invalid State | None | S=R=1 invalid | None | None |
| Operation Modes | Set, Reset, Toggle | Set, Reset | Data Transfer | Toggle only |
| Use Case | Counters, Registers | Simple latch | Memory, Shift Registers | Counters |
| Complexity | Moderate | Simple | Simple | Very simple |
| Edge Triggering Support | Yes | Yes | Yes | Yes |
The JK flip-flop is the most flexible among all flip-flops. It can simulate the functions of SR, D, and T flip-flops and is widely used in counters and digital control circuits.
Troubleshooting and Common Design Mistakes
| Common Issue | Description | Solution |
|---|---|---|
| Clock synchronization error | Multiple flip-flops using unsynchronized clocks cause timing mismatches | Use a single global clock source** |
| Input noise or switch bounce | Noisy inputs or mechanical switches cause false triggering | Add debouncing circuits or RC filters |
| Floating Preset/Clear (PR/CLR) pins | Unconnected asynchronous inputs cause unpredictable outputs | Tie unused PR/CLR to defined logic levels |
| Setup and hold time violations | Changing J/K too close to clock transition leads to metastability | Keep inputs stable before and after clock edge |
Conclusion
The JK flip-flop remains a versatile and reliable device in modern digital systems due to its ability to toggle states and handle synchronous and asynchronous operations. Whether implemented using logic gates or integrated circuits, it is used in counters, registers, and control circuits. Understanding its behavior and timing helps you design stable and efficient sequential logic applications.
Frequently Asked Questions [FAQ]
Why is a JK flip-flop called a “universal flip-flop”?
The JK flip-flop is called a universal flip-flop because it can perform the functions of SR, D, and T flip-flops by simply configuring its J and K inputs. This makes it adaptable for various sequential logic applications.
What is the main difference between level-triggered and edge-triggered JK flip-flops?
A level-triggered JK flip-flop responds to the entire HIGH or LOW level of the clock pulse, while an edge-triggered JK flip-flop updates its output only at the rising or falling edge, preventing race-around issues.
How do you convert a JK flip-flop into a D flip-flop?
A JK flip-flop can work like a D flip-flop by connecting J = D and K = D′. This forces the output to follow the input, mimicking the data transfer behavior of a D flip-flop.
What causes metastability in JK flip-flops?
Metastability occurs when the J and K inputs change too close to the clock transition, violating setup or hold time. This can result in unpredictable or oscillating output states.
Can JK flip-flops be used for frequency division?
Yes. When both inputs J and K are tied HIGH (J = K = 1), the JK flip-flop toggles its output on every clock pulse. This divides the clock frequency by 2, making it useful in digital counters and frequency dividers.