Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MIPS Logic And Memory In This Assignment, You Will Try Your Hand And Some Raw MIPS Programming. We Will Use The Wemips2 Simulator, Which Means

MIPS Logic And Memory In This Assignment, You Will Try Your Hand And Some Raw MIPS Programming. We Will Use The Wemips2 Simulator, Which Means You Will Not Have Access To The Pseudoinstructions. Also Note That Memory Access Can Only Be Had Through The $Sp Register Owing To Limitations Of The Simulator. For Each Problem, Use The Wemips2 Simulator. Once You

MIPS Logic and Memory

In this assignment, you will try your hand and some raw MIPS programming. We will use the wemips2 simulator, which means you will not have access to the pseudoinstructions. Also note that memory access can only be had through the $sp register owing to limitations of the simulator.

For each problem, use the wemips2 simulator. Once you have a working program, copy and paste it into a text file. (You can use your favorite text editor or even notepad to produce this file.) Be sure to indicate in comments each problem. For instance, one way to layout this file would be:

# Problem 1severallinesofcode# Problem 2severallines ofcode...

I will grade your code by copying and pasting from your text document into wemips2. When you are done, submit your text file on canvas.

Problems

  1. (10 points) Invent a way to perform the greater than operation, and then write a program which counts from zero to ten using the following logic:
1: set counter to 02: add 1 to counter3: if counter > 9, go to 54: go to 2
  1. (10 points) Invent a way to perform the greater than or equal to operation, and then write a program which counts from zero to ten using the following logic:
1: set counter to 02: add 1 to counter3: if counter >= 10, go to 54: go to 25:
  1. (10 points) Invent a way to perform the less than or equal to operation, and then write a program which counts from zero to ten using the following logic:
1: set counter to 02: add 1 to counter3: if counter =>
  1. (35 points) Write a program which computes the first ten Fibonacci numbers and puts them in memory between the stack pointer $sp and the frame pointer $fp. It is ok if you have an extra value. To help you out, here is a python program which will accomplish this task. Where this program prints is where you would put it the value in memory and then increment the stack pointer. It is OK if you need to leave an extra number on the stack, as I did in this week's video.
f0 = 1f1 = 0f2 = 0for count in range(10): print(f0) # print the current number f2 = f1 # shift things around f1 = f0 # f0 = f1 + f2 # calculate the next number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Usability

Authors: Jakob Nielsen, Raluca Budiu

1st Edition

0133122131, 9780133122138

More Books

Students also viewed these Programming questions

Question

x-3+1, x23 Let f(x) = -*+3, * Answered: 1 week ago

Answered: 1 week ago