mirror of
https://github.com/StepanovPlaton/Nand2Tetris.git
synced 2026-04-03 20:30:47 +04:00
Complete first project
This commit is contained in:
21
1_Boolean_Arithmetic/Or8Way.hdl
Normal file
21
1_Boolean_Arithmetic/Or8Way.hdl
Normal file
@@ -0,0 +1,21 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user