# Mux4Way16 Progression

2 messages
Open this post in threaded view
|

## Mux4Way16 Progression

 This post was updated on . I had trouble getting the Mux gate to work initially and ended up having to side track over and learn enough Boolean Algebra (about 3-4 days) to figure out how to build the gate as it didn't seem apparent and throwing random gates together isn't how I like to attack problems. Is there something that I am missing from the course book, namely chapter 1, that was suppose to make the implementation more obvious to compile from the elemental gates (AND, OR and NOT)? After analyzing the completed Mux gate I was able to figure out how it works as a selector in theory and not just in the math. Later, I ran into issues getting the Mux4Way16 (all Mux and DeMux gates must have been the hardest ones for most people without most of the prerequisite knowledge). I figured that if I could get a Mux4Way working (not asked for in the course)(Boolean expression: A/E/F + B/EF + CE/F + DEF) then all I needed to do was upgrade the bus to 16-bits. Wrong! Below is my attempt to get a Mux4Way (1-bit) to work as 16-bit. PARTS:     Not(in=sel[0], out=notsel0);     Not(in=sel[1], out=notsel1);     And16(a=a, b[0]=notsel0, b[1..15]=false, out=w1);     And16(a=w1, b[0]=notsel1, b[1..15]=false, out=w2);     And16(a=b, b[0]=sel[0], b[1..15]=false, out=w3);     And16(a=w3, b[0]=notsel1, b[1..15]=false, out=w4);     And16(a=c, b[0]=notsel0, b[1..15]=false, out=w5);     And16(a=w5, b[0]=sel[1], b[1..15]=false, out=w6);     And16(a=d, b[0]=sel[0], b[1..15]=false, out=w7);     And16(a=w7, b[0]=sel[1], b[1..15]=false, out=w8);     Or16(a=w2, b=w4, out=w9);     Or16(a=w6, b=w8, out=w10);     Or16(a=w9, b=w10, out=out); I ended up having to look it up because it was not apparent that three Mux16 gates were all that was needed when all I was doing was converting it from 1-bit to 16-bit. Still curious how the Mux16 approach works and how students with ONLY programming knowledge (currently a Software Developer) was suppose to figure that out? Thanks, Ron
Open this post in threaded view
|

## Re: Mux4Way16 Progression

 Administrator romasi wrote Below is my attempt to get a Mux4Way (1-bit) to work as 16-bit.     ...     And16(a=a, b[0]=notsel0, b[1..15]=false, out=w1); The problem with this approach is that you need to connect all 16 of the b inputs of the And16s to the various sel[N] and notselN signals.     And16(a=a, b[0]=notsel0, b[1]=notsel0, b[2]=notsel0, b[3]=notsel0,         b[4]=notsel0, b[5]=notsel0, b[6]=notsel0, b[7]=notsel0,         b[8]=notsel0, b[9]=notsel0, b[10]=notsel0, b[11]=notsel0,         b[12]=notsel0, b[13]=notsel0, b[14]=notsel0, b[15]=notsel0,  out=w1); It's a lot of typing to do this for all the And gates! If you made a Mux4Way, make the Mux4Way16 using 16 Mux4Ways like you made And16 out of 16 Ands. To make a Mux4Way16 out of 3 Mux16s, don't think about it as Boolean algebra; think about it functionally. It often helps to think about it from the output working backwards. If sel[1] is 0, the output needs to be either a or b. If it is 1 the output needs to be either c or d.     Mux16 (sel=sel[1], a=ab, b=cd, out=out); Use 2 more Mux16s to make the ab and cd signals. You can make the Mux8Way16 with 3 muxes using the same technique with a combination of Mux16 and Mux4Way16 parts. --Mark