Can't understand Mux4Way16

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

Can't understand Mux4Way16

m0t0k0
This post was updated on .
I have written my HDL implementation which in my head works perfectly but fails in the simulator (comparison line 7 & 8)
Is it because I'm ignoring the fact that it is 16way?

In my head, it works like this.
sell inputs are 00
so the first mux operation will output an a to m1
the second mux operation will output a b to m2
the third mux operation will output m1 which is an a

sel inputs are 01
so the first mux operation will output an a to m1
the second mux operation will output a b to m2
the third mux operation will output m2 which is an b

sel inputs are 10
so the first mux operation will output an c to m1
the second mux operation will output a d to m2
the third mux operation will output m1 which is an c

sel inputs are 11
so the first mux operation will output an c to m1
the second mux operation will output a d to m2
the third mux operation will output m2 which is an d

I'm really confused because I built it in a logic gate GUI and it works


Reply | Threaded
Open this post in threaded view
|

Re: Can't understand Mux4Way16

m0t0k0
Ok so I sussed it out. If you look at my original implementation inputs b and c are crossed over and that is why it looks like its working.

This is incorrect and it fixed my initial problem which was my sel0 and sel1 were the wrong way round.
The sell input is read from right to left.
This vid helped me


Reply | Threaded
Open this post in threaded view
|

Re: Can't understand Mux4Way16

SirGouki
In reply to this post by m0t0k0
This, and writing a C# version of the hardware simulator (so I could more easily debug problems) helped me figure this out:
2n : 1 MUX requires ((2^n) - 1) 2 : 1 MUX
(not linking the website so I don't get asked to delete my response)

where n is weird in this equation (4 would be 2^2,8 would be 2^3 or 2*4) but I copied it straight from the site I used.

Theoretically, this should be applicable to determine how many 4:1 muxes you'll need to make an 8:1 mux for the Mux8Way16 chip.  Also, note that its MuxNWay as in how many inputs, the 16 refers to the outputs.


Also, I implemented a regular Mux4 before implenting the Mux4Way16 so I didn't have to do a huge amount of typing... this is probably the easier way to go.