You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Mini MIPS processor is developed as part of the CS220 (Introduction to Computer Organisation) curriculum at IIT Kanpur under the guidance of Prof. Debapriya Basu Roy, Assistant Professor in CSE Dept. at IIT Kanpur. This document provides comprehensive coverage of instruction formats, opcodes, function codes, and control signals required for implementing a complete MIPS-like processor.
Objectives
Complete ISA Specification: Define all supported instruction types with precise encoding
Instruction Format Reference: Provide clear documentation of R-type, I-type, J-type, and F-type formats
Control Signal Mapping: Detailed control unit design specifications
Register Architecture: Complete register file organization and naming conventions
ALU Operations: Comprehensive ALU control and operation codes
Assembly Programming: Enable efficient assembly language programming and machine code generation
Features
70+ Instructions: Complete instruction set covering arithmetic, logical, memory, branch, and floating-point operations
# Add two registersadd$t0,$t1,$t2 #$t0 =$t1 +$t2# Add immediate valueaddi$t0,$t1,100 #$t0 =$t1 +100# Multiply two valuesmul$t0,$t1,$t2 # HI, LO =$t1 *$t2
Memory Operations
# Load word from memorylw$t0,0($t1) #$t0 = Memory[$t1 +0]# Store word to memorysw$t0,4($t1) # Memory[$t1 +4] =$t0# Load upper immediatelui$t0,0x1000 #$t0 = 0x1000 << 16
Control Flow
# Conditional branchbeq$t0,$t1, label # if ($t0 ==$t1) goto label# Unconditional jumpj target_address # goto target_address# Jump and linkjal function_start #$ra = PC +4; goto function_start
Floating-Point Operations
# Add single-precision floatsadd.s$f0,$f1,$f2 #$f0 =$f1 +$f2# Compare floatsc.eq.s$f0,$f1 # cc = ($f0 ==$f1)# Move based on conditionmov.s$f0,$f1 # if (cc)$f0 =$f1
Performance Considerations
Instruction Timing
R-Type: 1 cycle (single-cycle implementation)
I-Type: 1 cycle (load/store may require additional memory access time)
J-Type: 1 cycle
F-Type: 1-4 cycles (depending on floating-point complexity)
Memory Organization
Word-aligned: All addresses must be multiples of 4
Big-endian: Most significant byte at lowest address
Separate spaces: Instruction and data memory are separate
# Test branch operations.texttest_branch: addi$t0,$zero,10 addi$t1,$zero,5 beq$t0,$t1, equal # Should not branch bgt$t0,$t1, greater # Should branchequal: # This should not executegreater: # This should execute