The most basic circuit that keeps memory is called a flip-flop. Flip-flops are binary storage devices that store a single bit of data, acting as the building blocks of memory in sequential circuits.
A flip-flop has two stable states ($0$ and $1$), and it changes states based on control inputs or triggers. It holds its state until it receives a signal to switch.
Different flip-flops (SR, D, JK, T) are used based on requirements for control and state behavior. For instance, D flip-flops store input data directly, while JK flip-flops offer flexible control for toggling between states.
They use a concept called feedback, where the output is fed back into the input. This feedback allows flip-flops to hold onto information even after the input signal changes, providing the memory necessary for sequential circuits.