# 4way16Mux

3 messages
Open this post in threaded view
|
Report Content as Inappropriate

## 4way16Mux

 Well I have been working on this problem for a couple days now. My initial idea was to compare the 16 bit Mux chips to one another in a fashion similar to the 8WayOr gate. The tiered approach. But I cannot seem to sort them properly using the inputs of sel. CHIP Mux4Way16 {     IN a[16], b[16], c[16], d[16], sel[2];     OUT out[16];     PARTS:     Mux16 ( a = a[0..15],                         b = a[0..15],                         sel = sel[0],                         out = outa);     Mux16 ( a = b[0..15],                         b = b[0..15],                         sel = sel[0],                         out = outb);     Mux16 ( a = c[0..15],                         b = c[0..15],                         sel = sel[1],                         out = outc);         Mux16 ( a = d[0..15],                         b = d[0..15],                         sel = sel[1],                         out = outd);         Not  ( in = sel[0], out = notsel0);         Not     ( in = sel[1], out = notsel1);         And    ( a = notsel0,                         b = notsel1,                         out = x);         And   ( a = x,                         b = outa,                         out = out);                 } I am aware that outa is a 16 bit input and And only supports 1 bit input. This is where I have hit a roadblock.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: 4way16Mux

 Administrator You can do this using only 3 Mux16 parts, and no other parts. Think of the Mux16s in two layers. The a, b, c and d inputs to the Mux4Way16 connect to the first layer of two Mux16s. Those Mux16s connect to the Mux16 in the second layer. The trick is to figure out which sel bit goes to the muxes in the first layer and which sel bit goes to the second layer. Note that you can say Mux16(a=c, ...) to connect 16-bit buses together and save some typing. --Mark