Activity 14 : Build 16 bit / 8 WAY MUX using the gates previously built
/**
* 8-way 16-bit multiplexor.
* out = a if sel==000
* b if sel==001
* etc.
* h if sel==111
*/
CHIP Mux8Way16 {
IN a[16], b[16], c[16], d[16],
e[16], f[16], g[16], h[16],
sel[3];
OUT out[16];
PARTS:
// Put your code here.
Mux16(a=a,b=b,sel=sel[0],out=selab);
Mux16(a=c,b=d,sel=sel[0],out=selcd);
Mux16(a=e,b=f,sel=sel[0],out=selef);
Mux16(a=g,b=h,sel=sel[0],out=selgh);
Mux16(a=selab,b=selcd,sel=sel[1],out=selabcd);
Mux16(a=selef,b=selgh,sel=sel[1],out=selefgh);
Mux16(a=selabcd,b=selefgh,sel=sel[2],out=out);
}
/**
* 8-way 16-bit multiplexor.
* out = a if sel==000
* b if sel==001
* etc.
* h if sel==111
*/
CHIP Mux8Way16 {
IN a[16], b[16], c[16], d[16],
e[16], f[16], g[16], h[16],
sel[3];
OUT out[16];
PARTS:
// Put your code here.
Mux16(a=a,b=b,sel=sel[0],out=selab);
Mux16(a=c,b=d,sel=sel[0],out=selcd);
Mux16(a=e,b=f,sel=sel[0],out=selef);
Mux16(a=g,b=h,sel=sel[0],out=selgh);
Mux16(a=selab,b=selcd,sel=sel[1],out=selabcd);
Mux16(a=selef,b=selgh,sel=sel[1],out=selefgh);
Mux16(a=selabcd,b=selefgh,sel=sel[2],out=out);
}
Downloads :
No comments:
Post a Comment