J-K Flip-Flop
Model a negative-edge-triggered J-K flip-flop
Libraries:
Simulink Extras / Flip Flops
Description
The J-K Flip-Flop block models a negative-edge-triggered J-K flip-flop. The J-K flip-flop block has three inputs, J, K, and CLK. On the negative (falling) edge of the clock signal (CLK), the J-K Flip-Flop block outputs Q and its complement, !Q, according to the following truth table. In this truth table, Qn-1 is the output at the previous time step.
Note
The J-K Flip-Flop block treats a nonzero input as true
(1
).
J | K | Q n | !Q n |
---|---|---|---|
0 | 0 | Q n-1 | !Q n-1 |
0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | !Q n-1 | Q n-1 |
When J is 1 and K is 0, the flip-flop goes to the set state (Qn is 1). When J is 0 and K is 1, the flip-flop goes to the reset state (Qn is 0). When both J and K are 0, the flip-flop stays in the previous state (Qn is Qn-1). When both J and K are 1, the flip-flop toggles (Qn is the complement of Qn-1).
Logic Signals as Boolean or Double Data Types
The Implement logic signals as boolean data (vs. double) configuration parameter setting affects the input and output data types of the J-K Flip-Flop block because this block is a masked subsystem that uses the Combinatorial Logic block. For more information about this configuration parameter, see Implement logic signals as Boolean data (vs. double).
Ports
Input
Output
Parameters
Version History
Introduced in R2008b
See Also
S-R Flip-Flop | Clock | D Latch | D Flip-Flop