-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputer.hdl
More file actions
32 lines (24 loc) · 1000 Bytes
/
Computer.hdl
File metadata and controls
32 lines (24 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
/**
* 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:
// CPU
CPU (inM=RAMout, instruction=ROMout, reset=reset, writeM=loadRAM,
outM=RAMin, addressM=RAMaddress, pc=ROMaddress);
// RAM
Memory (in=RAMin, load=loadRAM, address=RAMaddress, out=RAMout);
// ROM
ROM32K (address=ROMaddress, out=ROMout);
}