Issue with the 8 Way Mux

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

Issue with the 8 Way Mux

kingpinzs
I think I understand what needs to happen but it seems that
sel[3] settings in the hardware simulator are backwards.

I'm I wrong Or do I need to just flip all the select code?

I put n0, n1 and n2 but for the third one it is flipping n0 and n1 one not n1 and n2 if that makes since with out posting any code.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the 8 Way Mux

cadet1620
Administrator
It's important to understand that the convention for hardware bit numbering is that bit 0 is the least significant bit. If the 3-bit sel bus is carrying the number 4, then sel[2]=1, sel[1]=0, and sel[0]=0.

This makes the relationship between bit number (n) and bit value (v) easy to remember: v=2n.

In the early days of computing different manufacturers used different schemes, some 1-based, some left-to-right, and as you can imagine, it was rather confusing.

--Mark

[It is OK to post snippets of code, just don't post entire solutions.]

Reply | Threaded
Open this post in threaded view
|

Re: Issue with the 8 Way Mux

kingpinzs
I used the built in Mux8Way16 and it worked like I thought it should.

When sel[3] is set to 001 it selects B but for mine to select B I need it to be 100.

What could cause it?
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the 8 Way Mux

cadet1620
Administrator
kingpinzs wrote
I used the built in Mux8Way16 and it worked like I thought it should.

When sel[3] is set to 001 it selects B but for mine to select B I need it to be 100.

What could cause it?
If you built your Mux8Way16 using Mux16 and/or Mux4Way16s, check which of the 3 sel signals go to which Muxes.  It might help to draw a sketch of how the a through h signals get routed through the muxes as sel takes on various values.

Remember that sel[0] is the least significant bit.

If you need further help feel free to send my code and I'll take a look at it (More|Reply to Author).

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the 8 Way Mux

kingpinzs
I think I was reading it wrong I was doing
sel[0],sel[1],sel[2] and I got it to work reading it
sel[2],sel[1],sel[0]

Is that the way it should be? also I just used 8 4way And gates and 1 8 way Or gate to do this.


Edit:
I just reread the 4way mux and it is sel[1],sel[0]. I should of just payed closer attention to that part. I did it that way for the 4way but mixed them up on the 8 way.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with the 8 Way Mux

cadet1620
Administrator
kingpinzs wrote
...
also I just used 8 4way And gates and 1 8 way Or gate to do this.
Using this "sum-of-products" solution results in a multiplexer that is optimized for speed, but requires more work since you need to make some extra chips.  For TECS you can usually save work by using the parts you just made.  For instance, Mux16 made from Mux, Mux4Way16 made from some Mux16s, Mux8Way16 made from a mix of Mux16 and Mux4Way16.

--Mark