Components / Memory
J-K Flip-Flop in Logisim
Universal rising-edge flip-flop in Logisim: J=0,K=0 holds, J=0,K=1 resets (0), J=1,K=0 sets (1), and J=1,K=1 toggles ~Q without an invalid state.
| Library | Memory |
|---|---|
| Type name | J-K Flip-Flop |
| Pins and defaults | j J (-40, 0), clk CLK (-40, 10), k K (-40, 20), rst RST (-20, 30), q Q (0, 0), qn ~Q (0, 20) |
How the J-K Flip-Flop Works in Logisim
The J-K Flip-Flop is the universal 1-bit sequential flip-flop: it eliminates the forbidden (S=1, R=1) state of the S-R Flip-Flop by turning the 1,1 input combination into a clean toggle operation (~Q) on the rising edge of Clock (CLK).
Its characteristic equation is Q(next) = (J · ~Q) + (~K · Q). On the left edge, J is the top pin (set control), CLK is the middle pin with the edge-trigger triangle, and K is the bottom pin (reset control). When J=1 and K=0, a rising clock edge sets Q=1; when J=0 and K=1, it resets Q=0; when J=0 and K=0, Q holds its state; and when J=1 and K=1, Q toggles between 0 and 1.
Tip: Tie J and K together to form a T Flip-Flop, or feed K from J through a NOT gate to form a D Flip-Flop.
J-K Flip-Flop Pins & Pinout
| Pin | Direction | Width | Location & Role |
|---|---|---|---|
| j (J) | Input (Top-left) | 1 bit | Offset (-40, 0). Set input (analogous to S); J=1, K=0 sets Q=1 on rising CLK. |
| clk (CLK) | Input (Middle-left, triangle) | 1 bit | Offset (-40, 10). Rising-edge (0 → 1) clock trigger input. |
| k (K) | Input (Bottom-left) | 1 bit | Offset (-40, 20). Reset input (analogous to R); J=0, K=1 resets Q=0 on rising CLK. |
| rst (RST) | Input (Bottom edge) | 1 bit | Offset (-20, 30). Asynchronous active-high reset (forces Q = 0 immediately). |
| q (Q) | Output (Upper-right) | 1 bit | Offset (0, 0). Stored 1-bit state Q. |
| qn (~Q) | Output (Lower-right) | 1 bit | Offset (0, 20). Complement of stored state (~Q). |
J-K Flip-Flop Truth Table & Behavior
| CLK | J | K | Q(next) | ~Q(next) | Operation |
|---|---|---|---|---|---|
| ↑ (0 → 1) | 0 | 0 | Q | ~Q | Hold (no change) |
| ↑ (0 → 1) | 0 | 1 | 0 | 1 | Reset (clear Q to 0) |
| ↑ (0 → 1) | 1 | 0 | 1 | 0 | Set (set Q to 1) |
| ↑ (0 → 1) | 1 | 1 | ~Q | Q | Toggle (flip Q between 0 and 1) |