 In this video, we're going to summarize how the digital circuits called flip-flops work. And we're going to study three types of flip-flops. The first type is what is known as the SR flip-flop. This circuit has three inputs, S, R, and a clock, and two outputs, which you're going to call Q and Q-bar, which have the property that at all times Q and Q-bar have opposite values. In other words, if one of them is 1, the other one is 0, and vice versa. Now, the interesting thing about this circuit is that the signals Q and Q-bar will make a transition to certain values, but only depending on the values of S and R, and when the clock has a raising edge. The clock is a signal that has this shape. So this type of circuit over here is going to make a transition, and by a transition we mean that the value of Q and Q-bar will change, but only when two conditions are given, which is certain values of S and R, and most importantly, when the clock makes a raising edge transition. So the truth table or the characteristic function of how the circuit works is represented as follows. So I have the values of S and R at time t, and I want to know what is the value of Q at time t plus 1. I do not write the value of Q-bar because I know it's the opposite of Q. And again, this transition from t to t plus 1 takes place when the clock has one of these raising edges. So we have four possible combinations, 0, 0, 0, 1, 1, 0, and 1, 1. And the behavior of this circuit is such that when S and R are 0 and the clock makes one of this transition, then Q will remain exactly as the value that it had before. In other words, when S and R are 0, the clock transition creates no transition in the output. The output maintain or both outputs maintain their values. However, when we have a 0, 1 combination and a clock transition comes, then the output of the circuit becomes 0. In other words, when I have a 0, 1 combination here and the clock ticks and the clock makes this transition, then this value will become 0 and this value will become 1. This combination 1, 0 will make a transition such that Q at t plus 1 will become 1. And this latch or flip flop has a very interesting property, which is when both inputs are 1, the output at the next time cannot be predicted. In other words, basically this case should be avoided. Okay, so after looking at this, we're going to see two more types of flip flops, which are similar. The first one is the JK flip flop, which has again three inputs, JK and clock, and the same two outputs as before, Q and Q bar. So this flip flop over here behaves very similar to this one with a slight difference. And this is represented by the transition table. We specify the values of J and K at time t and we calculate the value of Q at time t plus 1. As in the previous case, we have four possible combinations, 0, 0, 0, 1, 1, 0, 1, 1. And the JK flip flop behaves similar to the SR flip flop, except that in this fourth transition over here, whenever both signals are 1, 1, the flip flop, rather to be instable, like in this case, what it does is it changes the value of its output. And the other three combinations are the same as in this case. With a 0, 0, the output remains the same. With a 0, 1, the output is a 0. And with a 1, 0, the output is a 1. Now, we should remember that these transitions or these rules apply when I have the values at the inputs and, very importantly, the clock makes a transition as a racing edge. Now, the third type of flip flop, which is very simple, it has only two inputs which are called D and, of course, the clock and two outputs which are, again, Q and Q bar. As in the previous case, these signals always are opposite to each other and the transition table in this case is simpler. We just need to know what is the value of D at time T and then what is the value of Q at time T plus 1. And this is the simplest of all transition tables. When D is 0 and the next racing edge comes, Q will become 0 and with D is 1 and the next edge comes, Q becomes 1. Now, out of these three, clearly the easiest one to remember is this one because we can say that in the D flip flop the output follows the input whenever the clock ticks. This case is also easy to remember if you think of S as representing set and R as representing reset. Then, as you can see, when R is 1, the flip flop is resetting or setting its value to 0. When S is 1, the value of setting its value, or the flip flop is setting its value to 1, 0, 0 means neither set nor reset. It means that it remains the same and with the SR flip flop, as we previously said, 1, 1 is to be avoided. And the JK flip flop is very easy to remember because J is the equivalent of S, K is the equivalent of R, with the exception now that when both of them are 1, these outputs change their value. They become the opposite value as before. So, let's take another look at how these flip flops work. Now, let's assume that I have a 0 at the output of this flip flop. And now I have a 1 at S and a 0 at R. Now, in this situation, as we can see, this table is telling me that a 1-0 situation here will produce that Q will become 1 when the next clock ticks. In other words, as long as we are in this area in which there is no raising edge, this circuit remains like that. But as soon as this edge comes in, as soon as the clock has this raising edge, this table ticks is evaluated and therefore the 1-0 combination means that the output becomes 1. Again, the most important thing to remember is that this table is only evaluated when the clock has these raising edges. Let's study another case for the JK flip flop. Let's imagine that we have a 0 value here and now we have both inputs equal to 0. Again, time goes by and by the time the clock makes a tick, makes this transition, this table is telling us that Q of t plus 1 is equal to Q of t, meaning that this signal remains equal to 0. However, if now we have a 0 in K and a 1 in J, if we look at this table, it's telling us that the flip flop should get the value 1 at its output whenever I have one of these transitions. So by the time the clock makes this transition, then this output becomes 1. Now let's suppose time keeps advancing and now this input changes from 0 to 1. This table is telling me that by the time the next clock raising edge comes, the flip flop should change its value from the current value to the opposite. What this means is that whenever the clock makes that transition, this one will become a 0. And if both inputs remain exactly with this value and another clock comes, another clock raising edge comes, then this value will switch again to 1 and another raising edge will switch again to 0 and so on. And finally, the third type of flip flop is very simple. If we have a 1 here and a 0 here in this situation, as soon as the raising edge of the clock comes, this one moves over here and it takes the value 1. If another raising edge comes on the clock and these two signals are identical, there is no change. And if the input changes to a 0, the next raising clock will change it again to a 0. So the most important thing to remember is that this transition table is specifying the value of the output at the next raising of the clock. And very importantly also to remember is that outputs remain constant at all other times. So another way of looking at it, the common property of these three circuits is that the transition in the outputs only occur when there is a raising edge on the clock and they occur based on these three transition tables that we have depicted here.