mirror of
https://github.com/vee1e/nand2tetris.git
synced 2026-09-01 11:08:53 +00:00
Add or 8 way
This commit is contained in:
parent
6ad1e6f8ae
commit
09d5f770c0
1 changed files with 11 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue