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.