8000 GitHub - r8025n/nand2tetris: Personal solutions to the Nand2Tetris course projects — building a computer from first principles, starting with logic gates up to a full OS and compiler.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Personal solutions to the Nand2Tetris course projects — building a computer from first principles, starting with logic gates up to a full OS and compiler.

Notifications You must be signed in to change notification settings

r8025n/nand2tetris

Repository files navigation

Nand to Tetris

This repo contains my own implementation of project based two part online course Nand to Tetris. The purpose of this course is to get familiar with basic computer architecture and working process of overlying system level softwares like compiler and OS in a comparatively easier project based approach.

First Part:

In the first part it is mostly digital logic design. By designing elementary logic gates using course specific hardware definition language,had to make intermediate digital circuits and counter,adder, mux demux, ram etc. and finally a simpler arithmatic logic unit which is capable of add, subtraction,reset, select etc. operation on 16 bit integer values only. As the final project it was required to build an assembler for the course specific assembly language. This course gives a good understandin of basic computer architecture.

First Part Course Link: From Nand to Tetris - Part I

Second Part:

Second part of this course has two parts, building a simple two tier compiler for course specific HACK programming language and building an very basic operating system. The compiler is a bit simpler version of other real world compilers for languages like JAVA or C#. This compiler uses an stack based virtual machine like JVM. To make this compiler, it was required to build a translator which translates the intermediate virtual machine language to course specific assembly language. And second part of the compiler requirement was to make a translator that translates course specific JACK programming language to intermediate virtual machine language. This two part completes the compiler. This course gives a good understanding of how basic compiler and operating system works. It also gives a basic understanding of virtual machine's stack based language how they works.

Second Part Course Link: From Nand to Tetris - Part II

Project Summary:

Week 1:

  Implemented elementary logic gates in HDL along with Multiplexer and Demultiplexer.

Week 2:

  Implemented a HalfAdder, a FullAdder and the ALU.

Week 3:

  Implemented sequential logic circuitry using D Flip-Flops. Built Registers, a Counter and RAM chips.

Week 4:

  Written a few programs in the HACK assembly language.

Week 5:

  Implemented the CPU and the complete Memory chip. Assembled the complete HACK computer architecture together. The HACK computer is now able to execute instructions written in the HACK assembly language.

Week 6- Assembler (written in C):

  Developed an assembler to convert project specific HACK assembly language to binary.

Week 7- VMTranslator (written in JAVA):

  Developed a translator to translate stack based virtual machine language to assembly language.

Week 8- ShooterJack (written in JACK):

  Developed very simple shooting game where a gun shoots a moving object written in course specific object oriented programming language JACK. Its purpose was to get familiar with JACK proogramming language.

Week 9- Syntax Analyzer (Written in JAVA):

  Developed a syntax analyzer which tokenize all the meaningful JACK programming syntax form any code written in JACK, and assign them to their specific types which are variables, datatype, integer, string, operator, array, expression, term etc. This is done as the first part of compilation process.

Week 10- Compiler (written in JAVA):

  Developed the full functional JACK language compiler based on the Syantax Analyzer that was built as the previous project. This compiler can now tokenize any JACK program and compile them into the Virtual Machine specific VM language.

About

Personal solutions to the Nand2Tetris course projects — building a computer from first principles, starting with logic gates up to a full OS and compiler.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0