# D/T/J-K/S-R Flip-Flop

 Library: Memory Introduced: 2.0 Beta 1 Appearance:

## Behavior

Each flip-flop stores a single bit of data, which is emitted through the Q output on the east side. Normally, the value can be controlled via the inputs to the west side. In particular, the value changes when the clock input, marked by a triangle on each flip-flop, rises from 0 to 1; on this rising edge, the value changes according to the corresponding table below.

D Flip-Flop T Flip-Flop J-K Flip-Flop S-R Flip-Flop
DQ
00
11
TQ
0Q
1Q'
JKQ
00 Q
01 0
10 1
11 Q'
SRQ
00 Q
01 0
10 1
11 ??
Another way of describing the different behavior of the flip-flops is in English text.
• D Flip-Flop: When the clock rises from 0 to 1, the value remembered by the flip-flop becomes the value of the D input (Data) at that instant.

• T Flip-Flop: When the clock rises from 0 to 1, the value remembered by the flip-flop either toggles or remains the same depending on whether the T input (Toggle) is 1 or 0.

• J-K Flip-Flop: When the clock rises from 0 to 1, the value remembered by the flip-flop toggles if the J and K inputs are both 1, remains the same if they are both 0, and changes to the K input value if J and K are not equal. (The names J and K do not stand for anything.)

• R-S Flip-Flop: When the clock rises from 0 to 1, the value remembered by the flip-flop remains unchanged if R and S are both 0, becomes 0 if the R input (Reset) is 1, and becomes 1 if the S input (Set) is 1. The behavior in unspecified if both inputs are 1. (In Logisim, the value in the flip-flop remains unchanged.)

## Pins

West edge, marked by triangle (input, bit width 1)
Clock input: At the instant that this input value switches from 0 to 1 (the rising edge), the value will be updated according to the other inputs on the west edge. As long as this remains 0 or 1, the other inputs on the west edge have no effect.
West edge, other labeled input(s) (input(s), bit width 1)
These inputs control how the flip-flop's value changes during the rising edge of the clock. Their exact behavior depends on the flip-flop; the above tables summarize their behavior.
East edge, labeled Q, north end (output, bit width 1)
Outputs the value currently stored by the flip-flop.
East edge, south end (output, bit width 1)
Outputs the complement of the value currently stored by the flip-flop.
South edge, east end (input, bit width 1)
Asynchronous reset: When 0 or undefined, this input has no effect. As long as it is 1, the flip-flop's value is pinned to 0. This occurs asynchronously - that is, without regard to the current clock input value. As long as this is 1, the other inputs have no effect.
South edge, west end (input, bit width 1)
Asynchronous set: When 1 or undefined, this input has no effect. When 1, the flip-flop's value is pinned to 1. This occurs asynchronously - that is, without regard to the current clock input value. As long as this input is 1, the other inputs have no effect, except for the asynchronous reset input, which has priority.

None.

## Poke Tool Behavior

Clicking a flip-flop using the Poke Tool toggles the bit stored in the flip-flop, unless the asynchronous set/reset inputs currently pin the flip-flop's value.

## Text Tool Behavior

None.

Back to Library Reference