All right, now let us jump into some multiplication, so we're going to continue coaching.
We're going to say when?
Zero one zero.
I want to do multiplication.
That these things out of it.
OK.
Multiplication is a little bit tricky.
It does not really go as easy as addition and subtraction because you cannot really multiply to remember
that map we've talked about, about converting from ideologic to unsigned integers.
Well, it turns out that indeed, still, it's very easy to multiply integers or divide integers, but
it's really not possible to do that because it doesn't matter unless you designed the logic as a circuit.
So unless you're doing the structural, it's really possible to multiply is to deliver vector.
But here we are doing some behavioral meaning that we want some quick way to prototype our circuit and
have it have some kind of multiplication.
So we are going to say you result should equal to the.
As I said, it's very easy to multiply two integers.
So why don't we use casting to our advantage?
What I could what we could simply say is the following.
Let us make some space so that you see what we are doing.
OK, so as I said, we can get it to an integer, so we could say to Integer and I could say a.
Multiplied by two integer.
Multiplied, converting B to that.
And right now, things are not that simple because he is an ideological vector and you cannot really
jump directly from us to be a vector is an integer, right.
So remember the map in order to to convert it to the logical vector to an integer.
First, we need to convert it to an unsigned.
So we're going to have an intermediate step here and we're going to say.
To.
Signed.
And close the parenthesis here, do that the same thing here to underscore unsigned.
And close the parenthesis.
OK, so now we have a logic factor, we convert it to an unsigned, then we convert it to an integer.
So this is now an integer and integers can be multiplied easily.
So we are really good.
That's a great point because we still get a result of an integer and we cannot really assign it to tell
you why, because the result is Usted logic vector.
So we need to convert back to the logic vector.
Looking to recap, we had to ask, did we convert them to insight and then we convert them to an integer
because that's how the math is looking better.
In order to be an integer first need to be and unsigned.
So we are multiplying integer by an integer.
Now it's time to convert back to the logic vector.
Now the result is an integer.
How do we convert from an integer to an entity like a vector?
Well, we first convert to and sine.
So let us convert all of this expression from here.
To hear.
Jen unsign, so we're going to say to.
Unsigned.
Here is the thing, when you are trying to convert from integer to unsigned, you need to specify the
length of the bids.
So in our case, it is a bit like an integer is actually 32 bit.
So when you convert it to an unsigned, you are going to specify do you want this unsigned to be 32
Minstrel's and 16?
Do you want to take this right, because this is 32 bits and we are planning to reduce it when we go
to that site.
So this is why we specify how many bits.
That's a great no.
We are trying to assign this unsigned result to reflect what they'll do is they'll actually the rest
of a vector.
So we need one more step, which is converting everything we have to as to the logic vector.
So everything is coming back one more time as an estimate.
Exactly.
So we put the parentheses and we say, see the logic vector and we close with the SEMICON.
This is why I told you in Behaviorial, you need to learn gassed Guinea, it's very simple.
You just need to understand about how to go from vectors to integer and vice versa and just pay attention
when you're converting from interior to something else that so that that you just specify how many bits
are you planning to convert?
No, this is my daily ritual.
How about we try to compile this test?
OK, here we need to say not to unsign, but just inside.
Here and here, it's not too outside, just outside.
This is how we guessed it.
Let's see if we have Ms.
And we don't have any other errors and now we can start compiling.
So if you are a guest on inside, you don't say to unsign, you just say and sign.
And for the integer, you need to say to integer and veracity doesn't matter.
You don't need to say to us if you just say do to.
So as I said, HGL syntax is a little bit of a thing because it's not really straightforward.
You need to read the words, the details.
Because this is what makes it so powerful, you can create circuits.
This is why it's so detailed now we can test this if we go back.
Dog simulation and let's say in this area, I want to multiply so value, I would create value.
So the operation needs to be zero one zero as we have.
Now, let us compile and see the result.
Well.
So do I, let us change the numbers as well.
So let's say that we are going to multiply eight by maybe.
I don't know.
Twenty five or twenty four.
Let's make it twenty five so we should get one.
And we are simulating and here we go, we got 200.
That's great.
That is amazing.
No, I will not teach you about division as well.
So let us at division in order to do that.
Just copy this.
Everything you just did, you need to be copy.
The lows this year, we're got to say 011 and instead of multiplication, we're just going to put a
division.
Now, that was compiled and then we can simulate so let us remove this addition here and change it to.
Division, so division is 011.
And what we want to divide is maybe a hundred by twenty five, so let's say here we have a value.
And then we have.
Aldworth.
And here we go, we got the phone.
This is exactly what we are looking for.
That's a great.