first commit
This commit is contained in:
25
project-1-boolean-logic/01/Or8Way.hdl
Executable file
25
project-1-boolean-logic/01/Or8Way.hdl
Executable file
@@ -0,0 +1,25 @@
|
||||
// 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=out00 );
|
||||
Or(a= in[2], b=in[3] , out=out01 );
|
||||
Or(a= in[4], b=in[5] , out=out02 );
|
||||
Or(a= in[6], b=in[7] , out=out03 );
|
||||
|
||||
Or(a= out00 , b= out01 , out= out0001 );
|
||||
Or(a= out02, b=out03 , out=out0203 );
|
||||
|
||||
Or(a=out0001 , b=out0203 , out= out );
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user