Skip to content

a-w-1806/Build-a-Computer-From-Logic-Gates-to-Operating-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build a Computer From Logic Gates to Operating System

This repo consists of 13 different projects and illustrates how to build a modern computer, from logic gates to operating system:

Using HDL (Hardware Description Language), I implement the following chips:

  1. Elementary logic gates
    • Not
    • And
    • Or
    • Xor
    • Mux
    • DMux
  2. 16-bit variants
    • Not16
    • And16
    • Or16
    • Mux16
  3. Multi-way variants
    • Or8Way
    • Mux4Way16
    • Mux8Way16
    • DMux4Way
    • DMux8Way

Using the chips built in Project 1, I continue to build the following chips:

  • Half Adder
  • Full Adder
  • Add16
  • Inc16
  • ALU

Moving from combinational logic to sequential logic, I implement the following hardware:

  • Data Flip-Flops (DFF)
  • Register
  • RAM (8, 64, 512, 4K, 16K)
  • Program Counter (PC)

In this project, I write two assembly programs which can:

  • multiply R0 and R1 and store the result in R2
  • blacken the screen whenever a key is pressed

In this project, I write HDL to:

  1. implement the CPU
  2. implement the Memory (RAM and memory mapping for screen and keyboard)
  3. construct the whole 16-bit Computer called Hack!

I wrote an assembler in Java to translate Hack Assembly Language to runnable machine code on this computer. The standalone repo is here.

I wrote a Virtual Machine Translator in Java to translate a VM Language to Hack Assembly Language. The standalone repo is here.

More comming soon!

I 'd like to thank Prof. Noam Nisan and Prof. Shimon Schocken for this brilliant course: Building a Modern Computer From First Principles. This is one of the best online courses I have ever taken.

About

Building a Modern Computer From First Principles.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published