Types of instruction
•R-formatinstructions are used for arithmetic and logical operations that involve only registers,
•I-format instructions are used for operations that involve an immediate value or a memory address,
•J-format instructions are used for jump operations that involve a target address.
3.
Need for Itype instruction
THIS IS BECAUSE A 5-BIT FIELD CAN ONLY REPRESENT VALUES FROM 0 TO 31.TO OVERCOME
THIS LIMITATION, THE MIPS DESIGNERS CHOSE TO USE THE I-FORMAT FOR THE `LW`
INSTRUCTION. THE I-FORMAT HAS A 16-BIT FIELD FOR THE IMMEDIATE VALUE, WHICH ALLOWS
FOR A MUCH LARGER RANGE OF CONSTANTS. HOWEVER, THIS MEANS THAT THE `LW`
INSTRUCTION CANNOT USE THE R-FORMAT, EVEN THOUGH IT IS AN ARITHMETIC OPERATION
INSTRUCTIONS HAVE A 16-BIT IMMEDIATE FIELD THAT CAN CODE AN IMMEDIATE OPERAND
OR A BRANCH TARGET OFFSET. THE IMMEDIATE FIELD OF I-TYPE INSTRUCTIONS IS A SIGNED
16-BIT VALUE IN TWO'S COMPLEMENT.
4.
Jump instruction
instructionin MIPS assembly language stands for "Jump Register". It causes
the program counter (PC) to jump to the contents of the register specified,
in this case, `$t0` This means that the next instruction to be executed will be
the one at the address stored
MIPS soft ware follows the following convention for procedure calling in
allocating
its 32 registers:
▪ $a0–$a3: four argument registers in which to pass parameters
▪ $v0–$v1: two value registers in which to return values
▪ $ra: one return address register to return to the point of origin
R type instruction
We use the rs and rt bits to calculate and then we load into the rd. The alu
result we want to have it in the memory so we will skip the result
9.
lw instruction
Weload the rt bits in order to load the value for the memory as it is an I type
instruction
Clock cycle requirements
Readis done combinationally.When writing the the value you put that into Rd
Wd will cause you to use 1 clock cycle Reading no clock cycle