0:17

So, let us say, let us recall how we started the last unit

Â where we started the way we deal with time, we add integer time units.

Â At every time unit t, we want something that can depend with value to compute some

Â kind of function and the output.

Â Some kind of function and the value at the previous time unit, the time t minus 1.

Â So what kind of element do we need in order to provide such a functionality?

Â Well, the missing element, we need something as a very basic point,

Â is we need something to actually remember one bit of information,

Â move one bit of information from time t minus 1 to time t.

Â This is what we have missing.

Â We have lots of combinatorial log, logic so

Â far that can do any kind of manipulations that we want within a single time unit.

Â But actually moving information from time t minus 1 to time t is

Â something that is still missing.

Â Now, if we look about that kind of thing in the way we're,

Â we're in this abstract way that we're thinking about these discrete time units,

Â at that exact time when we switch between time unit t minus 1 to time unit t.

Â This new element must remember the bit.

Â 1:53

These two physical states, it must be able to move

Â between them according to the logic of the previous time unit.

Â Which means, which means it needs to be able to flip between these two

Â kind of different, two, two different physical states.

Â An element that can do that thing, that can flip change situation between

Â two different kind of such states are called Flip-Flops.

Â They flip to 0 and then can flop back to 1, and

Â the point is that this flipping and flopping is something they remember.

Â It's not just a function of the current input, but

Â its something internal to them they remember between time units.

Â So let us view now the basic flip flops that we will you,

Â be using in this course which is called the Clocked Data Flip Flop.

Â This flip flop has a single input and a single output and it basically

Â remembers the input from last time unit and outputs it in the next time unit.

Â 3:02

Then when we look at what the D flip flop will do, at any time unit it

Â will actually return the value that was in the input in the previous time unit.

Â So at time 1, we don't exactly know what our output will be because we haven't

Â specified what happened in the previous time unit.

Â So for us, it's gray, we just don't know what the output is.

Â But once we get to time unit 2, then we know exactly what the output needs to be.

Â It needs to be exactly what the input was at time 1.

Â Similarly at time unit 3, we know it has to be 0 because that was what

Â was the input was at time 2, and so on.

Â At every time point we are having simply the previous signal that was fed to

Â the input, shifted one time unit to the right.

Â And this is what the Clocked Data Flip Flop does.

Â 3:49

And this is going to be the only element that will provide

Â all the sequential logic that we need in this course.

Â And from this we'll need all the kinds of the sequential circuitry that we need,

Â memories, counters, and so on.

Â One thing that I'd like to mention at this point is the meaning of the little

Â triangles that we see at the bottom, at the bottom of the D flip flop diagram.

Â The meaning of this is that we have a sequential chip,

Â a chip that depends on time.

Â As opposed to all previous chips are all combinatorial chips that we had so

Â far, whose output only depended on their own inputs at any given point in time.

Â Here we have a chip whose output also depends on what happened previously and

Â state that's kept inside this chip.

Â This is the only point that we care for this logical dependency of time.

Â Although it's probably also interesting to note that in any physical

Â implementation of a D flip flop.

Â This means that the implementation will also need some kind of

Â access to this clock that we mentioned in the last unit,

Â that actually breaks down the physical continuous time into discrete time units.

Â 5:09

Now at this point, let us say,

Â just say one word about the implementation of the D Flip Flop.

Â In this course, we are going to deal with it as a completely primitive operation.

Â This is something given to you that cannot be manufactured from anything else.

Â But just, you are going to use it, just like you viewed the Nand gate and

Â from D Flip Flop, and

Â the Nand gate you will provide, you will actually build everything in the course.

Â In many other courses,

Â you actually eh, follow what happens in most real life hardware.

Â You can actually construct the flip flop from Nand gates eh, when you actually

Â take the Nand gate and put them into some kind of a loop eh, between each other.

Â This kind of loop basically has them amplifying the same signal again and

Â it allows them to get stuck either in a zero or one state.

Â And with some additional logic you will also be able to manipulate this

Â date from the outside.

Â 6:01

Eh, this kind of logic usually has two steps.

Â The first step is one, is what I've just described having this kind of cycle that

Â allows it to somehow remember information.

Â And the second type step is to actually have some kind of logic that actually

Â provide isolation between subsequent time units.

Â We will not describe in this course how this is done even though it's extremely

Â elegant and beautiful because we basically think it's confusing.

Â We do not think that is the right way to think about a logical circuitry.

Â We think that it's cont, completely worthwhile to keep separate in your head.

Â The combinatorial logic which happens instantaneously and

Â the sequential logic which we don't want to, to thinking about how it,

Â how it is constructed from lower levels combinatorial stuff.

Â But rather think about it as its own primitive block.

Â So now that we can remember one bit from this, we can build everything else.

Â In fact, there is a generic paradigm of how we're going to build

Â all our logic in the computer, and it's going to be a combination of

Â remembering information via this basic D flip flops.

Â And then manipulating them using combinatorial logics that we built in

Â the first two lectures.

Â So in particular the usual way we do things is we have an array of D flip flops

Â which basically compromise all of our memory in the system.

Â 7:18

Their output is going to be fed into some combinatorial logic

Â together with the new input that you get in this time unit.

Â And all of this is going to change the state that we have in the D flip flop for

Â the next time unit.

Â This is the general way we're going to build everything whether it's a memory or

Â a counter.

Â For example, if it's a counter we're going to remember a number in all these flip

Â flops and the combinatorial logic will basically add one to the counter.

Â In this way, every time unit,

Â the new value that we have will be 1 more than the old unit.

Â 7:50

Let us say, actually now look at the first bit that we're actually going to the first

Â device, the first chip that we're going to actually be, build from a D flip flop.

Â And this is a device that actually builds, remembers a bit forever.

Â So the D flip flop provided the basic functionality of remembering a bit for

Â one time unit.

Â If we want to build a memory we want something that can remember a bit forever.

Â We store it, we tell now start remembering this bit and

Â then it keeps on remembering the bit.

Â Such a device, such as chip eh, is defined by the following API,

Â by the following chip that we have that we call the bit chip.

Â It has two inputs, an input bit and a load bit.

Â 8:31

Once we take the load bit and

Â put the 1 into it we want to remember the input bit at that time.

Â When the load bit goes down to zero we want to the, the chip to

Â keep remembering the last time that the, the last input that was loaded into it for

Â infinity until a new load operation is performed.

Â So this is basically the logic that we have.

Â If load at time t minus 1 is 1, then we want to the, the next out,

Â the out at time t to be exactly the input at time t minus 1.

Â Otherwise, we want to output the time t to just keep on being what it is now.

Â Basically the old value that we remember the same as out t minus 1.

Â How can we build such a chip from our humble D flip flop?

Â Before we look at that, let us see what this bit chip needs to do.

Â So again, let's look at two possible signals for load and for in.

Â So for example, we ask for loading in time units 1 and time unit 4, while input is,

Â let's say it's 1 in the first time unit and then it goes down, down to 0.

Â So let's see what do we expect the output of this bit gate to be.

Â Well on the first time unit we don't know the history so

Â we have no idea what the output is, let's put it in gray.

Â Now in time unit 2, it's supposed to be, since we asked for

Â a load at time unit 1, we, what we want in time unit 2 is for

Â the output is to be exactly like the input at time unit 1.

Â Because we have a load at time 1, the value of any time 1 is 1,

Â the output at time 2 should be 1.

Â Now after that, load goes down to 0 for the next 2 time units.

Â So basically what we want is we want the same output to, the same output to remain,

Â just because load is going to 0 even if input changes.

Â So we're going to keep on maintaining the same value for the next 2 time units

Â until load goes up to 1 and then we'll have to see what we're going to do.

Â 10:45

Now let's see what happened at the fourth time unit.

Â At thefourth time unit, load goes up to 1.

Â Load goes up to 1, so now we're asking the chip to load the value again,

Â and the value that we load is the value of in right now,

Â which is the value at time four which is zero.

Â Notice that, that we have to load at time four, but this will only affect the output

Â at time five, because the output at time five is basically

Â the change to the input at time four, only if load at time four asked it to do it.

Â So that means that at time 5, our output will go down to 0 as planned.

Â So this is the intended functionality of the 1-Bit Register.

Â How can we do that?

Â How can we pipe and pipe the value that we remember so

Â it will keep on being remembered until we ask, we ask to change it?

Â 11:33

Well here is the first naive approach.

Â We will take the output, what we currently remember and

Â let's plug it back into the input of the D flip flop.

Â And this way, the D flip flop, unless we tell it to load the new value,

Â we just keep on having the same value and looping inside it if you wish.

Â This is a very basic the ba, the correct idea in general but

Â of course this is not the real chip.

Â How do we connect?

Â How do we put the real input in,

Â if we want to also put the output of the D flip flop back into itself?

Â How does this connection done?

Â So this doesn't quite work, really the way to combine these two possible sources

Â into the D flip-flop, one source which is an output from the previous stage, and

Â another source which is a new input.

Â And which one of them we want to actually plug into the D flip-flop depends of

Â course on whether the load bit is set or not.

Â But we already know exactly how to combine two sources into one output and

Â this is exactly the multiplexer.

Â So, if we actually take the input and fit it into one input of the multiplexer.

Â Take the previous output and fit it into another input of the multiplexer and

Â then load, choose between them, this is exactly the correct functionality.

Â We can actually see how that works by following step by step.

Â So, let's try to follow this implementation and

Â see how it works eh, real time.

Â Again, let us take two possible example inputs,

Â load them in that we get from some other source that we don't care about.

Â And see what our new implementation does when it's fed these two signals and

Â inputs, and what it produces as output.

Â Let us start with time step 1, at time step 1 the ma, there is 1 point,

Â piece of information that we don't know.

Â We don't know what the previous state of the D flip flop was,

Â what the previous out was because it's not specified in this example.

Â So for us it's going to be a question mark.

Â All the other bits we can complete.

Â We know that in is one because that's what we see in our input.

Â We know that load is 1 and so on.

Â Now notice that the multiplexer here, because load is 1 and

Â because in is 1 even though we don't know what is the input to its other input.

Â To its eh, down to its lower input, we still can tell very well

Â what the output is, what the output of the multiplexer is and that's going to be 1.

Â 13:42

Now eh, that we know what the input to the D flip flop at time unit 1 is, so

Â even though we don't know the output at this point time unit

Â we know everything about the input.

Â Now we can see,

Â now this implies exactly what is going to happen in the next time step.

Â In the next time step, the one that was the input

Â of the D flip flop is going to be passed and is going to be the output of the D

Â flip flop in the next time unit exactly when we switch between time units.

Â Now we can fill up the rest of the information about what

Â happens in the second time unit.

Â In the second time unit, we know what in is, that was our input.

Â We know what load is, we have the previous out so

Â we can calculate exactly what the multiplexer does.

Â And the multiplexer basically, basically picks the previous output

Â from the ori, from the old value of the DFF.

Â 14:32

And then we exactly, we again, we know what the input to the, to the D, D,

Â D flip flop is going to be.

Â It is going to be again a 1, and this we can keep on doing step after step.

Â At each point in time we know the previous values.

Â We know what load is, we know what in is, we can compute what the next situation is,

Â and at every given point in time, we can write down the values and

Â all the different wires just like we did, did in combinatorial logic.

Â