Hello, guys, and welcome back.
Now we have a project that we need to design, it will let us combine all the concept that we have learned
so far.
Every concept, and then we're going to combine them into one small project.
This project is actually consist of two design styles.
One of them is behavioral and the other is the structure.
So the overall is structural, but some of the components, like the glue, the FSM, they are, well,
behavioral.
So.
The design will work as follows, we have an ACLU and the ACLU is going to add to numbers.
Now, basically, these two numbers will come from just through and we're just.
So you're going to store your data in both of these small gestures.
They will come to the ACLU right here and depending on the operation.
We're either going to add them, subtract them, conduct some binary operation on them, multiply them,
divide them, whatever we want.
We've already designed this ACLU and you know exactly what I'm talking about.
It has multiple capabilities now.
After that, the result will be stored and latched in this third register.
Now, this third register can be fed back through a multiplexed so that you can multiply or some this
result one more time with four just to be OK.
So here it has two modes.
Either it performs an operation or A or B or it performs on operations on our C and or B in a condition.
That or C already contains some value.
And the only way that RC can contain value is when there was an operation already conducted from al-Janabi.
OK, so if you follow this data flow, the data to this first input can either flow from RC or from
depending on the select signal.
So if this is zero, well, or a will pass if the select is one, obviously is going to pass through
this multiplexed to this elite.
Now, that's a really good design and it's a really good start so that you can put all of these concepts
together.
Additionally, we have in FSM, the FSM will do all the control, the flow for us.
And actually using this FSM, we're going to decide which mode this dataflow will operate in.
OK, so.
Let us see how will the overflow look like I have five states, as you can see.
First one is in it, or initialise after initialised, I have fetch and this fetch actually is going
to store data or an or B. This is the first to flow from in it to fetch then to process.
The process is where the data will come to the value and it is going to be calculated.
Then after the process we have the right result and right result is nothing but the result here being
stored at RC.
Now, this is the first flow of work coming from it, fetch process, right result.
You can follow the oath now.
There is another path which is in it accumulate, then process their right result, then go back.
This means after we go to end it, we go to accumulate and accumulate is actually taking this or C and
taking it back to the ACLU here.
So either we take from A from fetch or we take from accumulate, meaning we are taking from our C instead
of 4A.
Again, this multiplexed by controlling it, we defined which data which passes it or C or OK then the
path will continue as the previous path.
We got to process the right result, back them back to in it.
Now what should we.
Our inputs and outputs when we are defining these two parties, let us see what we are at fetch.
What we are looking for is storing when we are in it.
We are not looking at anything.
We just want our data flow here to be in an idle mode, meaning nothing is happening.
So.
Right a.
Right to be and right see and feel like I want them all to be zero, this FSM will make sure that either
A or B or C and select are actually zero.
And here this is actually connected to this hour, so we are connecting you by label.
OK, so this RB is connected to Star B or C or C, select select and that's it.
OK, so no.
Let's say that I hit start, as you can see, I have to start accumulating everything if my start is
equal one and accumulate equal zero.
Well, I want something to happen here.
What I want is I want to jump to fetch.
So start one, accumulate zero will make me jump to fetch in fetch.
What I'm looking for is to store whatever data is put on this data zero and data on both.
Right.
So I want to write a in order to store data zero and I want the right to be in order to store data one.
Right.
In order to do that by FSM is going to generate a signal for A and or B in order to store this data.
Now I see I don't really think about it.
So it will stay at zero and select.
You need to be at zero because.
Well, I want the path to be passing through already today on you.
Right?
I mean, if you select this one, it means I'm taking the data from our see, this is not what I want.
Right.
So select equals zero.
Now, next, after the FSM has set this for me, I wanted to jump to process now in process.
I just want the signals to be whatever the signal was, in fact.
Right.
So in it was right equals one right equals one, etc..
In process.
I just want to keep the outputs here of the FSM as they are OK, because in process I am waiting for
this alio to calculate its values and it may take one cycle.
So I'm giving it one cycle and it calculates next I'm jumping from process to write result.
Now in the right result, what I'm looking for here is just to store the result as the output of this
value in our C right.
So the results will come here.
It will be waiting until I strike it within.
Right.
C with a signal right here.
So when I jumped right result simply this FSM is going to generate the signal ultraright C and the data
Adell you output will be stored at our C, ok.
And then after that, I want to go back and pull all the signals back to zero.
OK, so by that I have restored my result in RC over the stock on values and we are in idle but with
values and all the resistors.
Now, that's a great now let's say I want to do some operation on the result with a number on our B,
how can I do that when I am in idle.
I could say I want to record one and accumulate the record one.
Well, that's a great so I start with one and accumulate with one and I won't be jumping to fetch.
I will be jumping to accumulate.
Now, the properties of accumulate is that it's going to write a new data to be or it can keep the previous
data.
It's up to whatever is on the database.
We're going to write whatever data one.
If the did not change, well it will stay as it is.
That's great for RB.
However, I am changing the select to one meaning select is now one.
So the data is coming from or C it means that the value is ready to calculate our C and or B and some
operation in between the.
So in accumulate I will just change the multiplex or path.
And if I want, I can write in your data Trabi, and that's it, and this data will flow to the Olympics
now after that it'll jump to process and we'll keep whatever control bids were in, actually.
Right.
Why am I keeping them like that?
Because I want Selek to stay at one.
This is why I said keep last, because here it is, keeping select zero, keeping the flow from ORAY
and if I accumulate, I am keeping the last values, which is the select being at one meaning the data
is coming from our.
So keep less value of fetch.
Give us your data from our a give best value for accumulate.
Keep the data flowing from our sea to the ACLU.
Now after our process this Alia's to calculate whatever the operation in between our and or be and then
I am going to pull or right.
See in order to write the new in our sea and then I will jump back to it and that's it.
This is what we're going to design.
No.
What happens if I hit reset?
Well, reset is actually going to make me jump from any state to the in it.
OK, so if I strike this reset, it doesn't matter where I am, I will always jump back to the in it.
Now, I'm sure that you've seen billions of devices off of other devices that have reset functionality
and this is what reset does.
It brings your machine or electronic device into a very well known state where it is known what's going
on.
So let's say there is a bug in all of this state machine.
This is why I have a reset.
It will jump me back to the state and then I could maybe trace the error or maybe if this unexpected
error happens due to some noise in the signals due to some external environmental.
Well, the reset will join me back to the Senate and everything will start over.
So this is it for the state machine for now, and we're going to start implementing this.