REVISED LAB 2 Due January 26, 9PM Multi-base conversion Graded assignment; all work must be strictly your own. Do not show or describe your program to other students. On this assignment, you may discuss programming issues along the lines of "I don't know how procedures work" answered with examples unrelated to this assignment. You can use the text (or talk to myself or a TA) if you do not understand base conversion. The conversion program will input bases and numbers and output them in base 10. Next week, we'll revisit the adding machine. All numbers entered are unsigned. The system will work with bases greater than or equal to 2. a. Numbers will use Commas to separate "digits". A "digit" has several characters, each 0-9, such that their positional representation is less than the base. For example: 0,12,0,59. You will have to read these in character by character (see text), since get reads in one number per line, and we want several on a line. c. The output format is base 10 (use put on .words) <> <>10 <>1,0 <<= 10 (base 10)>> <>2 <>1,0 <<= 2 (base 10)>> <>2 <>1,1,1,0 <<= 14 (base 10)>> <> 60 <>10,12 <<= 612 (base 10)>> <>0 <> Notes: 1. Write your own get character procedure that ignores spaces. All input should be character by character. 2. Write a digit reading routine that will read a complex digit. In reading digits, you will want to read characters and convert to base 10 until you see a ',' or newline. The resulting base 10 number (between 0 and base-1) will then be used to form the user's number (part 3). The digit reading routine will need a special way to indicate that a newline has been detected (ie, there is no trailing ,), perhaps by maintaining the last character read in a place readable by other routines. If it's a comma, there is still more input to the number; if a newline, the number is done. 3. Your number reading routine will call the digit reading routine and do the appropriate multiplies and adds to form an internal representation of the integer typed in. 4. Error messages and prompts are important: what errors can come up? A few are illustrated above. You are encouraged to use different prompts and error messages. 6. The main program will be a loop of enter base commands/enter number commands. If an invalid base is entered, the program will exit. Minimally, you must have separate, well-structured PROCEDURES using LA for: a. Reading the next character ignoring spaces b. Reading a comma/newline delimited "digit" (which calls (a)) c. Reading an unsigned number and converting to internal form according to base (which calls b). HANDIN: convert.spim README a. Name and email address b. Overview of your code c. Thoughts on what you will need to change in your code to work with negative numbers d. Any other comments on SAL and SPIM. Points: 10 points maximum Basic functional program: 7 points Comments: -5 None -1..-2 Poor +1/2 Excellent comments and README User interface: -1 None +1 Excellent prompts and user interface Error messages: +1/2 Some error messages +1 Excellent error messages Extra stuff: +1 Input negative numbers as well Coding: +1/2 Incredible code -1..-3 Confusing control structures, variables, and the like. Procedures -5 No procedures -1..-2 Poorly structured procedures