Or8Way done

This commit is contained in:
Nemo 2020-05-19 22:52:09 +05:30
parent 8a1072a4a5
commit 515f974aaf
3 changed files with 20 additions and 4 deletions

View File

@ -20,7 +20,7 @@ Build order as per the website. Cost for each gate in NAND in brackets.
- [x] `And16` (32)
- [x] `Or16` (48)
- [x] `Mux16` (113)
- [ ] `Or8Way` ()
- [x] `Or8Way` (21)
- [ ] `Mux4Way16` ()
- [ ] `Mux8Way16` ()
- [ ] `DMux4Way` ()

View File

@ -4,14 +4,24 @@
// File name: projects/01/Or8Way.hdl
/**
* 8-way Or:
* 8-way Or:
* out = (in[0] or in[1] or ... or in[7])
*/
// COST = 7x3 = 21 NAND Gates
CHIP Or8Way {
IN in[8];
OUT out;
PARTS:
// Put your code here:
}
Or(a=in[0], b=in[1], out=p);
Or(a=in[2], b=in[3], out=q);
Or(a=in[4], b=in[5], out=r);
Or(a=in[6], b=in[7], out=s);
Or(a=p, b=q, out=x);
Or(a=r, b=s, out=y);
Or(a=x, b=y, out=out);
}

6
projects/01/Or8Way.out Normal file
View File

@ -0,0 +1,6 @@
| in | out |
| 00000000 | 0 |
| 11111111 | 1 |
| 00010000 | 1 |
| 00000001 | 1 |
| 00100110 | 1 |