A flip-flop is a basic component of computer memory that has two main states (0 or 1) and remains in that state even after the input is removed. There are two main types of flip-flops - NOR and NAND - which are made up of basic latch components. A latch uses feedback to remember its state, and flip-flops add a clock that controls when the latch can change states.