diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f47cb20 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.out diff --git a/logicGates/And.cmp b/logicGates/And.cmp new file mode 100644 index 0000000..7a3c7de --- /dev/null +++ b/logicGates/And.cmp @@ -0,0 +1,5 @@ +| a | b |out| +| 0 | 0 | 0 | +| 0 | 1 | 0 | +| 1 | 0 | 0 | +| 1 | 1 | 1 | diff --git a/logicGates/And.tst b/logicGates/And.tst new file mode 100644 index 0000000..a1c5aac --- /dev/null +++ b/logicGates/And.tst @@ -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/1/And.tst + +load And.hdl, +output-file And.out, +compare-to And.cmp, +output-list a b out; + +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; diff --git a/logicGates/And16.cmp b/logicGates/And16.cmp new file mode 100644 index 0000000..fb8dbfc --- /dev/null +++ b/logicGates/And16.cmp @@ -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 | diff --git a/logicGates/And16.tst b/logicGates/And16.tst new file mode 100644 index 0000000..472ac1b --- /dev/null +++ b/logicGates/And16.tst @@ -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/1/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 diff --git a/logicGates/DMux.cmp b/logicGates/DMux.cmp new file mode 100644 index 0000000..5b65adb --- /dev/null +++ b/logicGates/DMux.cmp @@ -0,0 +1,5 @@ +|in |sel| a | b | +| 0 | 0 | 0 | 0 | +| 0 | 1 | 0 | 0 | +| 1 | 0 | 1 | 0 | +| 1 | 1 | 0 | 1 | diff --git a/logicGates/DMux.tst b/logicGates/DMux.tst new file mode 100644 index 0000000..18a54eb --- /dev/null +++ b/logicGates/DMux.tst @@ -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/1/DMux.tst + +load DMux.hdl, +output-file DMux.out, +compare-to DMux.cmp, +output-list in sel a b; + +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; diff --git a/logicGates/DMux4Way.cmp b/logicGates/DMux4Way.cmp new file mode 100644 index 0000000..7734e2a --- /dev/null +++ b/logicGates/DMux4Way.cmp @@ -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 | diff --git a/logicGates/DMux4Way.tst b/logicGates/DMux4Way.tst new file mode 100644 index 0000000..24788fa --- /dev/null +++ b/logicGates/DMux4Way.tst @@ -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/1/DMux4Way.tst + +load DMux4Way.hdl, +output-file DMux4Way.out, +compare-to DMux4Way.cmp, +output-list in sel%B2.2.2 a b c d; + +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; diff --git a/logicGates/DMux8Way.cmp b/logicGates/DMux8Way.cmp new file mode 100644 index 0000000..e1b2e74 --- /dev/null +++ b/logicGates/DMux8Way.cmp @@ -0,0 +1,17 @@ +|in | sel | a | b | c | d | e | f | g | h | +| 0 | 000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 001 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 010 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 100 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 101 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 110 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 0 | 111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 000 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 001 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 010 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | +| 1 | 011 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | +| 1 | 100 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | +| 1 | 101 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | +| 1 | 110 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | +| 1 | 111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | diff --git a/logicGates/DMux8Way.tst b/logicGates/DMux8Way.tst new file mode 100644 index 0000000..17cfc5b --- /dev/null +++ b/logicGates/DMux8Way.tst @@ -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/1/DMux8Way.tst + +load DMux8Way.hdl, +output-file DMux8Way.out, +compare-to DMux8Way.cmp, +output-list in sel%B2.3.2 a b c d e f g h; + +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; diff --git a/logicGates/Mux.cmp b/logicGates/Mux.cmp new file mode 100644 index 0000000..eb25f2e --- /dev/null +++ b/logicGates/Mux.cmp @@ -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 | diff --git a/logicGates/Mux.tst b/logicGates/Mux.tst new file mode 100644 index 0000000..80427df --- /dev/null +++ b/logicGates/Mux.tst @@ -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/1/Mux.tst + +load Mux.hdl, +output-file Mux.out, +compare-to Mux.cmp, +output-list a b sel out; + +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; diff --git a/logicGates/Mux16.cmp b/logicGates/Mux16.cmp new file mode 100644 index 0000000..80b6ece --- /dev/null +++ b/logicGates/Mux16.cmp @@ -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 | diff --git a/logicGates/Mux16.tst b/logicGates/Mux16.tst new file mode 100644 index 0000000..5b7d2b7 --- /dev/null +++ b/logicGates/Mux16.tst @@ -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/1/Mux16.tst + +load Mux16.hdl, +output-file Mux16.out, +compare-to Mux16.cmp, +output-list a%B1.16.1 b%B1.16.1 sel 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 diff --git a/logicGates/Mux4Way16.cmp b/logicGates/Mux4Way16.cmp new file mode 100644 index 0000000..659176d --- /dev/null +++ b/logicGates/Mux4Way16.cmp @@ -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 | diff --git a/logicGates/Mux4Way16.tst b/logicGates/Mux4Way16.tst new file mode 100644 index 0000000..eea029f --- /dev/null +++ b/logicGates/Mux4Way16.tst @@ -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/1/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; diff --git a/logicGates/Mux8Way16.cmp b/logicGates/Mux8Way16.cmp new file mode 100644 index 0000000..11ff518 --- /dev/null +++ b/logicGates/Mux8Way16.cmp @@ -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 | diff --git a/logicGates/Mux8Way16.tst b/logicGates/Mux8Way16.tst new file mode 100644 index 0000000..f839ac1 --- /dev/null +++ b/logicGates/Mux8Way16.tst @@ -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/1/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; diff --git a/logicGates/Not.cmp b/logicGates/Not.cmp new file mode 100644 index 0000000..9b48db2 --- /dev/null +++ b/logicGates/Not.cmp @@ -0,0 +1,3 @@ +|in |out| +| 0 | 1 | +| 1 | 0 | diff --git a/logicGates/Not.tst b/logicGates/Not.tst new file mode 100644 index 0000000..916ea55 --- /dev/null +++ b/logicGates/Not.tst @@ -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/1/Not.tst + +load Not.hdl, +output-file Not.out, +compare-to Not.cmp, +output-list in out; + +set in 0, +eval, +output; + +set in 1, +eval, +output; diff --git a/logicGates/Not16.cmp b/logicGates/Not16.cmp new file mode 100644 index 0000000..ae2ad1d --- /dev/null +++ b/logicGates/Not16.cmp @@ -0,0 +1,6 @@ +| in | out | +| 0000000000000000 | 1111111111111111 | +| 1111111111111111 | 0000000000000000 | +| 1010101010101010 | 0101010101010101 | +| 0011110011000011 | 1100001100111100 | +| 0001001000110100 | 1110110111001011 | diff --git a/logicGates/Not16.tst b/logicGates/Not16.tst new file mode 100644 index 0000000..ae7ce18 --- /dev/null +++ b/logicGates/Not16.tst @@ -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/1/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 diff --git a/logicGates/Or.cmp b/logicGates/Or.cmp new file mode 100644 index 0000000..11f9d64 --- /dev/null +++ b/logicGates/Or.cmp @@ -0,0 +1,5 @@ +| a | b |out| +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 1 | diff --git a/logicGates/Or.tst b/logicGates/Or.tst new file mode 100644 index 0000000..a9127da --- /dev/null +++ b/logicGates/Or.tst @@ -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/1/Or.tst + +load Or.hdl, +output-file Or.out, +compare-to Or.cmp, +output-list a b out; + +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; diff --git a/logicGates/Or16.cmp b/logicGates/Or16.cmp new file mode 100644 index 0000000..8664afe --- /dev/null +++ b/logicGates/Or16.cmp @@ -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 | diff --git a/logicGates/Or16.tst b/logicGates/Or16.tst new file mode 100644 index 0000000..f6a422f --- /dev/null +++ b/logicGates/Or16.tst @@ -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/1/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 diff --git a/logicGates/Or8Way.cmp b/logicGates/Or8Way.cmp new file mode 100644 index 0000000..a1d2c4a --- /dev/null +++ b/logicGates/Or8Way.cmp @@ -0,0 +1,6 @@ +| in |out| +| 00000000 | 0 | +| 11111111 | 1 | +| 00010000 | 1 | +| 00000001 | 1 | +| 00100110 | 1 | diff --git a/logicGates/Or8Way.tst b/logicGates/Or8Way.tst new file mode 100644 index 0000000..7189210 --- /dev/null +++ b/logicGates/Or8Way.tst @@ -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/1/Or8Way.tst + +load Or8Way.hdl, +output-file Or8Way.out, +compare-to Or8Way.cmp, +output-list in%B2.8.2 out; + +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 diff --git a/logicGates/Xor.cmp b/logicGates/Xor.cmp new file mode 100644 index 0000000..3737173 --- /dev/null +++ b/logicGates/Xor.cmp @@ -0,0 +1,5 @@ +| a | b |out| +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 0 | diff --git a/logicGates/Xor.tst b/logicGates/Xor.tst new file mode 100644 index 0000000..f5dfb14 --- /dev/null +++ b/logicGates/Xor.tst @@ -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/1/Xor.tst + +load Xor.hdl, +output-file Xor.out, +compare-to Xor.cmp, +output-list a b out; + +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;