Mux4Way16

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Mux4Way16

Slight_Of_Nand
Hello all,

I've been alright with everything so far up until this chip.  It is failing at line 7 and 8 - comparison error.

Here is a drawing to show my idea.  I can also email my HDL that fails if someone would be so kind as to see if I screwed up that.

I was sneaky after working on this problem for so long and look at a solution, but the solution just seemed too easy it must be wrong?

Is my thinking correct?

Thank you :)

Mux4Way16
Reply | Threaded
Open this post in threaded view
|

Re: Mux4Way16

svajoklis
It seems you are overcomplicating things with additional parts. I have solved it using 3 Mux16s and nothing else.

Think about the inputs as two groups, it helps to visualize them in binary.

a is 00
b is 01

c is 10
d is 11

The 1st bit seems to break the inputs into two groups, and 0th bit selects single input from each group... Can't say much more than that (:

Selecting b doesn't work in your design, because b is selected when sel = 01, 0 or 1 is 1, so top mux selects b, but the right mux selects the input from bottom mux (since it uses sel[0]), which doesn't interact with b in any way.

What is your logic behind your solution? I'm finding it hard to follow.
Reply | Threaded
Open this post in threaded view
|

Re: Mux4Way16

Slight_Of_Nand
Thank you for your reply.  I do understand that this can be made with 3 Mux16s - I found this out after much frustration with my solution not working.  But in order to try and further my knowledge I'd like to find out why my solution fails?

If you look at my truth table I hope you'll understand my logic.  The Or gate decide the first M16 chip to pick either the a bus or the b bus.  With only 00 giving a as the output.

The And gate decides if the second M16 chip picks c or d.  With only 11 favoring the d bus.

The third Mux16 then has to decide between the output from the abMux or the cdMux and it does this using the sel[0] value.  Unless I've really messed up I can't see how my logic dosn't work.  I understand it isn't efficient - but it should work?

Can anyone help me understand please?

Thank you :)
Reply | Threaded
Open this post in threaded view
|

Re: Mux4Way16

blazk
Its already a couple of weeks since this question, but Ill try to answer this question since it might be useful for others.

Remember, the numbers index are read from right to left, so when it is given that    
out = c if sel == 10
to be specific,it is
out = c when the sel[0] == 0 and sel[1] == 1

you mislabel the sel[0] and sel[1]
Reply | Threaded
Open this post in threaded view
|

Re: Mux4Way16

Slight_Of_Nand
Thank you for your reply.

It does indeed help!