Mux4Way16

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

Mux4Way16

Houyx15
Hey,I just find another problem.
What is wrong with this?
Can you help me?

CHIP Mux4Way16 {
    IN a[16], b[16], c[16], d[16], sel[2];
    OUT out[16];

    PARTS:
    // Put your code here:
        Mux16(a[16]=a[16],b[16]=c[16],sel=sel[0],out[16]=t1[16]);
        Mux16(a[16]=b[16],b[16]=d[16],sel=sel[0],out[16]=t2[16]);
        Mux16(a[16]=t1[16],b[16]=t2[16],sel=sel[1],out=out);
}
Reply | Threaded
Open this post in threaded view
|

Re: Mux4Way16

cadet1620
Administrator
Houyx15 wrote
Hey,I just find another problem.
What is wrong with this?
Can you help me?

CHIP Mux4Way16 {
    IN a[16], b[16], c[16], d[16], sel[2];
    OUT out[16];

    PARTS:
    // Put your code here:
        Mux16(a[16]=a[16] ...
}
"x[16]=y[16]" means "connect bit 16 of bus x to bit 16 of bus y."

There are two problems with this:
  o  All the other bits are unconnected,
  o  These are 16-bit buses; they only have bits 0 through 15.

To connect all the bits of bus x to bus y, all you need is "x=y".

Read Appendix A.5.3 for more information on buses.

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

Re: Mux4Way16

Houyx15
Thank you!