JK flip-flop
The JK flip flop is the most versatile of the basic flip-flops. It has two inputs traditionally labeled J (Set) and K (Reset).
The !Q output is the logical negation of Q
It can also act as a T flip-flop to accomplish toggling action if J and K are tied together. This toggle application finds extensive use in binary counters.
The user can set the initial output state with Initial Value parameter.
The truth table of this block is:
Hold Reset Set Toggle where * `Q n-1 `* is the previous state of * `Q n `* .
The block supports the following types :
Inputs:
- J: scalar. Scilab’s int8 data type only.
- clk: scalar. Scilab’s real double.
- K: scalar. Scilab’s int8 data type only.
A positive input is considered as logical 1, a negative or a null input as logical 0.
Outputs: scalar. Scilab’s int8 data type.
The following example builds a 3 bits asynchronous counter with JK flipflops wired as T flipflops. You can show on the right the timing diagram of the * `Q 0 `* to * `Q 2 `* outputs of counter. `Open this example in Xcos`_