In this article we will talk about MIPS Instruction Execution model. There are two key concepts for MIPS instruction execution Model: Processor Execution Model. And Program Storage Model. Here we will try to cover both of them.
MIPS Instruction Execution Model: Processor Execution Model
A processor guarantee two things that it will execute instructions in a way which will be sequential and atomic. Here sequential means that it will execute the instruction in order. So if we write a program that says instruction_1 to execute first and instruction_2 to execute second then the processor must have to maintain that order. Also here the atomic means the processor will execute each instruction all at once. For example:
if out program says that r2= r1+r2, then r3= r1+r2. In this case the sequential means processor will not r3=r1+r2, then r2=r1+r2.
here again if our program says r2= r1+r2, then r3= r1+r2. in this case the atomic means that the processor has to finish r2=r1+r2 before starting r3=r1+r2.
But in reality processor does not do either of these two things, because they are slow. So it breaks the rules for doing the execution more efficient way which is called pipelines. We will talk about execution pipelines here.
Program Storage Model
In MIPS program and data both stored in memory. Therefore processor has to fetch instructions from the memory for execution. And it also has to fetch data from the memory for computation. Hence there is no difference between data and instruction memory. Therefore it must be a problem. because lots of virus attacks come this way: Attackers use data to write over the instruction. This allows attackers code execution which we do not expect. This unexpected behavior refers to as buffer overflows.So program storage model is great because it uses one memory for everything but it also has some security issues.
Types of MIPS Instruction
There are three types of MIPS Instructions.
Data Operation instruction: such as addition and subtraction.
Data Transfer Instruction: such as Load (memory to register), and Store (register to memory)
Sequencing such as Branching (Conditional), and Jump (unconditional i. e goto).