Question: MIPS/SPIM programming The problem below emphasizes programming a simple loop, which also requires system calls to simulate input/output, register to register and memory reference instructions.

MIPS/SPIM programming

The problem below emphasizes programming a simple loop, which also requires system calls to simulate input/output, register to register and memory reference instructions.

You are to write a program that does the following:

.The program will take inputs from you via the keyboard using syscall 5. A prompt to request the temperature should say Temperature query with acceptable input range and a condition for program termination.

To terminate the program, input a 1 and the program should print Program terminated and stop.

.The temperatures you will input are in Fahrenheit between 100 F and 400 F. If outside the range, print the message Out of range. Try again and restart the query again.

.The computer program must be able to sense five ranges. Your computer program must convert the input temperature to Centigrade and adjust the process temperature by adjusting the heater voltage.

The computer should print to the console the appropriate feedback response after each input and query for temperature again.

The feedback response is:

If input is =<235 F, the console should show the temperature in Centigrade and the message: Severely under temperature <112C - abort process.

236-285 F, the console should show the temperature in Centigrade and the message: Under temperature <=140C and >112C - increase heat by 5%.

286-316 F, the console should show the temperature in Centigrade and the message: OK >140C and <=157C - maintain heater voltage.

317-336 F, the console should show the temperature in Centigrade and the message: Over temperature >157C and <=168C - decrease heater voltage 5%.

> 336 F, the console should show the temperature in Centigrade and the message: Severely over temperature >168C - abort process.

.In order to slow down the process and let the computer think a while, include a timer that counts down from 0x 25000 or other number to 0 after each input. The countdown cycle should provide a delay of about 1 second before the next query.

A validation input/output checklist follows (xxx means actual temperature input after it is converted to degrees C)

Input (T in Fahrenheit) Output

------------------------------ --------------

Query for temperature with limits and termination condition

<100 or>400 Out of range- Try again.

<=235 xxx degrees C Severely under temperature <=112C - abort proces

316 (286-316) xxx degrees C OK> 140C and <=157C - maintan heater voltage

336 (317-336) xxx degrees C over temperature >157C and <=168C" - decreases heater voltage 5%

>336 xxx degrees C severely over temperature >168C- abort process

1 Program terminated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!