Skip to content
/ CPU Public

Here I've created a "little" computer architecture with a compiler that can handle any simple task

License

Notifications You must be signed in to change notification settings

RRaphaell/CPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU

Here I've created a "little" computer architecture with a compiler that can handle any simple task

Description

collatz_conjecture.mp4

It's created by Logisim evolution, a simple simulation program that allows you to design a large project with simple elements such as logic gates (AND, NOR...), multiplexers, registers, etc.

Every component, including ALU, CU, CONTROLLER, and etc. is created by hand

Aside from that architecture, I also created an assembly language with specific commands, so that you can write any simple task with it

Take a look at each of the files we have to better understand how these things work

  1. myCPU.circ - Logisim file with all of these architectures and circuits
  2. Instructions.xlsx - In an Excel document, I explained what commands we have and what the options are for operands.
    Most commands consist of three parameters: [operation] [operand1] [operand2]
    You can also see an example of the collatz_conjecture code (which runs in that video above) with descriptions of each line

  1. evenOdd.txt - The program is written here.
    in this case, I wrote code for the collatz_conjecture problem which suggests that repeating two simple arithmetic operations will eventually result in every positive integer becoming 1.
    these operations are
  • If the number is even, divide it by two.
  • If the number is odd, triple it and add one.
    You can find more information in the excel file where I commented on each line of code.

  1. compilator.ipynb - A Python file that converts a code file into an array that will be written in instructions.txt.
  2. instructions.txt - This is the code generated by the compiler that should be added to the ram inside Logisim simulation (you can click edit on RAM and paste this hex code there)

Usage

  1. first of all, you need to write assembly code (using instructions excel file) in a text file
  2. run compiler.py
python compiler.py yourcode.txt outputname.txt
  1. open myCPU.circ and copy generated outputname.txt code into ram
  2. enable clock

About

Here I've created a "little" computer architecture with a compiler that can handle any simple task

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages