Difference between latch and flip-flop

digital-logicflipfloplatch

What is the difference between a latch and a flip-flop?

What I am thinking is that a latch is equivalent to a flip-flop since it is used to store bits and is also equivalent to a register which is also used to store data. But after reading some articles on the internet I found differences between latches and flip-flops based on edge triggered and level sensitive functionality?

What does that mean? Is a flip-flop the same as a latch or not?

Best Answer

The basic difference is a gating or clocking mechanism. For example, let us talk about SR latch and SR flip-flops.

An SR Latch will look like this

SR Latch using NAND gates

In this circuit when you Set S as active the output Q would be high and Q' will be low. This is irrespective of anything else. (This is an active low circuit so active here means low, but for an active high circuit active would mean high)

An SR Flip-Flop (also called gated or clocked SR latch) looks like this.

enter image description here

In this circuit the output is changed (i.e. the stored data is changed) only when you give a active clock signal. Otherwise, even if the S or R is active the data will not change. This mechanism is used to synchronize circuits and registers so that the data does not change unnecessarily.