What is a flip flop?
The flip flop is the common name given to two-state (flip-flop) devices, which serve as basic memory for sequential logic operations. Flip-flops are widely used for the storage and transfer of digital data and are normally used in units called “registers”, for the storage of binary numerical data.

flip flop

They are the most commonly used memory devices. Its main characteristics are:

They assume only one of two possible output states.
They have a pair of outlets that complement each other.
They have one or more inputs that can cause the Flip-Flop status to change.
Flip flops can be classified into two:
Asynchronous: They only have control inputs. The most widely used is the RS flip flop.
Synchronous: In addition to the control inputs, you need a synchronism or clock input.

Once we have an idea of what a flip flop is, we will describe the most used flip flops.

Flip-Flop RS (Set-Reset)
Use two NOR gates. S and R are the inputs, while Q and Q ‘are the outputs (Q is generally the output to be manipulated.)
Cross-connecting the output of each gate to the input of the other builds the essential regulatory loop in any memory device.

Flip flop rs

To know how a Flip flop works, the truth tables are used.

If none of the inputs is activated, the flip flop remains in the last state it was in.

flip flop rs table
Flip-Flop T
Flip-flop T changes state on each T pulse. The pulse is a complete cycle from zero to 1. With flip flop T we can complement a clock input to the rs flip flop.
flip flop t
The following table shows the behaviour of the FF T and the FF SR at each pulse of t.

Flip-Flop JK (Jump-Keep)
The JK flip-flop is a mix between the SR flip-flop and the T flip-flop.
Unlike the RS flip flop, in the case of activating both inputs at the same time, the output acquires the opposite state than it had.
flip flop jk
The following table shows the behaviour of the JK flip flop
flip flop jk board
Flip-Flop D (Delay)
Flip-flop D is one of the simplest FFs. Its function is to let pass what enters through D, to the exit Q, after a clock pulse.

flip flop d

The following table shows the behavior of flip flop D

flip flop board d

What are the Clear and Preset inputs for?
When flip-flops are being used in circuit construction, you need to be able to control when an FF starts working and the value at which it starts its sequence. For this, flip-flops have two inputs that allow the designer to select the initial values of the FF and the moment in which it starts to work.

These inputs are called in English: Clear and Preset.

Clear – initializes Q to zero regardless of inputs or clock
Preset – initialize Q to 1 regardless of inputs or clock
For both inputs, if they receive the value of:

0: initialize the FF to the corresponding value.
1: flip-flop operates normally
The following figure shows an FF JK with initialization inputs. Notice that both the Clear input and the Preset input have a circle. This means that the input works with a 0.

clear-preset flip flop