The project in Spim

Islamic University of Gaza
Faculty of Engineering
Computer Department
Computer Architecture ECOM 3310
Project (1)
Name: Eman Habib
ID: 220080811
Name: Eman El_Shayyah
ID: 220082031
Instructor: Dr. Wesam Ashour
T.A: Eng. Doaa KH. Abu Jabal
Description about the project:In this project firstly we design a Java program that can
calculate the difference between two strings. By using two
methods
to
calculate
the
difference
between
computer
&
computing. One of the method compute the number of different
characters in the two strings. And the second Compute the
difference between the two strings in length. Then we sum the
different characters between two strings and the difference in
length
between
the
two
strings
and
that
represents
the
difference between two strings.
After that converting it to MIPS instruction. We use three
procedures to calculate the difference between two strings and
stored the two strings in array1 and array2. putting the size of
two
arrays
in
$a0,$a1
followed
by
calling
compLength
procedure to compare the two lengths which return the smaller
length in $v0 and the other in $v1 and put $v0 in $a2 and
$v1 in $a3. After that putting the address of arrays in $a0,$a1
to call diffChar which compute the number of different
characters in the two arrays and we use the $s0 registers for
count, $s1 for loop and return the count in $v0 then print it.
Then we call diffLength which Compute the difference between
the two strings in length and return the difference in $v0 then
print it. Finally sum the different characters between two
strings and the difference in length between the two strings
which represents the difference between two strings. Then print
it.
2
Part 1:Code Java:
Output Java:
3
Part 2:Code MIPS:
4
5
The project in Spim:
6
The Spim output:
Comment:
We use the MIPS instruction to design a program that
compute the difference in two strings, we found it
simple and easy and this project made us familiar
with MIPS and Spim.
7