[SOLVED] MIPS assembly A. Objective

$25

File Name: MIPS_assembly_A._Objective.zip
File Size: 244.92 KB

5/5 - (1 vote)

A. Objective
AST10201 Computer Organization Additional Assessment Project (30%)
1. Solve real life problem using MIPS assembly language
2. Evaluate the performance of a program in QtSpim
3. Understand how computer organization affects the execution time of computer
programs.
B. Requirements of the MIPS assembly program
Write an MIPS assembly program named as numberConverter_[studentID].s. The requirements for this program are listed below:
Step 1: The program allows user to input any number such as binary number with prefix b, octal number with prefix 0 (noted that it is not o), decimal number without any prefix, hexadecimal with prefix 0x. Assume the input number is a unsigned 32-bit number.
Hints:
1. You may create an enough buffer for the input string. For example: You define a buffer with 33 bytes in .date.
buffer: .space 33
Later on, in .text you can save the input number into buffer you define, using following instructions:
la $a0, buffer
li $a1, 33
li $v0, 8# read String
syscall
2. You may want to know which base of number user input. Using the following instructions, you can read the first character from buffer into $s0:
lb $s0, 0($a0)# first character in buffer
If $s0 is equal to b then you know the input number should be binary, and so on. 3. You may also want to know the length of number user input. Using the following instructions, $a1 would be equal to the digits user inputs excluding the prefix, assuming now $a0 is the address of the first digit (not prefix, you need to modify $a0 first):
length: lb $s0, 0($a1)
beq $s0, 10, endString # 10 is the ascii code of new line addi $a1, $a1, 1
j length
endString:
sub$a1, $a1, $a0
Step 2: Convert the number user entered to another 3 different number systems.
Step 3: In console window, the program will ask user Do you wanna continue (y/n)?. If enter y, Step 1 and Step 2 are repeated. If enter n, it responses End to indicate the end of the program.

Your program result should be the same as the following figure. The underlined number or characters in the following figure are inputted by user.
My solution: I will write a procedure str2int to convert the input string into integer, then print the integer in binary, octal, decimal or hexadecimal. Please refer to my start code numberConverter_template.s. You can choose the start code I provide or start from beginning.
C. Report
Write a report named report_[studentID].docx. The requirements for this report are listed below:
1. Assume now user inputs b10100. Explain how many instructions will be executed in str2int procedure.
2. If your program is run on a pipelined CPU with MIPS architecture, which kind of hazards will happen in your program? Indicate and explain them.
3. Explain which part of your code can be optimized to reduce the execution time of the program. Can you try to make the size of file, numberConverter_[studentID].s, not greater than 5 KB?
D. Submission
Zip numberConverter_[studentID].s and report_[studentID].docx and name the zip file as AdditionalAssessmentProject_[studentID].zip. Submit the zip file on Canvas by due date (14 Dec 2019).

E. Grading Rubrics
Rating Component
Criteria
Max Points
Source code
Number converter is graded according to:
1. judge the base of input number 2. complete procedure str2int 3. print binary number
4. print octal number
5. print decimal number
6. print hexadecimal number
24
Report
1. clear and easy to understand 2. around 500 words
6
End

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] MIPS assembly A. Objective
$25