Public » Elements of Computing
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

initial

Changeset 5923ba3076d8

by Profile picture of Benjamin PollackBenjamin Pollack

Changes to 241 files · Browse files at 5923ba3076d8 Diff from another changeset...

Change 1 of 1 Show Entire File 00/​And.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | out | +| 0 | 0 | 0 | +| 0 | 1 | 0 | +| 1 | 0 | 0 | +| 1 | 1 | 1 |
Change 1 of 1 Show Entire File 00/​And.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -0,0 +1,29 @@
+// This file is part of the materials accompanying the book +// "The Elements of Computing Systems" by Nisan and Schocken, +// MIT Press. Book site: www.nand2tetris.org +// File name: projects/00/And.tst + +load And.hdl, +output-file And.out, +compare-to And.cmp, +output-list a%B3.1.3 b%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 00/​Mux8Way16.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+| a | b | c | d | e | f | g | h | sel | out | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 1 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 2 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 3 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 4 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 5 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 6 | 0000 | +| 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 0000 | 7 | 0000 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 0 | 1234 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 1 | 2345 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 2 | 3456 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 3 | 4567 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 4 | 5678 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 5 | 6789 | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 6 | 789a | +| 1234 | 2345 | 3456 | 4567 | 5678 | 6789 | 789a | 89ab | 7 | 89ab |
Change 1 of 1 Show Entire File 00/​Mux8Way16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@@ -0,0 +1,89 @@
+// This file is part of the materials accompanying the book +// "The Elements of Computing Systems" by Nisan and Schocken, +// MIT Press. Book site: www.nand2tetris.org +// File name: projects/00/Mux8Way16.tst + +load Mux8Way16.hdl, +output-file Mux8Way16.out, +compare-to Mux8Way16.cmp, +output-list a%X1.4.1 b%X1.4.1 c%X1.4.1 d%X1.4.1 e%X1.4.1 f%X1.4.1 g%X1.4.1 h%X1.4.1 sel%D2.1.2 out%X1.4.1; + +set a 0, +set b 0, +set c 0, +set d 0, +set e 0, +set f 0, +set g 0, +set h 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output; + +set sel 4, +eval, +output; + +set sel 5, +eval, +output; + +set sel 6, +eval, +output; + +set sel 7, +eval, +output; + +set a %X1234, +set b %X2345, +set c %X3456, +set d %X4567, +set e %X5678, +set f %X6789, +set g %X789a, +set h %X89ab, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output; + +set sel 4, +eval, +output; + +set sel 5, +eval, +output; + +set sel 6, +eval, +output; + +set sel 7, +eval, +output;
Change 1 of 1 Show Entire File 00/​RAM8.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,26 @@
+| time | in |load |address| out | +| 0+ | 0 | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | 0 | +| 1+ | 0 | 1 | 0 | 0 | +| 2 | 0 | 1 | 0 | 0 | +| 2+ | 11111 | 0 | 0 | 0 | +| 3 | 11111 | 0 | 0 | 0 | +| 3+ | 11111 | 1 | 1 | 0 | +| 4 | 11111 | 1 | 1 | 11111 | +| 4+ | 11111 | 0 | 0 | 0 | +| 5 | 11111 | 0 | 0 | 0 | +| 5+ | 3333 | 0 | 3 | 0 | +| 6 | 3333 | 0 | 3 | 0 | +| 6+ | 3333 | 1 | 3 | 0 | +| 7 | 3333 | 1 | 3 | 3333 | +| 7+ | 3333 | 0 | 3 | 3333 | +| 8 | 3333 | 0 | 3 | 3333 | +| 8 | 3333 | 0 | 1 | 11111 | +| 8+ | 7777 | 0 | 1 | 11111 | +| 9 | 7777 | 0 | 1 | 11111 | +| 9+ | 7777 | 1 | 7 | 0 | +| 10 | 7777 | 1 | 7 | 7777 | +| 10+ | 7777 | 0 | 7 | 7777 | +| 11 | 7777 | 0 | 7 | 7777 | +| 11 | 7777 | 0 | 3 | 3333 | +| 11 | 7777 | 0 | 7 | 7777 |
Change 1 of 1 Show Entire File 00/​RAM8.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@@ -0,0 +1,94 @@
+// This file is part of the materials accompanying the book +// "The Elements of Computing Systems" by Nisan and Schocken, +// MIT Press. Book site: www.nand2tetris.org +// File name: projects/00/RAM8.tst + +load RAM8.hdl, +output-file RAM8.output, +compare-to RAM8.cmp, +output-list time%S1.4.1 in%D1.6.1 load%B2.1.2 address%D3.1.3 out%D1.6.1; + +set in 0, +set load 0, +set address 0, +tick, +output; +tock, +output; + +set load 1, +tick, +output; +tock, +output; + +set in 11111, +set load 0, +tick, +output; +tock, +output; + +set load 1, +set address 1, +tick, +output; +tock, +output; + +set load 0, +set address 0, +tick, +output; +tock, +output; + +set in 3333, +set address 3, +tick, +output; +tock, +output; + +set load 1, +tick, +output; +tock, +output; + +set load 0, +tick, +output; +tock, +output; + +set address 1, +eval, +output; + +set in 7777, +tick, +output; +tock, +output; + +set load 1, +set address 7, +tick, +output; +tock, +output; + +set load 0, +tick, +output; +tock, +output; + +set address 3, +eval, +output; + +set address 7, +eval, +output;
Change 1 of 1 Show Entire File 00/​Register.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@@ -0,0 +1,21 @@
+| time | in |load | out | +| 0+ | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | +| 1+ | 0 | 1 | 0 | +| 2 | 0 | 1 | 0 | +| 2+ | -32123 | 0 | 0 | +| 3 | -32123 | 0 | 0 | +| 3+ | 11111 | 0 | 0 | +| 4 | 11111 | 0 | 0 | +| 4+ | -32123 | 1 | 0 | +| 5 | -32123 | 1 | -32123 | +| 5+ | -32123 | 1 | -32123 | +| 6 | -32123 | 1 | -32123 | +| 6+ | -32123 | 0 | -32123 | +| 7 | -32123 | 0 | -32123 | +| 7+ | 12345 | 1 | -32123 | +| 8 | 12345 | 1 | 12345 | +| 8+ | 0 | 0 | 12345 | +| 9 | 0 | 0 | 12345 | +| 9+ | 0 | 1 | 12345 | +| 10 | 0 | 1 | 0 |
Change 1 of 1 Show Entire File 00/​Register.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@@ -0,0 +1,89 @@
+// This file is part of the materials accompanying the book +// "The Elements of Computing Systems" by Nisan and Schocken, +// MIT Press. Book site: www.nand2tetris.org +// File name: projects/00/Register.tst + +load Register.hdl, +output-file Register.out, +compare-to Register.cmp, +output-list time%S1.4.1 in%D1.6.1 load%B2.1.2 out%D1.6.1; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 1, +tick, +output; + +tock, +output; + +set in -32123, +set load 0, +tick, +output; + +tock, +output; + +set in 11111, +set load 0, +tick, +output; + +tock, +output; + +set in -32123, +set load 1, +tick, +output; + +tock, +output; + +set in -32123, +set load 1, +tick, +output; + +tock, +output; + +set in -32123, +set load 0, +tick, +output; + +tock, +output; + +set in 12345, +set load 1, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 1, +tick, +output; + +tock, +output;
Change 1 of 1 Show Entire File 00/​Xor.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | out | +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 0 |
Change 1 of 1 Show Entire File 00/​Xor.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@@ -0,0 +1,24 @@
+// 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/00/Xor.hdl + +// This file is included here for those who wish to follow the Hardware Simulator Tutorial +// and play with the Xor.hdl implementation. + +/** + * Exclusive-or gate: out = !(a == b). + */ + +CHIP Xor { + + IN a, b; + OUT out; + + PARTS: + Not(in=a, out=nota); + Not(in=b, out=notb); + And(a=a, b=notb, out=w1); + And(a=nota, b=b, out=w2); + Or(a=w1, b=w2, out=out); +}
Change 1 of 1 Show Entire File 00/​Xor.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,32 @@
+// 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/00/Xor.tst + +// This file is included here for those who wish to follow the Hardware Simulator Tutorial +// and play with the Xor.hdl implementation. + +load Xor.hdl, +output-file Xor.out, +compare-to Xor.cmp, +output-list a%B3.1.3 b%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​And.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | out | +| 0 | 0 | 0 | +| 0 | 1 | 0 | +| 1 | 0 | 0 | +| 1 | 1 | 1 |
Change 1 of 1 Show Entire File 01/​And.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+// 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/And.hdl + +/** + * And gate: out = 1 if {a==1 and b==1}, 0 otherwise + * And gate: if {a==1 and b==1} then out = 1 else out = 0 + */ + +CHIP And { + IN a, b; + OUT out; + + PARTS: + // Put your code here: +}
Change 1 of 1 Show Entire File 01/​And.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,29 @@
+// 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/And.tst + +load And.hdl, +output-file And.out, +compare-to And.cmp, +output-list a%B3.1.3 b%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​And16.cmp Stacked
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
@@ -0,0 +1,7 @@
+| a | b | out | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | +| 0000000000000000 | 1111111111111111 | 0000000000000000 | +| 1111111111111111 | 1111111111111111 | 1111111111111111 | +| 1010101010101010 | 0101010101010101 | 0000000000000000 | +| 0011110011000011 | 0000111111110000 | 0000110011000000 | +| 0001001000110100 | 1001100001110110 | 0001000000110100 |
Change 1 of 1 Show Entire File 01/​And16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/And16.hdl + +/** + * 16-bit-wise and gate: for i = 0..15: out[i] = a[i] and b[i] + */ + +CHIP And16 { + IN a[16], b[16]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​And16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -0,0 +1,39 @@
+// 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/And16.tst + +load And16.hdl, +output-file And16.out, +compare-to And16.cmp, +output-list a%B1.16.1 b%B1.16.1 out%B1.16.1; + +set a %B0000000000000000, +set b %B0000000000000000, +eval, +output; + +set a %B0000000000000000, +set b %B1111111111111111, +eval, +output; + +set a %B1111111111111111, +set b %B1111111111111111, +eval, +output; + +set a %B1010101010101010, +set b %B0101010101010101, +eval, +output; + +set a %B0011110011000011, +set b %B0000111111110000, +eval, +output; + +set a %B0001001000110100, +set b %B1001100001110110, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 01/​DMux.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| in | sel | a | b | +| 0 | 0 | 0 | 0 | +| 0 | 1 | 0 | 0 | +| 1 | 0 | 1 | 0 | +| 1 | 1 | 0 | 1 |
Change 1 of 1 Show Entire File 01/​DMux.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@@ -0,0 +1,19 @@
+// 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/DMux.hdl + +/** + * Demultiplexor. + * {a,b} = {in,0} if sel==0 + * {0,in} if sel==1 + */ + + +CHIP DMux { + IN in, sel; + OUT a, b; + + PARTS: + // Put your code here: +}
Change 1 of 1 Show Entire File 01/​DMux.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,27 @@
+// 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/DMux.tst + +load DMux.hdl, +output-file DMux.out, +compare-to DMux.cmp, +output-list in%B3.1.3 sel%B3.1.3 a%B3.1.3 b%B3.1.3; + +set in 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set in 1, +set sel 0, +eval, +output; + +set sel 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​DMux4Way.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -0,0 +1,9 @@
+| in | sel | a | b | c | d | +| 0 | 00 | 0 | 0 | 0 | 0 | +| 0 | 01 | 0 | 0 | 0 | 0 | +| 0 | 10 | 0 | 0 | 0 | 0 | +| 0 | 11 | 0 | 0 | 0 | 0 | +| 1 | 00 | 1 | 0 | 0 | 0 | +| 1 | 01 | 0 | 1 | 0 | 0 | +| 1 | 10 | 0 | 0 | 1 | 0 | +| 1 | 11 | 0 | 0 | 0 | 1 |
Change 1 of 1 Show Entire File 01/​DMux4Way.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
@@ -0,0 +1,20 @@
+// 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/DMux4Way.hdl + +/** + * 4-way demultiplexor. + * {a,b,c,d} = {in,0,0,0} if sel==00 + * {0,in,0,0} if sel==01 + * {0,0,in,0} if sel==10 + * {0,0,0,in} if sel==11 + */ + +CHIP DMux4Way { + IN in, sel[2]; + OUT a, b, c, d; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​DMux4Way.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
@@ -0,0 +1,43 @@
+// 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/DMux4Way.tst + +load DMux4Way.hdl, +output-file DMux4Way.out, +compare-to DMux4Way.cmp, +output-list in%B2.1.2 sel%B2.2.2 a%B2.1.2 b%B2.1.2 c%B2.1.2 d%B2.1.2; + +set in 0, +set sel %B00, +eval, +output; + +set sel %B01, +eval, +output; + +set sel %B10, +eval, +output; + +set sel %B11, +eval, +output; + +set in 1, +set sel %B00, +eval, +output; + +set sel %B01, +eval, +output; + +set sel %B10, +eval, +output; + +set sel %B11, +eval, +output;
Change 1 of 1 Show Entire File 01/​DMux8Way.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+| in | sel | a | b | c | d | e | f | g | h | +| 0 | 00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 00 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 01 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 10 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | +| 1 | 11 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | +| 1 | 00 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | +| 1 | 01 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | +| 1 | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | +| 1 | 11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Change 1 of 1 Show Entire File 01/​DMux8Way.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
@@ -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/01/DMux8Way.hdl + +/** + * 8-way demultiplexor. + * {a,b,c,d,e,f,g,h} = {in,0,0,0,0,0,0,0} if sel==000 + * {0,in,0,0,0,0,0,0} if sel==001 + * etc. + * {0,0,0,0,0,0,0,in} if sel==111 + */ + + +CHIP DMux8Way { + IN in, sel[3]; + OUT a, b, c, d, e, f, g, h; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​DMux8Way.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@@ -0,0 +1,75 @@
+// 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/DMux8Way.tst + +load DMux8Way.hdl, +output-file DMux8Way.out, +compare-to DMux8Way.cmp, +output-list in%B2.1.2 sel%B2.2.2 a%B2.1.2 b%B2.1.2 c%B2.1.2 d%B2.1.2 e%B2.1.2 f%B2.1.2 g%B2.1.2 h%B2.1.2; + +set in 0, +set sel %B000, +eval, +output; + +set sel %B001, +eval, +output; + +set sel %B010, +eval, +output; + +set sel %B011, +eval, +output; + +set sel %B100, +eval, +output; + +set sel %B101, +eval, +output; + +set sel %B110, +eval, +output; + +set sel %B111, +eval, +output; + +set in 1, +set sel %B000, +eval, +output; + +set sel %B001, +eval, +output; + +set sel %B010, +eval, +output; + +set sel %B011, +eval, +output; + +set sel %B100, +eval, +output; + +set sel %B101, +eval, +output; + +set sel %B110, +eval, +output; + +set sel %B111, +eval, +output;
Change 1 of 1 Show Entire File 01/​Mux.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -0,0 +1,9 @@
+| a | b | sel | out | +| 0 | 0 | 0 | 0 | +| 0 | 0 | 1 | 0 | +| 0 | 1 | 0 | 0 | +| 0 | 1 | 1 | 1 | +| 1 | 0 | 0 | 1 | +| 1 | 0 | 1 | 0 | +| 1 | 1 | 0 | 1 | +| 1 | 1 | 1 | 1 |
Change 1 of 1 Show Entire File 01/​Mux.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/Mux.hdl + +/** + * Multiplexor. If sel==1 then out=b else out=a. + */ + +CHIP Mux { + IN a, b, sel; + OUT out; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Mux.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
@@ -0,0 +1,49 @@
+// 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/Mux.tst + +load Mux.hdl, +output-file Mux.out, +compare-to Mux.cmp, +output-list a%B3.1.3 b%B3.1.3 sel%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a 0, +set b 1, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a 1, +set b 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a 1, +set b 1, +set sel 0, +eval, +output; + +set sel 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​Mux16.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -0,0 +1,9 @@
+| a | b | sel | out | +| 0000000000000000 | 0000000000000000 | 0 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 1 | 0000000000000000 | +| 0000000000000000 | 0001001000110100 | 0 | 0000000000000000 | +| 0000000000000000 | 0001001000110100 | 1 | 0001001000110100 | +| 1001100001110110 | 0000000000000000 | 0 | 1001100001110110 | +| 1001100001110110 | 0000000000000000 | 1 | 0000000000000000 | +| 1010101010101010 | 0101010101010101 | 0 | 1010101010101010 | +| 1010101010101010 | 0101010101010101 | 1 | 0101010101010101 |
Change 1 of 1 Show Entire File 01/​Mux16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+// 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/Mux16.hdl + +/** + * 16 bit multiplexor. If sel==1 then out=b else out=a. + */ + +CHIP Mux16 { + IN a[16], b[16], sel; + OUT out[16]; + + PARTS: + // Put your code here: +} +
Change 1 of 1 Show Entire File 01/​Mux16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
 
@@ -0,0 +1,49 @@
+// 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/Mux16.tst + +load Mux16.hdl, +output-file Mux16.out, +compare-to Mux16.cmp, +output-list a%B1.16.1 b%B1.16.1 sel%D2.1.2 out%B1.16.1; + +set a 0, +set b 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a %B0000000000000000, +set b %B0001001000110100, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a %B1001100001110110, +set b %B0000000000000000, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set a %B1010101010101010, +set b %B0101010101010101, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Mux4Way16.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -0,0 +1,9 @@
+| a | b | c | d | sel | out | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 00 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 01 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 10 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 11 | 0000000000000000 | +| 0001001000110100 | 1001100001110110 | 1010101010101010 | 0101010101010101 | 00 | 0001001000110100 | +| 0001001000110100 | 1001100001110110 | 1010101010101010 | 0101010101010101 | 01 | 1001100001110110 | +| 0001001000110100 | 1001100001110110 | 1010101010101010 | 0101010101010101 | 10 | 1010101010101010 | +| 0001001000110100 | 1001100001110110 | 1010101010101010 | 0101010101010101 | 11 | 0101010101010101 |
Change 1 of 1 Show Entire File 01/​Mux4Way16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
@@ -0,0 +1,20 @@
+// 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/Mux4Way16.hdl + +/** + * 4-way 16-bit multiplexor. + * out = a if sel==00 + * b if sel==01 + * c if sel==10 + * d if sel==11 + */ + +CHIP Mux4Way16 { + IN a[16], b[16], c[16], d[16], sel[2]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Mux4Way16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
@@ -0,0 +1,49 @@
+// 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/Mux4Way16.tst + +load Mux4Way16.hdl, +output-file Mux4Way16.out, +compare-to Mux4Way16.cmp, +output-list a%B1.16.1 b%B1.16.1 c%B1.16.1 d%B1.16.1 sel%B2.2.2 out%B1.16.1; + +set a 0, +set b 0, +set c 0, +set d 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output; + +set a %B0001001000110100, +set b %B1001100001110110, +set c %B1010101010101010, +set d %B0101010101010101, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output;
Change 1 of 1 Show Entire File 01/​Mux8Way16.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+| a | b | c | d | e | f | g | h | sel | out | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 000 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 001 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 010 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 011 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 100 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 101 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 110 | 0000000000000000 | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 0000000000000000 | 111 | 0000000000000000 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 000 | 0001001000110100 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 001 | 0010001101000101 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 010 | 0011010001010110 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 011 | 0100010101100111 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 100 | 0101011001111000 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 101 | 0110011110001001 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 110 | 0111100010011010 | +| 0001001000110100 | 0010001101000101 | 0011010001010110 | 0100010101100111 | 0101011001111000 | 0110011110001001 | 0111100010011010 | 1000100110101011 | 111 | 1000100110101011 |
Change 1 of 1 Show Entire File 01/​Mux8Way16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
@@ -0,0 +1,22 @@
+// 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/Mux8Way16.hdl + +/** + * 8-way 16-bit multiplexor. + * out = a if sel==000 + * b if sel==001 + * etc. + * h if sel==111 + */ + +CHIP Mux8Way16 { + IN a[16], b[16], c[16], d[16], + e[16], f[16], g[16], h[16], + sel[3]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Mux8Way16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@@ -0,0 +1,89 @@
+// 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/Mux8Way16.tst + +load Mux8Way16.hdl, +output-file Mux8Way16.out, +compare-to Mux8Way16.cmp, +output-list a%B1.16.1 b%B1.16.1 c%B1.16.1 d%B1.16.1 e%B1.16.1 f%B1.16.1 g%B1.16.1 h%B1.16.1 sel%B2.3.2 out%B1.16.1; + +set a 0, +set b 0, +set c 0, +set d 0, +set e 0, +set f 0, +set g 0, +set h 0, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output; + +set sel 4, +eval, +output; + +set sel 5, +eval, +output; + +set sel 6, +eval, +output; + +set sel 7, +eval, +output; + +set a %B0001001000110100, +set b %B0010001101000101, +set c %B0011010001010110, +set d %B0100010101100111, +set e %B0101011001111000, +set f %B0110011110001001, +set g %B0111100010011010, +set h %B1000100110101011, +set sel 0, +eval, +output; + +set sel 1, +eval, +output; + +set sel 2, +eval, +output; + +set sel 3, +eval, +output; + +set sel 4, +eval, +output; + +set sel 5, +eval, +output; + +set sel 6, +eval, +output; + +set sel 7, +eval, +output;
Change 1 of 1 Show Entire File 01/​Not.cmp Stacked
 
 
 
 
 
1
2
3
@@ -0,0 +1,3 @@
+| in | out | +| 0 | 1 | +| 1 | 0 |
Change 1 of 1 Show Entire File 01/​Not.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/Not.hdl + +/** + * Not gate: out = not in + */ + +CHIP Not { + IN in; + OUT out; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Not.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+// 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/Not.tst + +load Not.hdl, +output-file Not.out, +compare-to Not.cmp, +output-list in%B3.1.3 out%B3.1.3; + +set in 0, +eval, +output; + +set in 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​Not16.cmp Stacked
 
 
 
 
 
 
 
 
1
2
3
4
5
6
@@ -0,0 +1,6 @@
+| in | out | +| 0000000000000000 | 1111111111111111 | +| 1111111111111111 | 0000000000000000 | +| 1010101010101010 | 0101010101010101 | +| 0011110011000011 | 1100001100111100 | +| 0001001000110100 | 1110110111001011 |
Change 1 of 1 Show Entire File 01/​Not16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/Not16.hdl + +/** + * 16-bit Not gate: for i=0..15: out[i] = not in[i] + */ + +CHIP Not16 { + IN in[16]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Not16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -0,0 +1,29 @@
+// 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/Not16.tst + +load Not16.hdl, +output-file Not16.out, +compare-to Not16.cmp, +output-list in%B1.16.1 out%B1.16.1; + +set in %B0000000000000000, +eval, +output; + +set in %B1111111111111111, +eval, +output; + +set in %B1010101010101010, +eval, +output; + +set in %B0011110011000011, +eval, +output; + +set in %B0001001000110100, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Or.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | out | +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 1 |
Change 1 of 1 Show Entire File 01/​Or.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@@ -0,0 +1,16 @@
+// 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/Or.hdl + +/** + * Or gate: out = 1 if {a==1 or b==1}, 0 otherwise + */ + +CHIP Or { + IN a, b; + OUT out; + + PARTS: + // Put your code here: +}
Change 1 of 1 Show Entire File 01/​Or.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,29 @@
+// 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/Or.tst + +load Or.hdl, +output-file Or.out, +compare-to Or.cmp, +output-list a%B3.1.3 b%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output;
Change 1 of 1 Show Entire File 01/​Or16.cmp Stacked
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
@@ -0,0 +1,7 @@
+| a | b | out | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | +| 0000000000000000 | 1111111111111111 | 1111111111111111 | +| 1111111111111111 | 1111111111111111 | 1111111111111111 | +| 1010101010101010 | 0101010101010101 | 1111111111111111 | +| 0011110011000011 | 0000111111110000 | 0011111111110011 | +| 0001001000110100 | 1001100001110110 | 1001101001110110 |
Change 1 of 1 Show Entire File 01/​Or16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
@@ -0,0 +1,17 @@
+// 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 gate: 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: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Or16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -0,0 +1,39 @@
+// 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.tst + +load Or16.hdl, +output-file Or16.out, +compare-to Or16.cmp, +output-list a%B1.16.1 b%B1.16.1 out%B1.16.1; + +set a %B0000000000000000, +set b %B0000000000000000, +eval, +output; + +set a %B0000000000000000, +set b %B1111111111111111, +eval, +output; + +set a %B1111111111111111, +set b %B1111111111111111, +eval, +output; + +set a %B1010101010101010, +set b %B0101010101010101, +eval, +output; + +set a %B0011110011000011, +set b %B0000111111110000, +eval, +output; + +set a %B0001001000110100, +set b %B1001100001110110, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Or8Way.cmp Stacked
 
 
 
 
 
 
 
 
1
2
3
4
5
6
@@ -0,0 +1,6 @@
+| in | out | +| 00000000 | 0 | +| 11111111 | 1 | +| 00010000 | 1 | +| 00000001 | 1 | +| 00100110 | 1 |
Change 1 of 1 Show Entire File 01/​Or8Way.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/Or8Way.hdl + +/** + * 8-way or gate: out = in[0] or in[1] or ... or in[7]. + */ + +CHIP Or8Way { + IN in[8]; + OUT out; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Or8Way.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -0,0 +1,29 @@
+// 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/Or8Way.tst + +load Or8Way.hdl, +output-file Or8Way.out, +compare-to Or8Way.cmp, +output-list in%B2.8.2 out%B2.1.2; + +set in %B00000000, +eval, +output; + +set in %B11111111, +eval, +output; + +set in %B00010000, +eval, +output; + +set in %B00000001, +eval, +output; + +set in %B00100110, +eval, +output; \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Xor.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | out | +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 0 |
Change 1 of 1 Show Entire File 01/​Xor.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/Xor.hdl + +/** + * Exclusive-or gate: out = !(a == b). + */ + +CHIP Xor { + IN a, b; + OUT out; + + PARTS: + // Put your code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 01/​Xor.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,29 @@
+// 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/Xor.tst + +load Xor.hdl, +output-file Xor.out, +compare-to Xor.cmp, +output-list a%B3.1.3 b%B3.1.3 out%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output;
Change 1 of 1 Show Entire File 02/​ALU.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,37 @@
+| x | y |zx |nx |zy |ny | f |no | out |zr |ng | +| 0000000000000000 | 1111111111111111 | 1 | 0 | 1 | 0 | 1 | 0 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 1 | 1 | 1 | 1 | 0000000000000001 | 0 | 0 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 1 | 0 | 1 | 0 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 1 | 1 | 0 | 0 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 0 | 0 | 0 | 0 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 1 | 1 | 0 | 1 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 0 | 0 | 0 | 1 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 1 | 1 | 1 | 1 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 0 | 0 | 1 | 1 | 0000000000000001 | 0 | 0 | +| 0000000000000000 | 1111111111111111 | 0 | 1 | 1 | 1 | 1 | 1 | 0000000000000001 | 0 | 0 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 0 | 1 | 1 | 1 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 1 | 1 | 1 | 0 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 1 | 1 | 0 | 0 | 1 | 0 | 1111111111111110 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 0 | 0 | 1 | 0 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 0 | 1 | 0 | 0 | 1 | 1 | 0000000000000001 | 0 | 0 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 0 | 1 | 1 | 1 | 1111111111111111 | 0 | 1 | +| 0000000000000000 | 1111111111111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0000000000000000 | 1 | 0 | +| 0000000000000000 | 1111111111111111 | 0 | 1 | 0 | 1 | 0 | 1 | 1111111111111111 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 1 | 0 | 1 | 0 | 1 | 0 | 0000000000000000 | 1 | 0 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 1 | 1 | 1 | 1 | 0000000000000001 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 1 | 0 | 1 | 0 | 1111111111111111 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 1 | 1 | 0 | 0 | 0000000000010001 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 0 | 0 | 0 | 0 | 0000000000000011 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 1 | 1 | 0 | 1 | 1111111111101110 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 0 | 0 | 0 | 1 | 1111111111111100 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 1 | 1 | 1 | 1 | 1111111111101111 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 0 | 0 | 1 | 1 | 1111111111111101 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 0 | 1 | 1 | 1 | 1 | 1 | 0000000000010010 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 0 | 1 | 1 | 1 | 0000000000000100 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 1 | 1 | 1 | 0 | 0000000000010000 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 1 | 1 | 0 | 0 | 1 | 0 | 0000000000000010 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 0 | 0 | 1 | 0 | 0000000000010100 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 1 | 0 | 0 | 1 | 1 | 0000000000001110 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 0 | 1 | 1 | 1 | 1111111111110010 | 0 | 1 | +| 0000000000010001 | 0000000000000011 | 0 | 0 | 0 | 0 | 0 | 0 | 0000000000000001 | 0 | 0 | +| 0000000000010001 | 0000000000000011 | 0 | 1 | 0 | 1 | 0 | 1 | 0000000000010011 | 0 | 0 |
Change 1 of 1 Show Entire File 02/​ALU.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
 
@@ -0,0 +1,49 @@
+// 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/02/ALU.hdl + +/** + * The ALU. Computes one of the following functions: + * x+y, x-y, y-x, 0, 1, -1, x, y, -x, -y, !x, !y, + * x+1, y+1, x-1, y-1, x&y, x|y on two 16-bit inputs, + * according to 6 input bits denoted zx,nx,zy,ny,f,no. + * The bit-combinations that yield each function are + * documented in the book. In addition, the ALU + * computes two 1-bit outputs: if the ALU output + * is 0, zr is set to 1; otherwise zr is set to 0; + * If out<0, ng is set to 1; otherwise ng is set to 0. + */ + +// Implementation: the ALU manipulates the x and y +// inputs and then operates on the resulting values, +// as follows: +// if (zx==1) set x = 0 // 16-bit constant +// if (nx==1) set x = ~x // bitwise "not" +// if (zy==1) set y = 0 // 16-bit constant +// if (ny==1) set y = ~y // bitwise "not" +// if (f==1) set out = x + y // integer 2's complement addition +// if (f==0) set out = x & y // bitwise "and" +// if (no==1) set out = ~out // bitwise "not" +// if (out==0) set zr = 1 +// if (out<0) set ng = 1 + + +CHIP ALU { + IN + x[16], y[16], // 16-bit inputs + zx, // zero the x input? + nx, // negate the x input? + zy, // zero the y input? + ny, // negate the y input? + f, // compute out = x + y (if 1) or out = x & y (if 0) + no; // negate the out output? + + OUT + out[16], // 16-bit output + zr, // 1 if (out==0), 0 otherwise + ng; // 1 if (out<0), 0 otherwise + + PARTS: + // Put you code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 02/​ALU.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
@@ -0,0 +1,377 @@
+// 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/02/ALU.tst + +load ALU.hdl, +output-file ALU.out, +compare-to ALU.cmp, +output-list x%B1.16.1 y%B1.16.1 zx%B1.1.1 nx%B1.1.1 zy%B1.1.1 + ny%B1.1.1 f%B1.1.1 no%B1.1.1 out%B1.16.1 zr%B1.1.1 + ng%B1.1.1; + +set x %B0000000000000000, // x = 0 +set y %B1111111111111111; // y = -1 + +// Compute 0 +set zx 1, +set nx 0, +set zy 1, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute 1 +set zx 1, +set nx 1, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute -1 +set zx 1, +set nx 1, +set zy 1, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 0, +set no 0, +eval, +output; + +// Compute y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 0, +set no 0, +eval, +output; + +// Compute ~x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 0, +set no 1, +eval, +output; + +// Compute ~y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 0, +set no 1, +eval, +output; + +// Compute -x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute -y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 1, +eval, +output; + +// Compute x + 1 +set zx 0, +set nx 1, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute y + 1 +set zx 1, +set nx 1, +set zy 0, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute x - 1 +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 1, +set no 0, +eval, +output; + +// Compute y - 1 +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x + y +set zx 0, +set nx 0, +set zy 0, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x - y +set zx 0, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 1, +eval, +output; + +// Compute y - x +set zx 0, +set nx 0, +set zy 0, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute x & y +set zx 0, +set nx 0, +set zy 0, +set ny 0, +set f 0, +set no 0, +eval, +output; + +// Compute x | y +set zx 0, +set nx 1, +set zy 0, +set ny 1, +set f 0, +set no 1, +eval, +output; + +set x %B000000000010001, // x = 17 +set y %B000000000000011; // y = 3 + +// Compute 0 +set zx 1, +set nx 0, +set zy 1, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute 1 +set zx 1, +set nx 1, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute -1 +set zx 1, +set nx 1, +set zy 1, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 0, +set no 0, +eval, +output; + +// Compute y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 0, +set no 0, +eval, +output; + +// Compute ~x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 0, +set no 1, +eval, +output; + +// Compute ~y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 0, +set no 1, +eval, +output; + +// Compute -x +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute -y +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 1, +eval, +output; + +// Compute x + 1 +set zx 0, +set nx 1, +set zy 1, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute y + 1 +set zx 1, +set nx 1, +set zy 0, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute x - 1 +set zx 0, +set nx 0, +set zy 1, +set ny 1, +set f 1, +set no 0, +eval, +output; + +// Compute y - 1 +set zx 1, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x + y +set zx 0, +set nx 0, +set zy 0, +set ny 0, +set f 1, +set no 0, +eval, +output; + +// Compute x - y +set zx 0, +set nx 1, +set zy 0, +set ny 0, +set f 1, +set no 1, +eval, +output; + +// Compute y - x +set zx 0, +set nx 0, +set zy 0, +set ny 1, +set f 1, +set no 1, +eval, +output; + +// Compute x & y +set zx 0, +set nx 0, +set zy 0, +set ny 0, +set f 0, +set no 0, +eval, +output; + +// Compute x | y +set zx 0, +set nx 1, +set zy 0, +set ny 1, +set f 0, +set no 1, +eval, +output;
Change 1 of 1 Show Entire File 02/​Add16.cmp Stacked
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
@@ -0,0 +1,7 @@
+| a | b | out | +| 0000000000000000 | 0000000000000000 | 0000000000000000 | +| 0000000000000000 | 1111111111111111 | 1111111111111111 | +| 1111111111111111 | 1111111111111111 | 1111111111111110 | +| 1010101010101010 | 0101010101010101 | 1111111111111111 | +| 0011110011000011 | 0000111111110000 | 0100110010110011 | +| 0001001000110100 | 1001100001110110 | 1010101010101010 |
Change 1 of 1 Show Entire File 02/​Add16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
@@ -0,0 +1,17 @@
+// 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/02/Adder16.hdl + +/* + * Adds two 16-bit values. + * The most-significant carry bit is ignored. + */ + +CHIP Add16 { + IN a[16], b[16]; + OUT out[16]; + + PARTS: + // Put you code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 02/​Add16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,39 @@
+// 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/02/Add16.tst + +load Add16.hdl, +output-file Add16.out, +compare-to Add16.cmp, +output-list a%B1.16.1 b%B1.16.1 out%B1.16.1; + +set a %B0000000000000000, +set b %B0000000000000000, +eval, +output; + +set a %B0000000000000000, +set b %B1111111111111111, +eval, +output; + +set a %B1111111111111111, +set b %B1111111111111111, +eval, +output; + +set a %B1010101010101010, +set b %B0101010101010101, +eval, +output; + +set a %B0011110011000011, +set b %B0000111111110000, +eval, +output; + +set a %B0001001000110100, +set b %B1001100001110110, +eval, +output;
Change 1 of 1 Show Entire File 02/​FullAdder.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -0,0 +1,9 @@
+| a | b | c | sum | carry | +| 0 | 0 | 0 | 0 | 0 | +| 0 | 0 | 1 | 1 | 0 | +| 0 | 1 | 0 | 1 | 0 | +| 0 | 1 | 1 | 0 | 1 | +| 1 | 0 | 0 | 1 | 0 | +| 1 | 0 | 1 | 0 | 1 | +| 1 | 1 | 0 | 0 | 1 | +| 1 | 1 | 1 | 1 | 1 |
Change 1 of 1 Show Entire File 02/​FullAdder.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
@@ -0,0 +1,17 @@
+// 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/02/FullAdder.hdl + +/** + * Computes the sum of three bits. + */ + +CHIP FullAdder { + IN a, b, c; // 1-bit inputs + OUT sum, // Right bit of a + b + c + carry; // Left bit of a + b + c + + PARTS: + // Put you code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 02/​FullAdder.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
@@ -0,0 +1,47 @@
+// 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/02/FullAdder.tst + +load FullAdder.hdl, +output-file FullAdder.out, +compare-to FullAdder.cmp, +output-list a%B3.1.3 b%B3.1.3 c%B3.1.3 sum%B3.1.3 carry%B3.1.3; + +set a 0, +set b 0, +set c 0, +eval, +output; + +set c 1, +eval, +output; + +set b 1, +set c 0, +eval, +output; + +set c 1, +eval, +output; + +set a 1, +set b 0, +set c 0, +eval, +output; + +set c 1, +eval, +output; + +set b 1, +set c 0, +eval, +output; + +set c 1, +eval, +output;
Change 1 of 1 Show Entire File 02/​HalfAdder.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| a | b | sum | carry | +| 0 | 0 | 0 | 0 | +| 0 | 1 | 1 | 0 | +| 1 | 0 | 1 | 0 | +| 1 | 1 | 0 | 1 |
Change 1 of 1 Show Entire File 02/​HalfAdder.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@@ -0,0 +1,17 @@
+// 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/02/HalfAdder.hdl + +/** + * Computes the sum of two bits. + */ + +CHIP HalfAdder { + IN a, b; // 1-bit inputs + OUT sum, // Right bit of a + b + carry; // Left bit of a + b + + PARTS: + // Put you code here: +}
Change 1 of 1 Show Entire File 02/​HalfAdder.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,29 @@
+// 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/02/HalfAdder.tst + +load HalfAdder.hdl, +output-file HalfAdder.out, +compare-to HalfAdder.cmp, +output-list a%B3.1.3 b%B3.1.3 sum%B3.1.3 carry%B3.1.3; + +set a 0, +set b 0, +eval, +output; + +set a 0, +set b 1, +eval, +output; + +set a 1, +set b 0, +eval, +output; + +set a 1, +set b 1, +eval, +output;
Change 1 of 1 Show Entire File 02/​Inc16.cmp Stacked
 
 
 
 
 
 
 
1
2
3
4
5
@@ -0,0 +1,5 @@
+| in | out | +| 0000000000000000 | 0000000000000001 | +| 1111111111111111 | 0000000000000000 | +| 0000000000000101 | 0000000000000110 | +| 1111111111111011 | 1111111111111100 |
Change 1 of 1 Show Entire File 02/​Inc16.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
@@ -0,0 +1,16 @@
+// 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/02/Inc16.hdl + +/** + * 16-bit incrementer: out = in + 1 (arithmetic addition) + */ + +CHIP Inc16 { + IN in[16]; + OUT out[16]; + + PARTS: + // Put you code here: +} \ No newline at end of file
Change 1 of 1 Show Entire File 02/​Inc16.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -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/02/Inc16.tst + +load Inc16.hdl, +output-file Inc16.out, +compare-to Inc16.cmp, +output-list in%B1.16.1 out%B1.16.1; + +set in %B0000000000000000, // in = 0 +eval, +output; + +set in %B1111111111111111, // in = -1 +eval, +output; + +set in %B0000000000000101, // in = 5 +eval, +output; + +set in %B1111111111111011, // in = -5 +eval, +output;
Change 1 of 1 Show Entire File 03/​a/​Bit.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
@@ -0,0 +1,215 @@
+| time | in |load | out | +| 0+ | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | +| 1+ | 0 | 1 | 0 | +| 2 | 0 | 1 | 0 | +| 2+ | 1 | 0 | 0 | +| 3 | 1 | 0 | 0 | +| 3+ | 1 | 1 | 0 | +| 4 | 1 | 1 | 1 | +| 4+ | 0 | 0 | 1 | +| 5 | 0 | 0 | 1 | +| 5+ | 1 | 0 | 1 | +| 6 | 1 | 0 | 1 | +| 6+ | 0 | 1 | 1 | +| 7 | 0 | 1 | 0 | +| 7+ | 1 | 1 | 0 | +| 8 | 1 | 1 | 1 | +| 8+ | 0 | 0 | 1 | +| 9 | 0 | 0 | 1 | +| 9+ | 0 | 0 | 1 | +| 10 | 0 | 0 | 1 | +| 10+ | 0 | 0 | 1 | +| 11 | 0 | 0 | 1 | +| 11+ | 0 | 0 | 1 | +| 12 | 0 | 0 | 1 | +| 12+ | 0 | 0 | 1 | +| 13 | 0 | 0 | 1 | +| 13+ | 0 | 0 | 1 | +| 14 | 0 | 0 | 1 | +| 14+ | 0 | 0 | 1 | +| 15 | 0 | 0 | 1 | +| 15+ | 0 | 0 | 1 | +| 16 | 0 | 0 | 1 | +| 16+ | 0 | 0 | 1 | +| 17 | 0 | 0 | 1 | +| 17+ | 0 | 0 | 1 | +| 18 | 0 | 0 | 1 | +| 18+ | 0 | 0 | 1 | +| 19 | 0 | 0 | 1 | +| 19+ | 0 | 0 | 1 | +| 20 | 0 | 0 | 1 | +| 20+ | 0 | 0 | 1 | +| 21 | 0 | 0 | 1 | +| 21+ | 0 | 0 | 1 | +| 22 | 0 | 0 | 1 | +| 22+ | 0 | 0 | 1 | +| 23 | 0 | 0 | 1 | +| 23+ | 0 | 0 | 1 | +| 24 | 0 | 0 | 1 | +| 24+ | 0 | 0 | 1 | +| 25 | 0 | 0 | 1 | +| 25+ | 0 | 0 | 1 | +| 26 | 0 | 0 | 1 | +| 26+ | 0 | 0 | 1 | +| 27 | 0 | 0 | 1 | +| 27+ | 0 | 0 | 1 | +| 28 | 0 | 0 | 1 | +| 28+ | 0 | 0 | 1 | +| 29 | 0 | 0 | 1 | +| 29+ | 0 | 0 | 1 | +| 30 | 0 | 0 | 1 | +| 30+ | 0 | 0 | 1 | +| 31 | 0 | 0 | 1 | +| 31+ | 0 | 0 | 1 | +| 32 | 0 | 0 | 1 | +| 32+ | 0 | 0 | 1 | +| 33 | 0 | 0 | 1 | +| 33+ | 0 | 0 | 1 | +| 34 | 0 | 0 | 1 | +| 34+ | 0 | 0 | 1 | +| 35 | 0 | 0 | 1 | +| 35+ | 0 | 0 | 1 | +| 36 | 0 | 0 | 1 | +| 36+ | 0 | 0 | 1 | +| 37 | 0 | 0 | 1 | +| 37+ | 0 | 0 | 1 | +| 38 | 0 | 0 | 1 | +| 38+ | 0 | 0 | 1 | +| 39 | 0 | 0 | 1 | +| 39+ | 0 | 0 | 1 | +| 40 | 0 | 0 | 1 | +| 40+ | 0 | 0 | 1 | +| 41 | 0 | 0 | 1 | +| 41+ | 0 | 0 | 1 | +| 42 | 0 | 0 | 1 | +| 42+ | 0 | 0 | 1 | +| 43 | 0 | 0 | 1 | +| 43+ | 0 | 0 | 1 | +| 44 | 0 | 0 | 1 | +| 44+ | 0 | 0 | 1 | +| 45 | 0 | 0 | 1 | +| 45+ | 0 | 0 | 1 | +| 46 | 0 | 0 | 1 | +| 46+ | 0 | 0 | 1 | +| 47 | 0 | 0 | 1 | +| 47+ | 0 | 0 | 1 | +| 48 | 0 | 0 | 1 | +| 48+ | 0 | 0 | 1 | +| 49 | 0 | 0 | 1 | +| 49+ | 0 | 0 | 1 | +| 50 | 0 | 0 | 1 | +| 50+ | 0 | 0 | 1 | +| 51 | 0 | 0 | 1 | +| 51+ | 0 | 0 | 1 | +| 52 | 0 | 0 | 1 | +| 52+ | 0 | 0 | 1 | +| 53 | 0 | 0 | 1 | +| 53+ | 0 | 0 | 1 | +| 54 | 0 | 0 | 1 | +| 54+ | 0 | 0 | 1 | +| 55 | 0 | 0 | 1 | +| 55+ | 0 | 0 | 1 | +| 56 | 0 | 0 | 1 | +| 56+ | 0 | 0 | 1 | +| 57 | 0 | 0 | 1 | +| 57+ | 0 | 1 | 1 | +| 58 | 0 | 1 | 0 | +| 58+ | 1 | 0 | 0 | +| 59 | 1 | 0 | 0 | +| 59+ | 1 | 0 | 0 | +| 60 | 1 | 0 | 0 | +| 60+ | 1 | 0 | 0 | +| 61 | 1 | 0 | 0 | +| 61+ | 1 | 0 | 0 | +| 62 | 1 | 0 | 0 | +| 62+ | 1 | 0 | 0 | +| 63 | 1 | 0 | 0 | +| 63+ | 1 | 0 | 0 | +| 64 | 1 | 0 | 0 | +| 64+ | 1 | 0 | 0 | +| 65 | 1 | 0 | 0 | +| 65+ | 1 | 0 | 0 | +| 66 | 1 | 0 | 0 | +| 66+ | 1 | 0 | 0 | +| 67 | 1 | 0 | 0 | +| 67+ | 1 | 0 | 0 | +| 68 | 1 | 0 | 0 | +| 68+ | 1 | 0 | 0 | +| 69 | 1 | 0 | 0 | +| 69+ | 1 | 0 | 0 | +| 70 | 1 | 0 | 0 | +| 70+ | 1 | 0 | 0 | +| 71 | 1 | 0 | 0 | +| 71+ | 1 | 0 | 0 | +| 72 | 1 | 0 | 0 | +| 72+ | 1 | 0 | 0 | +| 73 | 1 | 0 | 0 | +| 73+ | 1 | 0 | 0 | +| 74 | 1 | 0 | 0 | +| 74+ | 1 | 0 | 0 | +| 75 | 1 | 0 | 0 | +| 75+ | 1 | 0 | 0 | +| 76 | 1 | 0 | 0 | +| 76+ | 1 | 0 | 0 | +| 77 | 1 | 0 | 0 | +| 77+ | 1 | 0 | 0 | +| 78 | 1 | 0 | 0 | +| 78+ | 1 | 0 | 0 | +| 79 | 1 | 0 | 0 | +| 79+ | 1 | 0 | 0 | +| 80 | 1 | 0 | 0 | +| 80+ | 1 | 0 | 0 | +| 81 | 1 | 0 | 0 | +| 81+ | 1 | 0 | 0 | +| 82 | 1 | 0 | 0 | +| 82+ | 1 | 0 | 0 | +| 83 | 1 | 0 | 0 | +| 83+ | 1 | 0 | 0 | +| 84 | 1 | 0 | 0 | +| 84+ | 1 | 0 | 0 | +| 85 | 1 | 0 | 0 | +| 85+ | 1 | 0 | 0 | +| 86 | 1 | 0 | 0 | +| 86+ | 1 | 0 | 0 | +| 87 | 1 | 0 | 0 | +| 87+ | 1 | 0 | 0 | +| 88 | 1 | 0 | 0 | +| 88+ | 1 | 0 | 0 | +| 89 | 1 | 0 | 0 | +| 89+ | 1 | 0 | 0 | +| 90 | 1 | 0 | 0 | +| 90+ | 1 | 0 | 0 | +| 91 | 1 | 0 | 0 | +| 91+ | 1 | 0 | 0 | +| 92 | 1 | 0 | 0 | +| 92+ | 1 | 0 | 0 | +| 93 | 1 | 0 | 0 | +| 93+ | 1 | 0 | 0 | +| 94 | 1 | 0 | 0 | +| 94+ | 1 | 0 | 0 | +| 95 | 1 | 0 | 0 | +| 95+ | 1 | 0 | 0 | +| 96 | 1 | 0 | 0 | +| 96+ | 1 | 0 | 0 | +| 97 | 1 | 0 | 0 | +| 97+ | 1 | 0 | 0 | +| 98 | 1 | 0 | 0 | +| 98+ | 1 | 0 | 0 | +| 99 | 1 | 0 | 0 | +| 99+ | 1 | 0 | 0 | +| 100 | 1 | 0 | 0 | +| 100+ | 1 | 0 | 0 | +| 101 | 1 | 0 | 0 | +| 101+ | 1 | 0 | 0 | +| 102 | 1 | 0 | 0 | +| 102+ | 1 | 0 | 0 | +| 103 | 1 | 0 | 0 | +| 103+ | 1 | 0 | 0 | +| 104 | 1 | 0 | 0 | +| 104+ | 1 | 0 | 0 | +| 105 | 1 | 0 | 0 | +| 105+ | 1 | 0 | 0 | +| 106 | 1 | 0 | 0 | +| 106+ | 1 | 0 | 0 | +| 107 | 1 | 0 | 0 |
Change 1 of 1 Show Entire File 03/​a/​Bit.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@@ -0,0 +1,18 @@
+// 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/03/a/Bit.hdl + +/** + * 1-bit register. + * If load[t]=1 then out[t+1] = in[t] + * else out does not change (out[t+1]=out[t]) + */ + +CHIP Bit { + IN in, load; + OUT out; + + PARTS: + // Put your code here: +}
Change 1 of 1 Show Entire File 03/​a/​Bit.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
@@ -0,0 +1,865 @@
+// 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/03/a/Bit.tst + +load Bit.hdl, +output-file Bit.out, +compare-to Bit.cmp, +output-list time%S1.4.1 in%B2.1.2 load%B2.1.2 out%B2.1.2; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 1, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 1, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 1, +tick, +output; + +tock, +output; + +set in 1, +set load 1, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 0, +tick, +output; + +tock, +output; + +set in 0, +set load 1, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output; + +set in 1, +set load 0, +tick, +output; + +tock, +output;
Change 1 of 1 Show Entire File 03/​a/​PC.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,31 @@
+| time | in |reset|load | inc | out | +| 0+ | 0 | 0 | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | 0 | 0 | +| 1+ | 0 | 0 | 0 | 1 | 0 | +| 2 | 0 | 0 | 0 | 1 | 1 | +| 2+ | -32123 | 0 | 0 | 1 | 1 | +| 3 | -32123 | 0 | 0 | 1 | 2 | +| 3+ | -32123 | 0 | 1 | 1 | 2 | +| 4 | -32123 | 0 | 1 | 1 | -32123 | +| 4+ | -32123 | 0 | 0 | 1 | -32123 | +| 5 | -32123 | 0 | 0 | 1 | -32122 | +| 5+ | -32123 | 0 | 0 | 1 | -32122 | +| 6 | -32123 | 0 | 0 | 1 | -32121 | +| 6+ | 12345 | 0 | 1 | 0 | -32121 | +| 7 | 12345 | 0 | 1 | 0 | 12345 | +| 7+ | 12345 | 1 | 1 | 0 | 12345 | +| 8 | 12345 | 1 | 1 | 0 | 0 | +| 8+ | 12345 | 0 | 1 | 1 | 0 | +| 9 | 12345 | 0 | 1 | 1 | 12345 | +| 9+ | 12345 | 1 | 1 | 1 | 12345 | +| 10 | 12345 | 1 | 1 | 1 | 0 | +| 10+ | 12345 | 0 | 0 | 1 | 0 | +| 11 | 12345 | 0 | 0 | 1 | 1 | +| 11+ | 12345 | 1 | 0 | 1 | 1 | +| 12 | 12345 | 1 | 0 | 1 | 0 | +| 12+ | 0 | 0 | 1 | 1 | 0 | +| 13 | 0 | 0 | 1 | 1 | 0 | +| 13+ | 0 | 0 | 0 | 1 | 0 | +| 14 | 0 | 0 | 0 | 1 | 1 | +| 14+ | 22222 | 1 | 0 | 0 | 1 | +| 15 | 22222 | 1 | 0 | 0 | 0 |
Change 1 of 1 Show Entire File 03/​a/​PC.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@@ -0,0 +1,24 @@
+// 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/03/a/PC.hdl + +/** + * A 16-bit counter with load and reset control bits. + * if (reset[t]==1) out[t+1] = 0 + * else if (load[t]==1) out[t+1] = in[t] + * else if (inc[t]==1) out[t+1] = out[t] + 1 (integer addition) + * else out[t+1] = out[t] + */ + +CHIP PC { + IN in[16],load,inc,reset; + OUT out[16]; + + PARTS: + // Put your code here: +} + + + +
Change 1 of 1 Show Entire File 03/​a/​PC.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@@ -0,0 +1,125 @@
+// 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/03/a/PC.tst + +load PC.hdl, +output-file PC.out, +compare-to PC.cmp, +output-list time%S1.4.1 in%D1.6.1 reset%B2.1.2 load%B2.1.2 inc%B2.1.2 out%D1.6.1; + +set in 0, +set reset 0, +set load 0, +set inc 0, +tick, +output; + +tock, +output; + +set inc 1, +tick, +output; + +tock, +output; + +set in -32123, +tick, +output; + +tock, +output; + +set load 1, +tick, +output; + +tock, +output; + +set load 0, +tick, +output; + +tock, +output; + +tick, +output; + +tock, +output; + +set in 12345, +set load 1, +set inc 0, +tick, +output; + +tock, +output; + +set reset 1, +tick, +output; + +tock, +output; + +set reset 0, +set inc 1, +tick, +output; + +tock, +output; + +set reset 1, +tick, +output; + +tock, +output; + +set reset 0, +set load 0, +tick, +output; + +tock, +output; + +set reset 1, +tick, +output; + +tock, +output; + +set in 0, +set reset 0, +set load 1, +tick, +output; + +tock, +output; + +set load 0, +set inc 1, +tick, +output; + +tock, +output; + +set in 22222, +set reset 1, +set inc 0, +tick, +output; + +tock, +output;
Show Entire File 03/​a/​RAM64.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​a/​RAM64.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
@@ -0,0 +1,19 @@
+// 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/03/a/RAM64.hdl + +/** + * Memory of 64 registers, each 16 bit-wide. Out hold the value + * stored at the memory location specified by address. If load=1, then + * the in value is loaded into the memory location specified by address + * (the loaded value will be emitted to out after the next time step.) + */ + +CHIP RAM64 { + IN in[16], load, address[6]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Show Entire File 03/​a/​RAM64.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​a/​RAM8.cmp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
@@ -0,0 +1,173 @@
+| time | in |load |address| out | +| 0+ | 0 | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | 0 | +| 1+ | 0 | 1 | 0 | 0 | +| 2 | 0 | 1 | 0 | 0 | +| 2+ | 11111 | 0 | 0 | 0 | +| 3 | 11111 | 0 | 0 | 0 | +| 3+ | 11111 | 1 | 1 | 0 | +| 4 | 11111 | 1 | 1 | 11111 | +| 4+ | 11111 | 0 | 0 | 0 | +| 5 | 11111 | 0 | 0 | 0 | +| 5+ | 3333 | 0 | 3 | 0 | +| 6 | 3333 | 0 | 3 | 0 | +| 6+ | 3333 | 1 | 3 | 0 | +| 7 | 3333 | 1 | 3 | 3333 | +| 7+ | 3333 | 0 | 3 | 3333 | +| 8 | 3333 | 0 | 3 | 3333 | +| 8 | 3333 | 0 | 1 | 11111 | +| 8+ | 7777 | 0 | 1 | 11111 | +| 9 | 7777 | 0 | 1 | 11111 | +| 9+ | 7777 | 1 | 7 | 0 | +| 10 | 7777 | 1 | 7 | 7777 | +| 10+ | 7777 | 0 | 7 | 7777 | +| 11 | 7777 | 0 | 7 | 7777 | +| 11 | 7777 | 0 | 3 | 3333 | +| 11 | 7777 | 0 | 7 | 7777 | +| 11+ | 7777 | 0 | 0 | 0 | +| 12 | 7777 | 0 | 0 | 0 | +| 12 | 7777 | 0 | 1 | 11111 | +| 12 | 7777 | 0 | 2 | 0 | +| 12 | 7777 | 0 | 3 | 3333 | +| 12 | 7777 | 0 | 4 | 0 | +| 12 | 7777 | 0 | 5 | 0 | +| 12 | 7777 | 0 | 6 | 0 | +| 12 | 7777 | 0 | 7 | 7777 | +| 12+ | 21845 | 1 | 0 | 0 | +| 13 | 21845 | 1 | 0 | 21845 | +| 13+ | 21845 | 1 | 1 | 11111 | +| 14 | 21845 | 1 | 1 | 21845 | +| 14+ | 21845 | 1 | 2 | 0 | +| 15 | 21845 | 1 | 2 | 21845 | +| 15+ | 21845 | 1 | 3 | 3333 | +| 16 | 21845 | 1 | 3 | 21845 | +| 16+ | 21845 | 1 | 4 | 0 | +| 17 | 21845 | 1 | 4 | 21845 | +| 17+ | 21845 | 1 | 5 | 0 | +| 18 | 21845 | 1 | 5 | 21845 | +| 18+ | 21845 | 1 | 6 | 0 | +| 19 | 21845 | 1 | 6 | 21845 | +| 19+ | 21845 | 1 | 7 | 7777 | +| 20 | 21845 | 1 | 7 | 21845 | +| 20+ | 21845 | 0 | 0 | 21845 | +| 21 | 21845 | 0 | 0 | 21845 | +| 21 | 21845 | 0 | 1 | 21845 | +| 21 | 21845 | 0 | 2 | 21845 | +| 21 | 21845 | 0 | 3 | 21845 | +| 21 | 21845 | 0 | 4 | 21845 | +| 21 | 21845 | 0 | 5 | 21845 | +| 21 | 21845 | 0 | 6 | 21845 | +| 21 | 21845 | 0 | 7 | 21845 | +| 21+ | -21846 | 1 | 0 | 21845 | +| 22 | -21846 | 1 | 0 | -21846 | +| 22+ | -21846 | 0 | 0 | -21846 | +| 23 | -21846 | 0 | 0 | -21846 | +| 23 | -21846 | 0 | 1 | 21845 | +| 23 | -21846 | 0 | 2 | 21845 | +| 23 | -21846 | 0 | 3 | 21845 | +| 23 | -21846 | 0 | 4 | 21845 | +| 23 | -21846 | 0 | 5 | 21845 | +| 23 | -21846 | 0 | 6 | 21845 | +| 23 | -21846 | 0 | 7 | 21845 | +| 23+ | 21845 | 1 | 0 | -21846 | +| 24 | 21845 | 1 | 0 | 21845 | +| 24+ | -21846 | 1 | 1 | 21845 | +| 25 | -21846 | 1 | 1 | -21846 | +| 25+ | -21846 | 0 | 0 | 21845 | +| 26 | -21846 | 0 | 0 | 21845 | +| 26 | -21846 | 0 | 1 | -21846 | +| 26 | -21846 | 0 | 2 | 21845 | +| 26 | -21846 | 0 | 3 | 21845 | +| 26 | -21846 | 0 | 4 | 21845 | +| 26 | -21846 | 0 | 5 | 21845 | +| 26 | -21846 | 0 | 6 | 21845 | +| 26 | -21846 | 0 | 7 | 21845 | +| 26+ | 21845 | 1 | 1 | -21846 | +| 27 | 21845 | 1 | 1 | 21845 | +| 27+ | -21846 | 1 | 2 | 21845 | +| 28 | -21846 | 1 | 2 | -21846 | +| 28+ | -21846 | 0 | 0 | 21845 | +| 29 | -21846 | 0 | 0 | 21845 | +| 29 | -21846 | 0 | 1 | 21845 | +| 29 | -21846 | 0 | 2 | -21846 | +| 29 | -21846 | 0 | 3 | 21845 | +| 29 | -21846 | 0 | 4 | 21845 | +| 29 | -21846 | 0 | 5 | 21845 | +| 29 | -21846 | 0 | 6 | 21845 | +| 29 | -21846 | 0 | 7 | 21845 | +| 29+ | 21845 | 1 | 2 | -21846 | +| 30 | 21845 | 1 | 2 | 21845 | +| 30+ | -21846 | 1 | 3 | 21845 | +| 31 | -21846 | 1 | 3 | -21846 | +| 31+ | -21846 | 0 | 0 | 21845 | +| 32 | -21846 | 0 | 0 | 21845 | +| 32 | -21846 | 0 | 1 | 21845 | +| 32 | -21846 | 0 | 2 | 21845 | +| 32 | -21846 | 0 | 3 | -21846 | +| 32 | -21846 | 0 | 4 | 21845 | +| 32 | -21846 | 0 | 5 | 21845 | +| 32 | -21846 | 0 | 6 | 21845 | +| 32 | -21846 | 0 | 7 | 21845 | +| 32+ | 21845 | 1 | 3 | -21846 | +| 33 | 21845 | 1 | 3 | 21845 | +| 33+ | -21846 | 1 | 4 | 21845 | +| 34 | -21846 | 1 | 4 | -21846 | +| 34+ | -21846 | 0 | 0 | 21845 | +| 35 | -21846 | 0 | 0 | 21845 | +| 35 | -21846 | 0 | 1 | 21845 | +| 35 | -21846 | 0 | 2 | 21845 | +| 35 | -21846 | 0 | 3 | 21845 | +| 35 | -21846 | 0 | 4 | -21846 | +| 35 | -21846 | 0 | 5 | 21845 | +| 35 | -21846 | 0 | 6 | 21845 | +| 35 | -21846 | 0 | 7 | 21845 | +| 35+ | 21845 | 1 | 4 | -21846 | +| 36 | 21845 | 1 | 4 | 21845 | +| 36+ | -21846 | 1 | 5 | 21845 | +| 37 | -21846 | 1 | 5 | -21846 | +| 37+ | -21846 | 0 | 0 | 21845 | +| 38 | -21846 | 0 | 0 | 21845 | +| 38 | -21846 | 0 | 1 | 21845 | +| 38 | -21846 | 0 | 2 | 21845 | +| 38 | -21846 | 0 | 3 | 21845 | +| 38 | -21846 | 0 | 4 | 21845 | +| 38 | -21846 | 0 | 5 | -21846 | +| 38 | -21846 | 0 | 6 | 21845 | +| 38 | -21846 | 0 | 7 | 21845 | +| 38+ | 21845 | 1 | 5 | -21846 | +| 39 | 21845 | 1 | 5 | 21845 | +| 39+ | -21846 | 1 | 6 | 21845 | +| 40 | -21846 | 1 | 6 | -21846 | +| 40+ | -21846 | 0 | 0 | 21845 | +| 41 | -21846 | 0 | 0 | 21845 | +| 41 | -21846 | 0 | 1 | 21845 | +| 41 | -21846 | 0 | 2 | 21845 | +| 41 | -21846 | 0 | 3 | 21845 | +| 41 | -21846 | 0 | 4 | 21845 | +| 41 | -21846 | 0 | 5 | 21845 | +| 41 | -21846 | 0 | 6 | -21846 | +| 41 | -21846 | 0 | 7 | 21845 | +| 41+ | 21845 | 1 | 6 | -21846 | +| 42 | 21845 | 1 | 6 | 21845 | +| 42+ | -21846 | 1 | 7 | 21845 | +| 43 | -21846 | 1 | 7 | -21846 | +| 43+ | -21846 | 0 | 0 | 21845 | +| 44 | -21846 | 0 | 0 | 21845 | +| 44 | -21846 | 0 | 1 | 21845 | +| 44 | -21846 | 0 | 2 | 21845 | +| 44 | -21846 | 0 | 3 | 21845 | +| 44 | -21846 | 0 | 4 | 21845 | +| 44 | -21846 | 0 | 5 | 21845 | +| 44 | -21846 | 0 | 6 | 21845 | +| 44 | -21846 | 0 | 7 | -21846 | +| 44+ | 21845 | 1 | 7 | -21846 | +| 45 | 21845 | 1 | 7 | 21845 | +| 45+ | 21845 | 0 | 0 | 21845 | +| 46 | 21845 | 0 | 0 | 21845 | +| 46 | 21845 | 0 | 1 | 21845 | +| 46 | 21845 | 0 | 2 | 21845 | +| 46 | 21845 | 0 | 3 | 21845 | +| 46 | 21845 | 0 | 4 | 21845 | +| 46 | 21845 | 0 | 5 | 21845 | +| 46 | 21845 | 0 | 6 | 21845 | +| 46 | 21845 | 0 | 7 | 21845 |
Change 1 of 1 Show Entire File 03/​a/​RAM8.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
@@ -0,0 +1,19 @@
+// 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/03/a/RAM8.hdl + +/** + * Memory of 8 registers, each 16 bit-wide. Out holds the value + * stored at the memory location specified by address. If load=1, then + * the in value is loaded into the memory location specified by address + * (the loaded value will be emitted to out after the next time step.) + */ + +CHIP RAM8 { + IN in[16], load, address[3]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Show Entire File 03/​a/​RAM8.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 03/​a/​Register.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​a/​Register.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@@ -0,0 +1,18 @@
+// 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/03/a/Register.hdl + +/** + * 16-bit register. + * If load[t]=1 then out[t+1] = in[t] + * else out does not change + */ + +CHIP Register { + IN in[16], load; + OUT out[16]; + + PARTS: + // Put your code here: +}
Show Entire File 03/​a/​Register.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 03/​b/​RAM16K.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​b/​RAM16K.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
@@ -0,0 +1,19 @@
+// 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/03/b/RAM16K.hdl + +/** + * Memory of 16K registers, each 16 bit-wide. Out holds the value + * stored at the memory location specified by address. If load=1, then + * the in value is loaded into the memory location specified by address + * (the loaded value will be emitted to out after the next time step.) + */ + +CHIP RAM16K { + IN in[16], load, address[14]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Show Entire File 03/​b/​RAM16K.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 03/​b/​RAM4K.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​b/​RAM4K.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
@@ -0,0 +1,19 @@
+// 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/03/b/RAM4K.hdl + +/** + * Memory of 4K registers, each 16 bit-wide. Out hold the value + * stored at the memory location specified by address. If load=1, then + * the in value is loaded into the memory location specified by address + * (the loaded value will be emitted to out after the next time step.) + */ + +CHIP RAM4K { + IN in[16], load, address[12]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Show Entire File 03/​b/​RAM4K.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 03/​b/​RAM512.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 03/​b/​RAM512.hdl Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
@@ -0,0 +1,19 @@
+// This file is part of the materials accompanying the book +// "The Elements of Computing Systems" by Nisan and Schocken, +// MIT Press. Book site: www.idc.ac.il/tecs +// File name: projects/03/b/RAM512.hdl + +/** + * Memory of 512 registers, each 16 bit-wide. Out holds the value + * stored at the memory location specified by address. If load=1, then + * the in value is loaded into the memory location specified by address + * (the loaded value will be emitted to out after the next time step.) + */ + +CHIP RAM512 { + IN in[16], load, address[9]; + OUT out[16]; + + PARTS: + // Put your code here: +} \ No newline at end of file
Show Entire File 03/​b/​RAM512.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 04/​fill/​Fill.asm Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
 
@@ -0,0 +1,11 @@
+// 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/04/Fill.asm + +// Runs an infinite loop that listens to the keyboard input. +// When a key is pressed (any key), the program blackens the screen, +// i.e. writes "black" in every pixel. When no key is pressed, the +// program clears the screen, i.e. writes "white" in every pixel. + +// Put your code here. \ No newline at end of file
Change 1 of 1 Show Entire File 04/​fill/​Fill.tst Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
@@ -0,0 +1,11 @@
+// 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/04/fill/Fill.tst + +load Fill.hack; +echo "First, make sure that 'No Animation' is selected. Then, select the Keyboard, click on any key, and check the screen."; + +repeat { + ticktock; +}
Change 1 of 1 Show Entire File 04/​mult/​Mult.asm Stacked
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
 
@@ -0,0 +1,9 @@
+// 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/04/Mult.asm + +// Multiplies R0 and R1 and stores the result in R2. +// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[3], respectively.) + +// Put your code here. \ No newline at end of file
Change 1 of 1 Show Entire File 04/​mult/​Mult.cmp Stacked
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
 
@@ -0,0 +1,7 @@
+| RAM[0] | RAM[1] | RAM[2] | +| 0 | 0 | 0 | +| 1 | 0 | 0 | +| 0 | 2 | 0 | +| 3 | 1 | 3 | +| 2 | 4 | 8 | +| 6 | 7 | 42 | \ No newline at end of file
Show Entire File 04/​mult/​Mult.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 05/​Add.hack Stacked
 
 
 
 
 
 
 
 
1
2
3
4
5
6
@@ -0,0 +1,6 @@
+0000000000000010 +1110110000010000 +0000000000000011 +1110000010010000 +0000000000000000 +1110001100001000
Show Entire File 05/​CPU-external.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​CPU-external.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​CPU.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​CPU.hdl Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​CPU.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Computer.hdl Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerAdd-external.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerAdd-external.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerAdd.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerAdd.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerMax-external.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerMax-external.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerMax.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerMax.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerRect-external.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerRect-external.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerRect.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​ComputerRect.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Max.hack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Memory.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Memory.hdl Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Memory.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 05/​Rect.hack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Change 1 of 1 Show Entire File 06/​add/​Add.asm Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
@@ -0,0 +1,13 @@
+// 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/06/add/Add.asm + +// Computes R0 = 2 + 3 + +@2 +D=A +@3 +D=D+A +@0 +M=D
Show Entire File 06/​max/​Max.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 06/​max/​MaxL.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 06/​pong/​Pong.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 06/​pong/​PongL.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 06/​rect/​Rect.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 06/​rect/​RectL.asm Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
 
 
Show Entire File 09/​Square/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 09/​Square/​Square.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 09/​Square/​SquareGame.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​ArrayTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​ArrayTest/​Main.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​ArrayTest/​MainT.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​ExpressionlessSquare/​Main.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​Main.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​MainT.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​Square.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​Square.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​SquareGame.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​SquareGame.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​SquareGameT.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 10/​Square/​SquareT.xml Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Average/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​ComplexArrays/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​ConvertToBin/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Ball.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Ball.jack.bak Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Bat.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Bat.jack.bak Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​Main.jack.bak Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​PongGame.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Pong/​PongGame.jack.bak Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Seven/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Square/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Square/​Square.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 11/​Square/​SquareGame.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​Array.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​ArrayTest/​ArrayTest.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​ArrayTest/​ArrayTest.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​ArrayTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​Keyboard.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Added image
Show Entire File 12/​KeyboardTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​Math.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MathTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MathTest/​MathTest.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MathTest/​MathTest.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​Memory.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MemoryTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MemoryTest/​MemoryTest.cmp Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​MemoryTest/​MemoryTest.tst Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​Output.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​OutputTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Added image
Show Entire File 12/​Screen.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​ScreenTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Added image
Show Entire File 12/​String.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​StringTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Added image
Show Entire File 12/​Sys.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 12/​SysTest/​Main.jack Stacked
This file's diff was not loaded because this changeset is very large. Load changes
Show Entire File 13/​more fun to go.txt Stacked
This file's diff was not loaded because this changeset is very large. Load changes