nand2tetris/projects/01/Or8Way.hdl
2024-02-08 22:22:16 +05:30

23 lines
573 B
Text

// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Or8Way.hdl
/**
* 8-way Or gate:
* out = in[0] Or in[1] Or ... Or in[7]
*/
CHIP Or8Way {
IN in[8];
OUT out;
PARTS:
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);
}