Computer Architecture

ELTN 493

Lab 3

05-07-2001

 

Chris Annis

 

Analysis and Discussion


This lab consisted of designing a MIPS program that would ask the user to input a number (N), sum all the odd integers from 0 to N, and output the result.  The MIPS program SUMIT.asm was used as a starting point because it sums all the integers, odd and even, from 0 to N.  Only a few changes were needed to complete this task.  The program and the captured output are linked below.

This assembly language was similar in many ways to the Intel assembly language learned in a previous class.  The programs have similar commands to perform the operation of multiplication and division.  The one thing that is not similar, is that in the MIPS architecture you do not have to declare the size of a stack register, or the size of the data segment registers.  The register that the answer to a function will be placed in is given in the command line(i.e. add $t1,$t1,$t0).  The size of the variable does not need to be declared either.  In the MIPS architecture, all variables are the same size no matter if it is a byte, word, double word, etc.  This makes it easier on the user when it comes to writing the program.  This way the programmer is not worried about declaring the variable size and can concentrate more on the actual programming.

Along with differences, the Intel and MIPS architecture do have their similarities.  There are probably more similarities than differences, such as they both can have comments on their command lines, they both can perform loops, the main body of the program has to be declared, and the data portion of the program must also be declared.  There are many other similarities and differences, but these are the ones that I have noticed after writing in both languages.  Below are the links to provide a look at examples of the two different types of architectures.

 

Links


Example of an Intel architecture program from Digital Systems III:
Intel Architecture

A MIPS Architecture program written for this lab:

MIPS Architecture

This is the output file for the MIPS program above:

MIPS Architecture Output

Conclusion


In conclusion, this was a very good and very helpful lab in making the MIPS programming architecture more understandable.  MIPS is a more simple architecture than that of the Intel architecture and more “user friendly”.  A person can learn this programming language a lot faster than the Intel language would take to learn.  This would be the architecture of choice when it comes to programming.

There was only one problem encountered during the lab.  I had trouble using SPIM to capture the output but received help and got it resolved.  Overall, this was a very informative lab in seeing the differences and similarities between two types of architectures, and writing a MIPS program.