-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOr16.hdl
More file actions
42 lines (30 loc) · 854 Bytes
/
Or16.hdl
File metadata and controls
42 lines (30 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// 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/01/Or16.hdl
/**
* 16-bit bitwise Or:
* for i = 0..15 out[i] = (a[i] or b[i])
*/
CHIP Or16 {
IN a[16], b[16];
OUT out[16];
PARTS:
// Put your code here:
Or(a=a[0], b=[0], out=out[0]);
Or(a=a[1], b=[1], out=out[1]);
Or(a=a[2], b=[2], out=out[2]);
Or(a=a[3], b=[3], out=out[3]);
Or(a=a[4], b=[4], out=out[4]);
Or(a=a[5], b=[5], out=out[5]);
Or(a=a[6], b=[6], out=out[6]);
Or(a=a[7], b=[7], out=out[7]);
Or(a=a[8], b=[8], out=out[8]);
Or(a=a[9], b=[9], out=out[9]);
Or(a=a[10], b=[10], out=out[10]);
Or(a=a[11], b=[11], out=out[11]);
Or(a=a[12], b=[12], out=out[12]);
Or(a=a[13], b=[13], out=out[13]);
Or(a=a[14], b=[14], out=out[14]);
Or(a=a[15], b=[15], out=out[15]);
}