The flip-flop
So far, all the logic gates discussed have outputs which depend only on the inputs. They are sometimes called as combinational logic gates, as the output state is simply a function of combination of input states.
A flip-flop is the form of sequential logic gate. In the sequential gate, the output state depends on the inputs and the outputs both. The term sequential comes from the fact that output depends not only on the current states, but on the states immediately preceding it. A flip-flop has 2 states, called as set and reset. Usually, the set state is called as logic 1, and the reset state is called as logic 0.
There are several different types of flip-flop.