Flip Flops

(Before reading this: i hope you have some knowledge about latches and sequential logic circuits)
In digital electronic flip–flops are circuits which use to store data and generally they have two states .Flip-flops have one or two outputs and the state of it  can be changed using an one or more input signals.
The difference between flip-flops and latches is latches don’t have a clock signal. In other words Flip-flops are synchronous sequential circuits where latches are asynchronous sequential circuits.

In synchronous circuits the state changes are determined by a control signal called clock signal (clk).
And vice versa, in latches state change is dermined by the order in which it’s inputs are changed.



There are different types of flip-flops  ,basically four main types named  as : D, SR, JK, and T.(So what is the difference ?).The main difference in these types is the number of inputs and how they changed their state.Amoung them most commonly usedone is D flip-flop since its simpleness.
SR Flip-Flop

SR flip-flop is made by attaching another two bnand gates and clk signal (hence sometimes called gated SR Latch),so unlike SR latch SR flip-flop only changes the state only the active edge of the clock signal.SR flip-flop can be sued to store one bit so is useful in application where we need to where we want to be able to set or reset the data bit.Below is the  logic symbol and the circuit diagram of SR flip-flop.



S
R
CLK
Q
Q'
0
0
0
No change
0
1
0
1
0
0
1
1
0
0
0
1
Restricted
0
1
1
1
0
1
0
1
0
1
1
1
1
No change

So the SR Flip-Flop is same as SR Latch except flip-flop change the state only CLK is 1 or active.


JK Flip-Flop



JK flip-flop is also very similar to SR flip-flop j=set, k=reset (but then why two names?)  .The only difference is in SR flip-flop when both the inputs are asserted  the next state is undefined but in JK flip-flop the next state is the inverse of the current state.