15. The JK flip-flop¶
The JK flip-flop is a sequential circuit that allows storing a bit of information.
The JK flip-flop is one of the most used flip-flops due to its versatility. Its operation is identical to the bistable RS, except when both inputs J and K are activated simultaneously at a high level (logical 1). In that case, the outputs change to the opposite state to the one they had previously (toggle function), thus avoiding the unwanted indeterminacy of the RS flip-flop.
This flip-flop forms the basis of numerous sequential circuits, such as counters, registers, frequency dividers or state memories.
Truth table¶
Changes in the output of the JK flip-flop only occur when the state of the Clock (CLK) input changes from a low level (logic 0) to a high level (logic 1); that is, during the rising edges of CLK.
The truth table of the JK flip-flop is the following:
| J | K | CLK | Q | /Q |
|---|---|---|---|---|
| 0 | 0 | _↑¯ | Q | /Q |
| 1 | 0 | _↑¯ | 1 | 0 |
| 0 | 1 | _↑¯ | 0 | 1 |
| 1 | 1 | _↑¯ | /Q | Q |
If the two inputs J and K are at a low level (logical 0), when a rising edge arrives at CLK the outputs remain in the same state they had previously.
If input J is high (logical 1), when a rising edge occurs at CLK, output Q goes high (logical 1) and /Q goes low (logical 0). The J input performs a similar function to the SET input of an RS flip-flop.
If input K is high (logical 1), when a rising edge occurs at CLK, output Q goes low (logical 0) and /Q goes high (logical 1). The K input performs a similar function to the RESET input of an RS flip-flop.
If both inputs J and K are at a high level (logical 1), when a rising edge occurs in CLK, the outputs Q and /Q change to the opposite state from what they had before. This behavior eliminates the indeterminacy present in the RS flip-flop and allows other useful circuits to be built, such as frequency dividers and counters.
Exercises¶
What is a JK flip-flop and what is it for?
How many inputs does a JK flip-flop have and what function does each one perform?
Do they have any similarity to those of the RS flip-flop?
How many outputs does a JK flip-flop have and what function does each one fulfill?
Draw the circuit of a JK flip-flop with the names of its inputs and outputs.
Draw the truth table of a JK flip-flop and briefly explain its normal operation.
Can the JK flip-flop have a forbidden or undetermined input?
What can be built with the JK flip-flop thanks to that operation?
Simulate all states of the JK flip-flop with the simulator on this page.