Add or 8 way

This commit is contained in:
lucky-vers 2024-02-08 22:22:16 +05:30
parent 6ad1e6f8ae
commit 09d5f770c0

View file

@ -3,7 +3,7 @@
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Or8Way.hdl
/**
* 8-way Or gate:
* 8-way Or gate:
* out = in[0] Or in[1] Or ... Or in[7]
*/
CHIP Or8Way {
@ -11,5 +11,13 @@ CHIP Or8Way {
OUT out;
PARTS:
//// Replace this comment with your code.
}
Or(a=in[0], b=in[1], out=temp1);
Or(a=in[2], b=in[3], out=temp2);
Or(a=in[4], b=in[5], out=temp3);
Or(a=in[6], b=in[7], out=temp4);
Or(a=temp1, b=temp2, out=temp5);
Or(a=temp3, b=temp4, out=temp6);
Or(a=temp5, b=temp6, out=out);
}