Git Product home page Git Product logo

cse141l_project's Introduction

Instruction Format R-type Instructions:

Format: opcode (4 bits) | rs (2 bits) | rt (3 bits) Supported Operations: load, store, add, mv, xor, parity, or, sub, lsr, rsr

I-type Instructions:

Format: opcode (4 bits) | rs (2 bits) | immediate (3 bits) Supported Operations: lshift, rshift, loadi

Branch Instructions:

Format: opcode (4 bits) | branch target index (5 bits) Supported Operations: bne

Special Instructions:

halt: opcode (4 bits) | unused (5 bits) Description: Stops the execution of the program.

Opcode Encoding load: 0000 store: 0001 xor: 0010 bne: 0011 add: 0100 mv: 0101 lshift: 0110 rshift: 0111 loadi: 1000 parity: 1001 halt: 1010 or: 1011 sub: 1100 lsr: 1101 rsr: 1110

Notes: There are a maximum of 32 branch targets R type instructions write to r0, except for parity and mv, which write to rt Labels are described by name: Comments start with #

Hardware: We went with a standard MIPS machine with a 32 entry tall absolute jump table. We assemble the jump table and place it into the first 32 lines of the instruction ROM. On the hardware side, we read that data into the PC lookup module.

We halt the program with a special halt instruction. Since we had no other syscalls, we decided to leave the registers unused for the halt instr.

Software Approach: Since rs and rt take a different number of registers, we shield against that (and other errors like out-of-range immediates) at the assembler level. We also decided to leave a couple of unused instructions in case we overlooked anything, which came in helpful when writing the assembly (sub, or, halt, lsr, and rsr got added afterwards).

cse141l_project's People

Contributors

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