Now, let us create a new component.
Now, we've talked about Mr. that does create one village deal and simulated.
So let's go to New and the village Delfi.
So the first thing that we're going to write is actually the same cliche that we write every time,
so I'm going to just copy paste it up the library I triple E, we had the use.
I even talked about all of these before.
Also, we have the end.
Also, we have the entity.
And also, we have the entity.
And the entity is called Multiplex or two to one eight bits, so it's going to be called Multiplex her
two to one eight.
I'm going to call is and then we're going to open a port in order to put all the inputs and outputs.
And then we're going to start writing the port.
We're going to add the semicolon here and then we're going to add the architecture.
And behavior, you can write whatever you want, but I like to be right behavioral.
It's like the standard in the middle of Mock's to one eighth of it is right.
And then we need to begin and we need the end.
Behav.
Growth.
OK, that's great.
Now let us start adding our inputs and outputs.
I'm going to introduce something new and you're going to see what it is.
First, we have two inputs here.
We're going to call the first one zero.
Its type is input.
And here.
This multiplexed can take eight a bit so it can be between inputs and outputs, eight bits, not just
one bit.
Remember that steady logic was something like a boolean, meaning it's only one bit.
What if I want multiple bits?
How can I define that?
Defining that is different.
You just need to add, underscore and you need to call a vector here.
So it's a steady logic vector.
A vector is just a bunch of booleans together and then we're going to specify the size.
Remember, the size is eight bits, so we're going to write seven down to zero.
And by that, I have specified an eight bit input because starting from zero to seven, we have eight
bits.
Right?
So we can write from zero from seven down to zero.
This is how we specify size.
It's a little bit weird.
I'm telling you, if you're coming from different programming, languages, backgrounds, I'm sure you're
going to find this a little bit weird.
But it is how it is and so do you.
One is the same.
The second input is going to be input steady logic vector.
And then we have seven down, two down to zero.
Nossa Mickleham, remember?
And a SEMICON next, we need a select line.
Remember, we're selecting only between two bits, so it's just a boolean, right?
It's either a zero in order to zero zero or select is one in order to include this one.
So here it's input as well as TD logic, and that's it.
There's no size here.
And the data out, we're going to call data out data output type is output, and remember, we're recording
input to the output so the sizes should match a steady logic, logic.
Victor.
Seven down to zero and no semicolon, because this is the last thing we're going to write and the semicolon
is up to the romanticists and we're done.
No, I'm going to teach you.
And you.
Syntax and your logic, how can we?
Do this recruiting in Virginia?
Well, there is two methods, actually.
Well, I could have created this multiplex are using and gates and all gates and we would get the same
functionality, but for now I'm going to go the easy way.
So I'm going to say data out of the output is going to equal to.
This, you know, when I open the parenthesis select equals to.
OK, it's like an if statement, so data out, it's really variable here.
So you're saying data out the output is equal to the zero when select a zero, it's really self explanatory,
right?
Else I'm going to say Daewon.
When open practices select equals.
OK.
Michael.
And that's it.
So what I was saying, you data out equals zero one select equals zero.
So when I put this, I looked at zero.
The data from zero will be attributed to the out else, meaning otherwise we can put it like that.
So it's clearer one meaning the data is equal to D one when selected equals one.
Is that clear, if this is not clear, you can just ask me in the Q&A.
No, this is it.
We're going to save this file, save as and we're going to call this the same name mux to one.
A.
And next step, put it as a set as a top level entity and compile.
We have some errors.
Let's see what kind of errors do we have?
OK, we forgot something, and it is the end here.
Remember, after board, there is an end.
OK, so we're going to say end Mock's to one, a semicolon.
Because they're saying here that they're expecting an end or begin in the declaration right here.
So they're right to save and compile.
And we are done.
That's amazing.
Now, let us create a feed of the Earth simulation file, so new BWF and not all of us not find our
list.
I want to add everything like, OK.
Here we go again, we simulate this, what we have here is not actually one bit if you expand it every
bit of these eight bits.
Can be.
Configured so.
First, in order to make this understandable, let us convert all of these to something that we understand.
So all of those who can right.
Click on the Reddick's and click that I want this as an inside decision.
So now those are numbers that we can understand.
Next, if you click on this and right click.
Now, if you click on this on double click here, you can give it a value.
Let's say that the value is 25 and the value on this is 87.
OK.
And the select is going to be from here to here one and from here to zero, what are we expecting when
it's one that's at this small chunk as well?
So when it's one I'm expecting the one to be here at the data output instead of this is otherwise when
it's zero, I'm expecting the twenty five to be here.
Now, if you expand this, you'll see that we have written 25 in binary right here and you'll see that
we have written 87 in binary right here.
Right.
Remember that a combination of bits can form a decimal number to you.
OK, so let us go to simulation settings.
Let us restore defaults, delete this.
Look, save and simulate.
We need to save this, let's call it mux.
Two, one.
OK.
And we have an error here.
It's fine, what I'm gonna do is I'm going to close this simulation settings, restore defaults, and
of course, I'm deleting this line save and.
And that's it, as you can see, the result is, as expected, this one has jumped to here to the day's
output, once elected as one.
Otherwise, we see that here 25 has jumped to the output from the zero one select line is zero.
So the mixer is really working.