# Mux4Way16 Problem - Help

8 messages
Open this post in threaded view
|

## Mux4Way16 Problem - Help

 Ok, here is what I have. I have created a separate Mux4, which uses a selector to pick one out of four values. And after that, I am calling it 16 times in the Mux4Way16. However, it only displays 1 when the selector is 11... I have uploaded the files. Could someone please help me? Thanks. P.S. The code is commmented.Mux4.hdl Mux4Way16.hdl
Open this post in threaded view
|

## Re: Mux4Way16 Problem - Help

 Mux4 is not necessary at all. The selector to pick one of the four values already is the chip Mux4Way16. I'll give you a hint. For implementing the Mux4Way16 chip is only necessary five Mux16 chips. Regards
Open this post in threaded view
|

## Re: Mux4Way16 Problem - Help

 Administrator Albert wrote I'll give you a hint. For implementing the Mux4Way16 chip is only necessary five Mux16 chips. Think about it a bit more -- you can do it with 3 Mux16 chips. Think about trees and symmetry. Mux8Way16 can be made with 3 chips, too. Re: Veneficus' Mux4Way: You don't need to make your own 0 and 1; read Appendix A, A.5.2.     And(a=First, b=Left, out=Left1);     And(a=Third, b=Left, out=Left2);     //If it is left, which one?     And(a=Left1, b=Left2, out=WhichLeft); Aren't Left1 and Left2 exclusive? Only one of them can be 1 so WhichLeft is always 0. --Mark
Open this post in threaded view
|

## Re: Mux4Way16 Problem - Help

 Yeah, I've got it working with 3 Mux16 chips instead of 5. Yesterday I did it fast without realizing it was possible to build it with 3. Thanks Mark for the answer and for all the answers you are doing.... Albert
Open this post in threaded view
|

## Re: Mux4Way16 Problem - Help

 Guys, I thank you very much for your suggestions. Indeed, I have the theory in mind. But here is my problem. I have decided to use a Mux for a and b, and c and d respectively, using the second digit of the selector as the selector. This gives the following ouput 0 0          a c 0 1          b d 1 0          b c 1 1          b d After that, I decided to use Mux on the results, using the same selector. Mux(a, c, sel[1]). This will work for only three of them, however. It will work for the first, the third and the last pair. But instead of selecting b in the second one, d will get selected. I cannot work it out... no matter what I use. And, Or, XOR. It is the same. What am I doing wrong? What could be the third HDL line? I am not trying to get the solution for free, since I am working as hard as I can to figure it out.
Open this post in threaded view
|

## Re: Mux4Way16 Problem - Help

Right idea, but use sel[0] first.

 sel[1] sel[0] output 0 0 a 1 b 1 0 c 1 d

Read the columns right to left and you should see how the three Mux16s work.

Send me mail if you still don't get it and I'll give you more direct help.

--Mark