AST10201 Computer
Organization Group Project (10%)
A. Objective
Solve real life problem using MIPS assembly language
Copyright By PowCoder代写 加微信 powcoder
Evaluate the performance of a program in MIPS MAR
Understand how computer organization affects the execution time of computer
B. Requirements of the MIPS assembly program
Write an MIPS assembly program named “numberConverter_ (groupNumber].s”. The
programme is to convert a number from any base (between 2 and 16) to binary, octal,
decimal and hexadecimal number. The requirements for this program are listed below:
Step 1: Get base (integer) from console and number (input string).
1. You may create an enough buffer for the input string. For example:
You define a buffer with 32 bytes in .date.
buffer: .space 32
Later on, in .text you can save the input number into buffer you define, using
following instructions:
$a0, buffer
read String
2. You may also want to know the length of string user input. Using the following
instructions, assume $al=$a0 is the address of the first digit:
$s0, 0 ($al)
$s0, 10, endString # 10 is the asciicode of new line
endstring:
$al, $al, $a0
Step 2: Convert the string entered by user to decimal number (integer).
If any digit is not less than the base, then print the following string “Each digit should
be between 0 and base-1” on the console window and user will enter a new number
Step 3: Convert the number to 4 different number systems: binary, octal, decimal and
hexadecimal.
Step 4: In console window, the program will ask user “Do you wanna continue (y/n)?”. If
enter “y”, Step 1 to Step 3 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.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com