The JK Flip-Flop (Quickstart Tutorial) (2024)

The JK Flip-Flop is a type of flip-flop that can be set, reset, and toggled. It can be used for making counters, event detectors, frequency dividers, and much more.

In this tutorial, you will learn how it works, its truth table, and how to build one with logic gates.

The JK Flip-Flop (Quickstart Tutorial) (1)

What is a JK Flip-Flop?

Flip-flops are components that can store a digital value on their output. They have a Clock input (Clk) which determines when they can change the state of their output.

Contrary to what you’d think, the two inputs of the JK Flip-Flop, “J” and “K”, are not abbreviations for what the pins do (which is the case for the S-R latch). They were chosen by its inventor Jack Kilby (JK) to distinguish his flip-flop design from other types.

You can see a basic implementation of the circuit below. It’s based on the S-R latch and built with NAND gates:

The JK Flip-Flop (Quickstart Tutorial) (2)

The J and K inputs of the JK flip-flop can be used to set, reset, or toggle the output, like this:

  • J=1 and K=0 sets the output to 1
  • J=0 and K=1 reset the output to 0
  • J=1 and K=1 toggle the output

But for the flip-flop to make any change, its Clock input must be 1. Check out the truth table below:

ClkJKQDescription
0XXQClk in 0 no
change in Q
1 00QMemory
(no change)
1 101Set
1 010Reset
1 11Toggle

An alternative way to implement the basic JK flip-flop circuit isusing two AND gates and two NOR gates as follows (it works exactly like the one built with NAND gates):

The JK Flip-Flop (Quickstart Tutorial) (3)

Get Our Basic Electronic Components Guide

Learn how the basic electronic components work so that circuit diagrams will start making sense to you.

The JK Flip-Flop (Quickstart Tutorial) (4)

Racing Problem

In principle, the basic implementation above works, but a timing problem arises. When the clock is “1” and you want to toggle the output, it will toggle really fast between “1” and “0” until the clock goes back to “0”. This issue is called a race condition.

You can solve this by making the flip-flop pulse-triggered or edge-triggered.

Pulse-Triggered JK Flip-Flop

Below you have a pulse-triggered JK flip-flop based on the Master-Slave principle:

The JK Flip-Flop (Quickstart Tutorial) (5)

As you can see, to build this configuration you need a basicJK Flip-Flop circuit tied together with an S-R flip-flop.

To understand how this version works check out its timing diagram below:

The JK Flip-Flop (Quickstart Tutorial) (6)

As soon as the clock makes a rising edge ↑, which is a change from 0 to 1 (0→1), it triggers the master section. As a result, the value of the outputs in this section changes. These signals are connected to the slave section, but this doesn’t trigger on the rising edge because the clock has been inverted.

Once the clock signal produces a falling edge ↓, a change from 1 to 0 (1→0), it triggers the slave section, causing the Q output to reflect the master’s output value.

So this circuit requires a complete pulse (0→1 →0) in order to change the output. That’s why this configuration is called pulse-triggered JK Flip-Flop.

ClkJKQDescription
0 or 1XXQNo pulse
no change
0→1 →000QMemory
(no change)
0→1 →0101Set
0→1 →0010Reset
0→1 →011Toggle

Edge-Triggered JK Flip-Flop

Unlike the Master-Slave design, which needs a complete pulse, you can also build an edge-triggered design that triggers from a rising edge ↑ or a falling edge ↓.

Below you have the timing diagram for one that triggers on the rising edge:

The JK Flip-Flop (Quickstart Tutorial) (7)

The above picture shows how this circuit just needs a rising edge on the Clk input to change the state of the output Q. And it will only change on the rising edge.

ClkJKQDescription
0 or 1XXQNo rising edge
no change
0→1 (↑)00QMemory
(no change)
0→1 (↑)101Set
0→1 (↑)010Reset
0→1 (↑)11Toggle

To build aJK Flip-Flop that triggers only with rising edge signals, you can use a rising edge-triggered D flip-flop, a NOT gate, and NAND gates as follows:

The JK Flip-Flop (Quickstart Tutorial) (8)

Questions?

Do you have any questions about how this type of flip-flop works? Let me know in the comments below.

More Digital Electronics Tutorials

  • The Binary Number System
  • Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR
  • The S-R Latch
  • The D Latch
  • The D Flip-Flop
  • The JK Flip-Flop
  • The T Flip-Flop
  • The Shift Register
  • Binary Adders: The Half Adder
  • Binary Adders: The Full Adder
  • How To Use Open Collector Outputs
  • 4000 Series IC Tutorials
  • 7400 Series IC Tutorials

The JK Flip-Flop (Quickstart Tutorial) (9)

10 Simple Steps to Learn Electronics

Electronics is easy when you know what to focus on and what to ignore. Learn what "the basics" really is and how to learn it fast.

The JK Flip-Flop (Quickstart Tutorial) (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6460

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.