Coder Social home page Coder Social logo

lumexralph / f-hack Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 692 KB

Implementation of a modern 16-bit von Neumann machine designed to execute programs written in the Hack machine language from studying "The Elements of Computing Systems"

License: MIT License

Scilab 21.06% Assembly 59.29% Hack 0.14% HTML 10.28% Batchfile 0.87% Shell 1.17% Rust 7.19%
chips logic-gates assembly cpu ram register

f-hack's Introduction

F-Hack

In the quest to go deeper in the stack(low-level) and do a bottom-up approach, this project contains my implementation of building a 16-bit modern computer systems called F-Hack (Fun Hacking) using Logic Gates / Chips which is what the modern computer architecture is made of.

In the process of studying this amazing book The Element of Computing Systems

Implementation

I will be using a specification, Hardware Description Language (HDL) to build my hardware computers using different logic gates combination.

First Stage (Elementary Chips)

Create the following Chips:

  • Not (Inverter): This gate outputs the opposite value of it's input, something like !true == false in a programming language. done

  • And: returns 1 when both its inputs are 1, and 0 if they are not. done

  • Or: returns 1 when at least one of its input is 1, and 0 otherwise done

  • Xor (Exclusive Or): returns 1 when exactly one of its inputs is 1, and 0 otherwise done

  • Multiplexer: it is a three-input gate, it uses sel bit to select and output either of the 2 supplied inputs. done

  • Demultiplexer: It is the opposite of Multiplexer, it takes a single inout value and routes it to one of two possible outputs according to a selection bit that selects the destination output. done

  • 16-bit Not (Not16) done

  • 16-bit And (And16) done

  • 16-bit Or (Or16) done

  • 16-bit Multiplexer (Mux16) done

  • Multi-way Or (Or8Way) done

  • Multi-way Multiplexer (Mux4Way16, Mux8Way16) done

  • Mult-way Demultiplexer (DMux4Way, DMux8Way) done

Implementation: Elementary Chips

Second Stage (Adders, Incrementer and Arithemtic Logic Unit (ALU))

  • Half-adder: designed to add two bits. done

  • Full-adder: designed to add three bits. done

  • Adder: designed to add two n-bit numbers, in our case, our computer word size is a 16-bit size. done

  • Incrementer: A chip that adds 1 to a given number, this chip will be pivotal in enabling us to fetch the next instruction in memory after executing the currebt one. done

  • ALU: This chip will be the computational center-piece of our CPU. done

Implementation: Combinational Chips

Third Stage (Memory Chips - Registers, RAM, Counter)

  • Registers: (single-bit register (Bit), 16-bit register (Register)). done

  • RAM: it is an aggregate of n Register chips, by specifying a particular aadress (a number between 0 to n - 1), each register in the RAM can be selected and made available for read or write operations RAM(8, 64, 512, 4K, 16K) done

  • Program Counter: is a chip that knows how to increment its value by 1 each time unit. done

Implementation: Memory Chips

Fourth Stage (CPU, ROM32K, Data Memory, Computer Chips)

  • CPU Chip:

  • ROM32K: The instruction memory of the computer, where the instruction being executed is stored.

  • Memory Chip (RAM16K + Screen + Keyboard Chips) done

  • Computer Chip:

f-hack's People

Contributors

lumexralph avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.