erwinleonardy wrote
My question is, how do we get the first two bits of the sel and store it in another variable?
This is what I currently have:
Mux4Way16 (a=a, b=b, c=c, d=d, sel[0..1]=w, sel=w, out=x1);
This gives me an error of 'w has no source pin'
You are most of the way there; sel[0..1] is what you want to create a 2-bit sub-bus from the INPUT
sel bus. You just need to connect it directly to the Mux4Way16's
sel pin. Remember that part pins are always on the left of the '=' and the wires/buses they connect to are always on the right.
Appendix A.5.3 is about sub-busing. The example shows some interesting features of sub-busing and is worth studying.
--Mark