nand2tetris/projects/05/Computer.hdl

42 lines
1.1 KiB
VHDL
Raw Normal View History

2020-05-19 12:42:52 +00:00
// 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.
2020-05-19 12:42:52 +00:00
* 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
2020-05-19 12:42:52 +00:00
* with the computer via the keyboard.
*/
CHIP Computer {
IN reset;
PARTS:
CPU(
inM=RAMRead,
instruction=instruction,
reset=reset,
outM=RAMWrite,
writeM=writeM,
addressM=RAMReadWriteAddress,
pc=instructionPointer);
ROM32K(
address=instructionPointer,
out=instruction
);
Memory(in=RAMWrite,
load=writeM,
address=RAMReadWriteAddress,
out=RAMRead);
2020-05-19 12:42:52 +00:00
}