so what is difference between latch and flip-flop in this presentation we are going to find out the answer for this common question in digital electronics the circuit here you can see is a familiar one to you we have already discussed it it is your s r latch okay there is no control input given to it and in this case when there is no control input the inputs SN R can be changed accidentally or intentionally therefore this circuit is not suitable for use so we need to introduce a control input by which we can decide that
when we have to change s or R so that our output Q and Q complement will be stored until we have to use it so let's see how we can introduce a control input to this circuit we need two more NAND gates for this purpose the first NAND gate will go here and the output of this NAND gate will connect to the s the second NAND gate will go here and the output of this will connect to our okay now let's see what are the inputs of this two NAND gates there is one common input
to the gates and it is your control input okay the other input for this first NAND gate is your s now and I will call this as star okay and the second input to this NAND gate is now R and I will call it as R star the working of the circuit we will see in the next presentation when we will discuss as a flip-flop but for now you need to know the difference between the latch and the flip-flops so let me tell you one thing this circuit that I made can be used as a
latch as well as a flip-flop let's see how we can use this circuit for the latch the only thing that decides whether the circuit is acting as a latch or as a flip-flop is this control input if this control input is not a clock just enable en enable whenever this is high the latch will operate okay so when this is enable it means that it is what it is level triggered it is sensitive to the level triggering okay what I mean is that let me draw first enable if enable is something like this I have
taken a random enable signal then this circuit will be operational when the enable is high for this period for this period and for this period and the circuit will not be operational when the enable is low for this period for this period and for this period it's a very simple thing whenever this is the case it will act as the ledge okay now what happened in the case of flip-flops but before actually going to the flip-flops let me first explain you why this circuit is operational when the enable is high it's very simple if I
write the value for s star then it will be s complement or en complement so if the value of e n is equal to 1 okay which means s star is equal to s complement and when the value of en is equal to 0 or when it is low the value of s star is equal to what 1 similarly R star will also be equal to 1 because enable is given as the input to both of this NAND gate and in whenever there is SR latch with 98 1 1 is what your memory so whatever
the value or the state is stored in this latch is is stored until we will change e n so that's why we call it SR latch with controlled input okay so this is the working for this and this case when there is enable we will call it as latch now let's see when the circuit will act as the flip-flop it will act as flip-flop when we are having clock block in place of enable so so the clock you already know in the last presentation the working for the clock the duty cycle is 50% for the
clock this is your clock but it will be flip-flop only when there is the triggering we call as the edge triggering which means when the clock goes from low to high or high to low during this period only the circuit is operational and in that case we call it as the flip-flop so at the last I want to give the conclusion for the difference between the latch and the flip-flop the conclusion is that latch is level sensitive okay whenever there is input it will check the input ok if it is enabled okay but in case
of flip-flop it will check for the input and the circuit will be operational only when the clock is changing from high to low or from low to high so this is the difference between the latch and the flip-flop I hope you got it in the next presentation we will start with our SR flip-flop because now we are having everything that we required to move on with our flip-flop so this is all for this presentation see you in the next one