Hello, guys, and welcome back.
And this like we're going to start designing of alien using the behavioral model, so that does get
started and see how we can do that.
We're going to create a new video file.
We have introduced a few concepts that we're going to use here, which are the data types like the logic
and signed signed integers, but have also introduced processes and cases.
And of course, you have introduced the difference between structural, behavioral and data.
So we're going to combine some of these concepts that we have talked about and this Alio design.
So let us start by defining our library.
So we already know that we have the library likably.
We also have to use iterable e
Dealogic one.
One six four oh, OK, now I need to add two more data types, one of them is the unsigned and the other
one is the numeric.
So those will help us to use integers and unsigned types.
So the first one is used by triple A.
Does capacity logic.
And so.
That all
next we have the use I really dot numeric data.
OK, so the numeric is the library that is going to.
Allow me to use integers in Virginia, so let us start with our entity.
We're going to call it Aliyu is, and then we have Fort.
Now, what are we going to put in this boat?
We need a B for that to operate that we're going to use in order to perform operations on.
So it's an input of the logic vector.
Now, this al humoral design will be eight feet so it can handle up to eight feet, meaning it can handle
the range between zero and 255.
What we are dealing with inside numbers.
So this is is it the seven Dow?
Two zero.
Zero zero.
OK, and it is an input.
It is also understood the logic, the vector, and we're going to support aid operations.
So in order to support IT operations, we need three bits, right.
So two down to zero.
OK, next, we have the result.
The result is an output.
Of course, there's also Dealogic vector
and it is seven down to zero.
Finally, since this is an emu, it's important to have a carry out.
So when you have an overflow, we can see it in the carry out.
So this is an output and it is only one bitrate.
I carry a carry out.
There's only one bit.
Now let's close the seven column here.
It'll start with the architecture.
Behavioral.
Of failure
is No.
We are going to define a signal.
A signal for a reminder is just an intermediate signal in between two components.
OK, so when you're connecting to components with the wire, this intermediate wire between two components
is a signal.
It's not an input.
It's not an output.
It's just an internal signal.
So we define a signal, we call it.
And new result.
And this will be just like a small buffer that we will use before we out with the final results.
So this is a in logic vector and it is seven down to zero.
That's a great next.
Now, let's start our process.
We need to begin we need a process here because we need to execute this sequentially.
And we have our sensitivity list will depend on a B and deal.
So if it changes or B changes or the operation changes, I want to evaluate this process.
We have talked about the processes and different video.
You can go back there if you don't remember how exactly.
So this is the beginning.
Now we need to start the case and this case will depend on the operation.
And by the way, it's really very similar to the C case, if you know any programming language, like
to see if you have programmed Adreno before.
I mean, I'm sure that you have seen a case like that.
So Gaist operation.
What we're saying here is when.
It equals to zero zero zero.
Meaning this is an addition, I want to do something which is ehl, you resiled.
Is going to equal to A plus B, OK, as simple as that next when?
It goes to zero zero one.
You want to subtract, so I'm going to say A minus B.
So when it is one zero zero one, it will give us this is a subtraction.
Know we use the double dastgir in order to add a comment.
A comment does nothing to just for you to understand your code.
So this comment does not compile at all.
That's a great next.
What are we going to do when the operation is using?
What is very simple, we would say you whistle in this case, I wanted to equal to a mine speech.
That's realistic.
All right.
So depending on the operation in the case, we're going to either jump for this condition out of this
country for now, I just want to test these two conditions and then I will continue the upcoming lectures
with more cases.
But for now, look, this simple logic.
So let us finalize this by saying first we need to end the case.
Next, we need to end the process.
And one more thing.
If my operation is not zero zero zero zero zero one, I wouldn't have a default operation.
So I can say when others.
Meaning?
What operation is maybe a zero one zero or one one one or whatever, I want to do something else.
What I want to do is I want to say maybe just output a very good sale.
You bristled.
Is he called to say, OK?
And here I forgot the result of this, and it is only a result of, you know, since this is a case,
it's important that we assign the result to a signal.
And then at the end, I would say that my result, which is the output, which mean this output here,
this result is going to equal to Aliu result.
So I am assigning the final output value here to this intermediate signal.
OK.
So when you have a case, as I said, it's really better if you just assign your results like that as
a signal for every case.
And then when you finish the process, you just assign your output to this intermediate signal.
OK, let's end the behavioral.
No, I'm going to show you how we can do that coming up in the next lecture.
But for now, let us simulate this and do something useful.
So let us save.
Let's call this Alan.
And let us compile.
All right, we have some areas let's see what kind of figures we have.
So here we need to say and tell you a little something on.
And now let us simulate this so we need a new file.
We need a new bwl.
Let us.
Those signals listen and everything, OK?
All right, we have an issue.
See, we're getting the wrong signals.
Why?
Well, it's good that we went into this area because this is what happens when you don't put your file
as a top.
See, we need to set this as a top level and then compile again.
All right.
Now, let us try, if we will, get the right signals in the file.
So, again, you and let's hope that we get the right signal names list.
OK, and these are the right signals, right before we were getting signals from the other side before,
OK.
Now that the same this file, we're going to call it a value, the same as that.
The file.
Now, this is my baby and operation.
I'm going to say that my A.
Let me make everything first as a site.
And simply.
But I think like value, true value, and then just say this is like maybe 50.
And again.
Value over three value.
Seventy eight.
And the oppression is zero here.
They want the operation from here to here to be a war so value.
I wanted to be sure as one.
So here we are adding and subtracting.
First, let's have a just a normal case and then we can test, so let this be a hundred, OK?
And now let us go to simulation settings, restore default, and of course, delete this line, save
and simulation and let's see.
And here we go.
We got the right result.
That's a great.
Now, let's say that this number is larger than the other number.
Let's say what kind of behavior we would get.
So I'm going to say that this value here is something bigger than a hundred.
So let's say maybe this is a hundred twenty.
OK.
And let us simulate this and see what's going to happen.
And as you can see.
We got 220 and some value.
Why?
Well, because we are subtracting 220 from 100.
And this is an unsigned representation.
It means that when this is an unsigned representation, we're going to be holding back.
So let's say we have a hundred.
The subject, it's zero, then we have minus 20, which means we are going to start rolling back.
So zero minus 20 is actually two hundred thirty six if you go back from 255 hundred.
Right.
So this is why you're getting two hundred thirty six.
And this is what they were saying, that estie Dealogic vector, when you try to subtract it or when
you try to incremented above its limit, it's going to roll back.
This is what happened to you.
Now let's say that the graphics here assign I'm going to find minus 20 as simple as that.
But at the same time, the presentation here will be void because, well, a bit the range is going
to be from minus one hundred twenty 128 hundred twenty seven.
And well, if I try to add these, it's above the range of hundred twenty seven.
Right.
That's why I'm getting every value right.
So right now, let's say we put values in range, so here maybe over 20 instead.
So this is value.
Or let's say here, I'm going to have something else like maybe seven.
I'm going to go to value, which we value.
Let's say that I have a seven year.
And now let's simulate, as you can see, some seven plus on Iraq is under seven and seven minus on
the 20.
Well, if we put their presentation as a sign, it's going to be minus the 13.
That's correct.
So O'Reilly is working perfectly for addition and subtraction.
We're going to continue later in the upcoming lecture.