summaryrefslogtreecommitdiff
path: root/projects/05/Computer.hdl
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-08-16 11:54:23 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-08-16 11:54:23 +0800
commit9542deeb483a00b6fabed7574720926ce97d7511 (patch)
tree0f2c1f72c03dd4693fd59df67544d2a4dddc5494 /projects/05/Computer.hdl
parent9c0cb1d1c32724fc95ac9548e4f8d873d3adaccc (diff)
Projects, 01-06 completed
Diffstat (limited to 'projects/05/Computer.hdl')
-rw-r--r--projects/05/Computer.hdl25
1 files changed, 25 insertions, 0 deletions
diff --git a/projects/05/Computer.hdl b/projects/05/Computer.hdl
new file mode 100644
index 0000000..a9620c2
--- /dev/null
+++ b/projects/05/Computer.hdl
@@ -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/05/Computer.hdl
+
+/**
+ * The HACK computer, including CPU, ROM and RAM.
+ * When reset is 0, the program stored in the computer's ROM executes.
+ * When reset is 1, the execution of the program restarts.
+ * Thus, to start a program's execution, reset must be pushed "up" (1)
+ * and "down" (0). From this point onward the user is at the mercy of
+ * the software. In particular, depending on the program's code, the
+ * screen may show some output and the user may be able to interact
+ * with the computer via the keyboard.
+ */
+
+CHIP Computer {
+
+ IN reset;
+
+ PARTS:
+ ROM32K(address=pc, out=instruction);
+ CPU(inM=inM, instruction=instruction, reset=reset, writeM=writeM, outM=outM, addressM=addressM, pc=pc);
+ Memory(in=outM, address=addressM, load=writeM, out=inM);
+}