Skip to content

Computer built from first principles (CPU, Assembler, VM, Compiler and OS).

License

Notifications You must be signed in to change notification settings

DaviNakamuraCardoso/nand2tetris

Repository files navigation

Nand2Tetris: The Elements of Computing Systems

by the Hebrew University of Jerusalem

In this course we take a hands-on approach to build a modern computer from Nand to Tetris, guided by the professors Noam Nisan and Shimon Shocken.

Week 01: Boolean Functions and Gate Logic

In this week we learned the concepts behind modern hardware: Boolean logic. We then built a total of 16 logic gates starting only with a nand gate, and then building more complex ones, like multiplexors and demultiplexors.

Project: Chipset for the Hack Computer

Week 02: Arithmetic Logic Unit (ALU)

In this week we've learned about boolean arithmetic, comparison, half-adders, full-adders. We used those chips to build the heart of every modern CPU - the Arithmetic Logic Unit.

Project 02: ALU

Week 03: Flip-Flops and Memory

In this week we learned about how computers remember information with the use of flip-flops, which then form registers and RAMS.

Project 03: Memory

Week 04: Assembly language

In this week we went up a layer in abstraction and started talking about the Hack Assembly language, a very simple kind of assembly language for a 16 bit platform. The language includes instructions to access a location in memory, load a value to a register, compare two values and jump.

Project 04: Multiplication and I/O in Assembly

Week 05: CPU

This was the last week working on the hardware platform for the Hack Computer. We learned about many computer architectures (Harvard, Von Neumann) and implented our own creating a fully functional machine.

Project 05: CPU

Week 06: Assembler

With our machine completely finished, we took a look at essential programs for modern software: Assemblers and went on to build our own implementation.

Project 06: Assembler

Week 07: Virtual Machines I

In this week we were introduced to the concept of a Virtual Machine (VM) for a high level language. We learned how abstractions like the stack and memory segments work in the assembly level. We then built a VM translator that supports simple instructions, like push, pop, add, sub, gt...

Project 07: VM Translator I

Week 08: Virtual Machines II

We finally complete our Virtual Machine by introducing function calls, labels, goto's and if-goto's.

Project 08: VM Translator II

Week 09: High level language

After completing the virtual machine, we were introduced to a high level, object-oriented language called Jack. It's similar to Java and supports most of the features of any modern programming language. We then were asked to build a program with it, and I chose Tetris (since it's the name of the course).

Project 09: High Level Language

Week 10: Compilers I

In this week we looked at the first steps of compilation: tokenization and lexical analysis, and built a simple parser that produces XML code from Jack source files.

Project 10: Analyzer

Week 11: Compilers II

We finished the Jack Compiler by generating VM code from the Parsing Trees. The result is a compiler for a modern object-oriented language.

Project 11: Jack Compiler

Week 12: Operating Systems

The final week of the course was reserved for the development of our skills in the construction of an Operating System written in Jack, providing memory allocation, arrays, I/O (Keyboard and Screen), mathematical functions (algorithms for multiplication, division and square roots) and Strings (and string-related functions).

Project 12: The JackOS

Week 13: Final

In this week we celebrate the construction of fully functional computer, built from Nand to Tetris.

About

Computer built from first principles (CPU, Assembler, VM, Compiler and OS).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published