程序代写代做代考 mips assembly A. Objective

A. Objective
AST10201 Computer Organization Individual 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” (note: 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 (Assume $a0 is the starting address of buffer):
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 entered by user 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: 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 write the whole program by yourself.
C. Report
Write a report named “report_[studentID].docx”. The requirements for this report are listed below:
• The cover page should contain your name, student ID, course code and course name.
• In the first section of report, answer following questions:
1) Assume now user inputs b101110. Explain how many instructions will be executed in “str2int” procedure.
2) Check the memory addresses of the first instruction and the last instruction of your program. How many locations does your program occupy in RAM?
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?
• In the second section of report, share your experience on this project, such as: the most difficult part of project, how you find solution to do the project, how much time you

spend on this project, what you have learnt through this project, any sense of
accomplishment you feel after finishing the project.
• In the third section of report, copy and paste source code of your MIPS program for this
project.
D. Submission (due date: 15 December 11:55 pm)
• Report: projectReport_[studentID].docx
• Source code: numberConverter_[studentID].s
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 1000 words
6
– End –