Activity 12 : Build 8 WAY OR using any of the gates previously built
Yes, it says 8 Way OR and not 8 bit..
la la la.. open the book !!
/**
* 8-way or gate: out = in[0] or in[1] or ... or in[7].
*/
CHIP Or8Way {
IN in[8];
OUT out;
PARTS:
// Put your code here.
Or(a=in[0], b=in[1], out=p0);
Or(a=p0, b=in[2], out=p1);
Or(a=p1, b=in[3], out=p2);
Or(a=p2, b=in[4], out=p3);
Or(a=p3, b=in[5], out=p4);
Or(a=p4, b=in[6], out=p5);
Or(a=p5, b=in[7], out=out);
}
////////////////////////////////
Downloads :
activity 12
Yes, it says 8 Way OR and not 8 bit..
la la la.. open the book !!
/**
* 8-way or gate: out = in[0] or in[1] or ... or in[7].
*/
CHIP Or8Way {
IN in[8];
OUT out;
PARTS:
// Put your code here.
Or(a=in[0], b=in[1], out=p0);
Or(a=p0, b=in[2], out=p1);
Or(a=p1, b=in[3], out=p2);
Or(a=p2, b=in[4], out=p3);
Or(a=p3, b=in[5], out=p4);
Or(a=p4, b=in[6], out=p5);
Or(a=p5, b=in[7], out=out);
}
////////////////////////////////
Downloads :
activity 12
No comments:
Post a Comment