Files
2024-11-28 16:30:16 +04:00

21 lines
511 B
Plaintext

// 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/1/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=x1);
Or(a=in[2], b=in[3], out=x2);
Or(a=in[4], b=in[5], out=x3);
Or(a=in[6], b=in[7], out=x4);
Or(a=x1, b=x2, out=y1);
Or(a=x3, b=x4, out=y2);
Or(a=y1, b=y2, out=out);
}