A latch can retain data under specific conditions.
There are several types of latches such as D-type and RS (Reset and Set) latches. As an example, the following describes the operation of a D-type latch.
For example, a D-type latch has an input data pin (D), a latch enable pin (LE), and an output data pin (Q). In this case, when LE is Low, Q retains the previous value of D. When LE is High, Q follows the changes of D. The following shows the timing diagram of a D-type latch.