Menu

Theme

Component reference · Reference · CHECKED ON 5.0.0

JK flip flop in Logisim, and the D, T and S-R flip-flops and latches

The Memory library has four flip-flops (the JK flip flop in Logisim is the J-K Flip-Flop): D, T, J-K and S-R. Each has a clock input, Q and Q̅ outputs, and asynchronous Preset (set to 1) and Clear (set to 0) pins. Trigger chooses Rising Edge or Falling Edge; some also offer High Level and Low Level, which makes them behave like latches. In our test every flip-flop was 0 after a reset and changed only on the rising clock edge.
FOR
Students in a sequential-logic lab
CHECKED
11 Nov 2026
Checked against Logisim-evolution 5.0.0 on 1 machines
On this page

The four flip-flops side by side

Feature D T J-K S-R
Data inputs D T J and K S and R
On the rising edge Q becomes D Q toggles if T is 1 J=0 K=0 holds, J=1 K=1 toggles S=1 sets, R=1 resets, both 1 holds
Level triggers Offered in the Trigger list (see below) Not tested Not tested Not tested
Typical use One bit of a register Counters General purpose Set and reset control

All four share the same pins: data at the top left, the clock below it, Q and its complement on the right, Preset on top and Clear at the bottom (F66). J-K and S-R have two data inputs. The pin names come from the 5.0.0 tooltips; the data pins have none, so their names are ours.

Characteristic tables from our runs

One circuit holds all four flip-flops on a shared clock. A 14-step sequence drives it and Logisim 5.0.0 matched every step (F66). The columns are the inputs D J K S R T, the clock, Preset (PRE), Clear (CLR), and then Q and Q̅ of each flip-flop.

The 14 steps in order. Each row is one step of a sequential test vector (the circuit keeps its state between steps).
#DJKSRTCLKPRECLRqDNDqTNTqJKNJKqSRNSR<set>
000000001010101011
000000000010101011
000000010101010101
000000000101010101
001010000101010101
001010100011001011
001010000011001011
110101000011001011
110101100100110101
000001100100110101
000001000100110101
011001100011001101
011001000011001101
011001100010110101

circ-ff-compare · mainscroll to see all
DDJJKKSSRRTTCLKCLKPREPRECLRCLRD Flip-FlopffDDCLKqDnqDCLRPRET Flip-FlopffTTCLKqTnqTCLRPREJ-KFlipffJKJKCLKqJKnqJKCLRPRES-RFlipffSRSRCLKqSRnqSRCLRPREqDqDnqDNDqTqTnqTNTqJKqJKnqJKNJKqSRqSRnqSRNSR
The four flip-flops with a shared clock, preset and clear. Download it and run the same sequence. CC BY 4.0 · SHA-256 294b27a510e6
Describe this circuit

Components: Input pin D; Input pin J; Input pin K; Input pin S; Input pin R; Input pin T; Input pin CLK; Input pin PRE; Input pin CLR; D Flip-Flop ffD; T Flip-Flop ffT; J-K Flip-Flop ffJK; S-R Flip-Flop ffSR; Output pin qD; Output pin ND; Output pin qT; Output pin NT; Output pin qJK; Output pin NJK; Output pin qSR; Output pin NSR.

  • Input pin D connects to D Flip-Flop ffD (net D).
  • Input pin J connects to J-K Flip-Flop ffJK (net J).
  • Input pin K connects to J-K Flip-Flop ffJK (net K).
  • Input pin S connects to S-R Flip-Flop ffSR (net S).
  • Input pin R connects to S-R Flip-Flop ffSR (net R).
  • Input pin T connects to T Flip-Flop ffT (net T).
  • Input pin CLK connects to D Flip-Flop ffD, T Flip-Flop ffT, J-K Flip-Flop ffJK, S-R Flip-Flop ffSR (net CLK).
  • Input pin PRE connects to D Flip-Flop ffD, T Flip-Flop ffT, J-K Flip-Flop ffJK, S-R Flip-Flop ffSR (net PRE).
  • Input pin CLR connects to D Flip-Flop ffD, T Flip-Flop ffT, J-K Flip-Flop ffJK, S-R Flip-Flop ffSR (net CLR).
  • D Flip-Flop ffD connects to Output pin qD (net qD).
  • D Flip-Flop ffD connects to Output pin ND (net nqD, ND).
  • T Flip-Flop ffT connects to Output pin qT (net qT).
  • T Flip-Flop ffT connects to Output pin NT (net nqT, NT).
  • J-K Flip-Flop ffJK connects to Output pin qJK (net qJK).
  • J-K Flip-Flop ffJK connects to Output pin NJK (net nqJK, NJK).
  • S-R Flip-Flop ffSR connects to Output pin qSR (net qSR).
  • S-R Flip-Flop ffSR connects to Output pin NSR (net nqSR, NSR).

What the sequence showed (F66):

  • Every flip-flop changed only on the rising clock edge. Changing inputs while the clock was 1, or the falling edge, changed nothing.
  • J-K with J = K = 1 toggled.
  • S-R with S = R = 1 on a clock edge left the state unchanged, from 0 and from 1.

Download circ-ff-compare.circ.

Rising edge, falling edge and level triggers

The Trigger attribute offers Rising Edge, Falling Edge, High Level and Low Level (strings in the 5.0.0 table, F73). Rising edge changes the state once per clock cycle. A level trigger lets the flip-flop follow its input for as long as the clock is at that level, which makes it a latch.

See the toggle pair on Oscillation apparent. To get a D latch, use a D flip-flop with Trigger = High Level.

Preset, clear and the starting value

Preset forces the state to 1 and Clear forces it to 0, immediately, with no clock. The state is kept after you release the pin. With Preset and Clear both 1, Clear won and the state stayed 0 after release (F66).

After Simulate, Reset Simulation every flip-flop was 0 (F66). A project option, Memory elements start in unknown/random state (rather than 0), changes the starting value; we did not test it. To start a state machine in a chosen state, drive Preset and Clear from a reset pin.

Latches built from gates

Labs often ask for an S-R latch from two NOR or NAND gates. In Logisim every gate has the same delay, so releasing S and R from 1 together makes both gates flip in step and the circuit oscillates (F76). The built-in flip-flops do not have this problem. The full explanation, the downloads and the fix are on Oscillation apparent.

Clock mistakes that make flip-flops misbehave

Do not AND the clock with an enable signal: it makes glitches. Give the counter or register an enable input instead (Clock and simulation). A toggle switch is a D flip-flop with its complement fed back to D; our rising-edge toggle circuit is the fixed file on the oscillation page.

Version differences

Feature2.7.15.0.0
Default D and T flip-flop ports2.7.1: yes7 ports5.0.0: yes6 ports (F23)
Default J-K and S-R flip-flop ports2.7.1: yes8 ports5.0.0: yes7 ports (F23)
Enable input2.7.1: untested5.0.0: yesnone on the default instance
Trigger options2.7.1: untested5.0.0: yesfour options (F73)

Cells say untested where we did not run 2.7.1. See also all components.

Frequently asked questions

How do I make a JK flip-flop in Logisim?

Open the Memory library and place a J-K Flip-Flop. Connect J, K and the clock. With J = K = 1 it toggles on each rising edge (F66).

What is the starting value of a flip-flop in Logisim?

0 after a reset. Logisim also has a project option, Memory elements start in unknown/random state (rather than 0), that changes this. We did not test that option.

Is the Logisim flip-flop triggered on the rising or falling edge?

Rising by default. In our test, inputs changing while the clock was 1, or the falling edge, changed nothing (F66). The Trigger attribute can be changed.

How do I make a D latch instead of a flip-flop?

Set Trigger to High Level on a D flip-flop. We checked the level setting only in the toggle case, where it oscillated.

Why does my SR latch built from NOR gates say Oscillation apparent?

Releasing S and R together from 1 makes both gates flip in step. Use the built-in flip-flop or avoid releasing both at once. See the oscillation page.

What happens when S and R are both 1?

On the S-R flip-flop, a rising clock edge with S = R = 1 left the state unchanged, from 0 and from 1 (F66).

Where is the enable input on the flip-flop?

The default 2.7.1 flip-flop has one more port than the 5.0.0 one (7 against 6 for D and T). The 5.0.0 flip-flops have no enable input.

Sources

  1. Flip-flop sequence test on Logisim-evolution 5.0.0, logisim.dev lab data: test-data/lab5-2026-11-11-components2/vectors/ff.vec.txt, src/content/circuits/circ-ff-compare

Try: , , ,