The Elements of Computing Systems: Building a Modern Computer from First Principles
I have been wondering how modern computers were built and saw Shimon Schocken’s presentation at TED, which introduced a course for students to build a modern computer that describes how modern computers are built from basic gate circuits. Each chapter introduces a project, one by one to complete these projects, you can construct a 16-bit Hack computer hardware emulator, based on this emulator, developed assembler and stacking virtual machine, designed Jack advanced programming language, As well as its compiler. Using the Java language to complete the various chapters of the project, and published to GitHub.
Contents
- Resource
- Projects
- Typical hardware architecture (Chapter 1 ~ 5)
- Boolean Logic
Project 01
- Boolean Arithmetic
Project 02
- Sequential Logic
Project 03
- Machine Language
Project 04
- Computer Architecture
Project 05
- Boolean Logic
- Typical software architecture (Chapter 6 ~ 12)
- Assembler
Project 06
- Virtual Machine
Project 07
,Project 08
- Compiler
Project 10
,Project 11
- Operating System
Project 12
- Jack High-Level Language and Demo
Project 09
- Assembler
- Typical hardware architecture (Chapter 1 ~ 5)
- Copyright & License
- Footnotes
Resource
- This book: The Elements of Computing Systems 1
-
Official website:http://www.nand2tetris.org
-
Course materials: http://www.nand2tetris.org/course.php
-
Nand2Tetris Software: Download
-
Setup Guide for Windows Users
After downloading, put the downloaded zip file in an empty directory on your computer, and extract its contents as is, without changing the directories structure and names. In order to use the nand2tetris software tools, your computer must be equipped with a Java Run-time Environment. The JRE can be downloaded freely from many sites including this one. For best performance, download the latest available version.
-
Software Tools
For more detail: http://www.nand2tetris.org/software.php
Projects
Boolean Logic
Boolean Arithmetic
- Adders
- The Arithmetic Logic Unit (ALU)
Sequential Logic
Machine Language
Computer Architecture
Assembler
-
Test Program
-
Adds the constants 2 and 3, puts the result in R0 Add.asm
-
Computes max(R0, R1), puts the result in R2
- Draws a rectangle at the top left corner of the screen. 16 pixels wide and R0 pixels high.
-
A single-player Ping-Pong game.
-
Virtual Machine-Part1
-
Test porgram
-
Stack Arithmetic
-
Pushes and adds two constants SimpleAdd.vm
-
Executes a sequence of arithimetic and logical operations on the stack. StackTest.vm
-
-
Memory Access
-
Executes pop and push operations using the virtual memory segments. BasicTest.vm
-
Executes pop and push operations using the pointer:
this
,that
PointerTest.vm -
Executes pop and push operations using the static segments. StaticTest.vm
-
-
Virtual Machine-Part2
-
Test program
-
Test Programs for Program Flow Commands
-
Computes 1+2+…+n and pushes the result onto the stack. BasicLoop.vm
-
Fibonacci FibonacciSeries.vm
-
-
Test Programs for Function Calling Commands
-
Performs a simple calculation and returns the result. SimpleFunction.vm
-
Calling the nested Function Sys.vm
-
This program provides a full test of the implementation of the VM’s function calling commands, the bootstrap section, and most of the other VM commands.
-
A full test of the VM implementation’s handling of static variables.
-
-
Jack High-Level Language and Demo
-
Greeting Program
Author: Reion Chan
-
Countdown Timer
Author: Reion Chan
-
Rolling Ball
Author: Reion Chan
-
Square
Author: Nand2Tetris.org
Compiler-Part1
-
Test program
Compiler-Part2
-
Test program
-
Seven Computes the value of (3*2)+1, and prints the result at the top left of the screen. Purpose: handles constans, arithmetic expression, do statement and return statement.
-
Convert To Bin Converts a 16-bit decimal number into its binary representation. Purpose: handles all procedural elements of the Jack language.
-
Square Dance Purpose: Tests how your compiler handles the object-oriented constructs of the Jack language, such as constructors, methods, fields and expressions that include method calls.
-
Average Purpose: handles arrays and strings
-
Pong Purpose: handles objects and static variables
-
Complex Arrays Purpose: handles complex array references and expressions.
-
Operating System
Copyright & License
Copyright 2015-2017 Reion Chan.
You are required to give attribution to the author (Reion Chan) for any
use of this program (GPLv3 Section 7b).
Trying to pass off my code as your own in your Elements of Computing classes
will result in a cursed life of forever buggy software.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Footnotes
-
MIT Press, By
Noam Nisan
andShimon Schocken
↩ -
Multiplexor is a device that selects one of several analog or digital input signals and forwards the selected input into a single line. ↩
-
Demultiplexor take one data input and a number of selection inputs, and they have several outputs. ↩
-
Multiple-Bit
Computer hardware is typically designed to operate on multi-bit arrays called “buses.” For example,a basic requirement of a 32-bit computer is to be able to compute (bit-wise) an And function on two given 32-bit buses. ↩ -
Multiple-Way
accept multiple inputs ↩