Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
63 views2 pages

Experiment 5: Simple Programs Using QTSPIM: Team Details: Terminal No: SL No Name Id No 1 2 3

This document describes three exercises in an experiment on simple MIPS assembly programs using QTSPIM. The first asks students to write a program to calculate the greatest common divisor (GCD) of two numbers stored in memory. The second asks students to write a program to generate a Fibonacci series of N numbers and store them in memory. The third asks students to try additional MIPS instructions discussed in class and list which ones were tried.

Uploaded by

Shreenath Vyas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

Experiment 5: Simple Programs Using QTSPIM: Team Details: Terminal No: SL No Name Id No 1 2 3

This document describes three exercises in an experiment on simple MIPS assembly programs using QTSPIM. The first asks students to write a program to calculate the greatest common divisor (GCD) of two numbers stored in memory. The second asks students to write a program to generate a Fibonacci series of N numbers and store them in memory. The third asks students to try additional MIPS instructions discussed in class and list which ones were tried.

Uploaded by

Shreenath Vyas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Experiment 5: Simple Programs using QTSPIM

Team Details:
Terminal No: Click here to enter text.
Sl No Name ID No
1 Click here to enter text. Click here to enter text.
2 Click here to enter text. Click here to enter text.
3 Click here to enter text. Click here to enter text.

Exercise 5.1: Write MIPS assembly program to calculate the GCD of two numbers stored in data
segment. Store the result back to data segment (use successive subtraction based Euclidean
Algorithm).

Q5.1. Copy your image of assembly code for above exercise here.

Answer:

Q5.2. Copy the image of data segment before execution and after execution. Copy the same in
your observation book.

Answer:

Exercise 5.2: Write MIPS assembly code for generating N numbers of Fibonacci series in data
segment. Assume that the value of N is stored in data segment. (Choose N value to be greater than
or equal to 10d)

For example: .data


N: .word 0x0a
fibseries: .word 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0

Q5.3. Copy image of your assembly code for above exercise here.

Answer:

Q5.4. Copy the image of data segment before execution and after execution for this program.
Copy the inputs and outputs of this program in your observation book.

Answer:

Exercise 5.3: Try out all the new instructions discussed in class.

Page 1
Q5.5. List the instructions that you have tried out (apart from lw, sw, add, addi, sub, beq, bne)
Also list the concepts you learnt from this experiment.(Conlcusion/observations)

Answer:

Page 2

You might also like