Giter Club home page Giter Club logo

mips-cpu's Introduction

MIPS-CPU

This repository contains VHDL code for simulating a MIPS processor. Most of the functions I wrote myself but the template with a little modelsim instruction was given to me by the Computer Orginaztion Lab at Delft University of Technology. As hobby project I included more instructions.

Implemented Instructions

  • 000000 -- add, addu, and, nor, or, sll, srl, sub, subu, xor, jr, slt
  • 000001 -- bgez, bltz, bgezal
  • 000010 -- j
  • 000100 -- beq
  • 000101 -- bne
  • 000110 -- blez
  • 000111 -- bgtz
  • 001000 -- addi
  • 001001 -- addiu
  • 001100 -- andi
  • 001101 -- ori
  • 001110 -- xori
  • 001111 -- lui
  • 100011 -- lw
  • 101011 -- sw

Simple Example

addi:

    ram (  0) <= "00000101"; -- addi $1,$0,5
    ram (  1) <= "00000000";
    ram (  2) <= "00000001";
    ram (  3) <= "00100000";

addi

Full Example

Program stored in memory.vhdl with manually created assembly code. I think there are linux tools available to create a vhdl memory file from a assembly language, unfortunately the one I used was propriatery. See for example test.s and test.vhdl. You can simply rename the file to memory.vhdl and run it within my toplevel VHDL files.

  • addi $1,$0,5
  • addi $2,$0,10
  • slt $3,$1,$2
  • slt $4,$2,$1
  • j B
  • bgezal $3,C
  • addi $5,$0,0
  • addi $7,$0,-1
  • bgezal $7,D
  • j Z
  • addi $6,$0,1
  • j Z

mips-program

mips-cpu's People

Watchers

 avatar  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.