Question

i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum SYou entered the Roman numerals: CXCIX The binary representation is: Ob11000111 -program is finished running- You entered theYou entered the Roman numerals: DCXXIV The binary representation is: Ob1110000 - program is finished running For full credit,of the steps that were previously described. ext, break each step into its own block diagram. Use https://www.draw.io or a siREADME.txt This file must be a plain text (.txt) file. It should contain your first and last name (as it appears on Canvas) aNote It is important that you do not hard-code the values for any of the addresses in your program. Other Requirements Turn OMIPS Mamory Configuration Oxffffffff memory map limit address oxffffffff kernel space high address Oxfff fe0e0 MMIO base addrGrading Rubric point values to be determined Part A seudocode block diagram program arguments Part B pseudocode quality block

Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how data is represented, stored, and manipulated at the processor level. In addition to strengthening your understanding of MIPS coding, you will use program arguments to read a string input and learn how to convert Roman numerals into binary and how to print digits as ASCII characters Lab Preparation 1. Read sections 6.4, 9.2 - 9.3 fram Introduction To MIPS Assembly Language 2. Learn how to interpret Roman numerals here Specification You will write a program in the MIPS32 language using the MARS integrated devel opment environment to convert a Roman numeral input into an integer. You will then print the integer as a binary ASCII string Input You will be using program arguments instead of a syscall to take user inputs. See this document on how to use progr am arguments. Samp le Outputs Valid Inputs You entered the Roman numerals: XXVI The binary representation is: Ob1101O - program is finished running Lab 4 Page 1 of 8 Spring 2019 0 2019, c mputer Engineering Department, University of California - Santa Cruz
You entered the Roman numerals: CXCIX The binary representation is: Ob11000111 -program is finished running- You entered the Roman numerals: The binary representation is: Ob110000100 program is finished running- Non Valid Inputs You entered the Roman numerals: CIC Error Invalid program argrument -program is finished running -- You entered the Roman numerals: IIIV Error Invalid program argrument -program is finished running- You entered the Roman numerals: V111 rrorInvalid program argument - program is finished running Extra Credit In this example, the input is non-minimal, so it is counted as a non valid input. You entered the Roman numerals: Erro: Invalid progr am argument program is finished running- Lab 4 Page 2 of 8 Spring 2019 0 2019, c㎝puter Engineering Department, University of California - Santa Cruz
You entered the Roman numerals: DCXXIV The binary representation is: Ob1110000 - program is finished running For full credit, the output should match this format exactly. Take note of the: 1. Exact wording of the statements. 2. Program argument printed on a new line 3. Blank line under the program argument 4. Binary value printed on a new line 5. Blank line under the final result or invalid program argument error. Functionality The functionality of your program will be as follows: 1. Read a Raman numeral input from the program arguments Valid ASCII characters are I, V, X, L, and C Assume program argument input will have a max of 20 characters 2. Print the user's input 3. Convert the Raman numeral input to an integer and store in $se Your program should parse through the ASCII string and campare adjacent characters to decide if you must add or subtract or if the input is invalid Basic conversion algorithm: i. Iterate over each character of the string 1. Campare value of the current character to the value of the next character a. If current value is greater or equal, add value to running sum b. Else, subtract value from running total 4. Print an ERROR message if: The user entered invalid ASCII characters An invalid Roman numeral string has been entered 5. Exit the program cleanly using syscall 18. 6. Extra credit options Include D as a valid input fram the user Print error message for non-minimal Raman numeral input Part A: Block Diagram, Pseudocode, and Program Arguments In part A, you must create a block diagram and pseudocode to aid in the devel opment of your MIPS assembly program. In addition, you must generate code to print the program argument to the console Block Diagram Before coding, create a top level block diagram or flowchart to show how the different portions of your program will work together. Start by creating a flow chart Lab 4 Page 3 of 8 Spring 2019 0 2019, c mputer Engineering Department, University of California - Santa Cruz
of the steps that were previously described. ext, break each step into its own block diagram. Use https://www.draw.io or a similar drafting program to create this document. This diagram will be contained in the file Diagram.pdf. This diagram must be computer generated to receive full credit. Pseudocode lext, you will create pseudocode that outlines your program. Your pseudocode will appear underneath the header_conment in Lab4. asm. Guidelines on developing pseudocode You may modify your pseudocode as you develop your program. Your pseudocode must also be present in your final submission (part B). Program Arguments Your code must read and print the program argument to the screen. For example: Input Text Segment Program Arguments: XXVM You entered the Roman numerals: XXVI - program is finished running - Part B: Assembly Code Implement the functionality of the program previously listed Automation lote that part of our grading script is autamated, so it is imperative that your program's output matches the specification exactly. output that deviates from the spec will cause point deduction Your code should end cleanly without error. Make sure to use the exit syscall (syscall 1 Files Diagram.pdf This file will contain a block diagram or flowchart of how the different camponent:s of your code work together. Lab4.asm This file contains your pseudocode and assembly code. Follow the code documentation guidelines here Lab 4 Page 4 of 8 Spring 2019 0 2019, c mputer Engineering Department, University of California - Santa Cruz
README.txt This file must be a plain text (.txt) file. It should contain your first and last name (as it appears on Canvas) and your CruzID. Your answers to the questions should total at least 150 words. Your README should adhere to the following template: Lab 4: Roman Numeral Conversion CMPE 012 Spring 2019 Last Name, First Name CruzID Can you validly represent the decimal value 1098 vith Roman numerals using only 1, V, X, and C? rite the ansver here What vas your approach for recognizing an invalid program argument? rite the ansver here What did you learn in this lab? rite the ansver here Did you encounter any issues? Vere there parts of this lab you found enjoyable? rite the ansver here. How vould you redesign this lab to make it better? rite the ansver here That resources did you use to complete this lab? rite the ansver here. Did you vork vith anyone on the labs? Describe the level of collaboration Write the ansver here. Syscalls When printing the integer values, you may use syscall system services 4 (print string) and 11 (print character). You may_not use the following syscalls: 1 (print integer) 5 (read integer) 12 (read character) 34 (print integer as hexadecimal) 35 (print integer as binary) 36 (print integer as unsign You will lose a significant number of points if you use any of these syscalls. See the rubric for more details Make sure to exit your program cleanly using syscall 10 Lab 4 Page 5 of 8 Spring 2019 0 2019, c mputer Engineering Department, University of California - Santa Cruz
Note It is important that you do not hard-code the values for any of the addresses in your program. Other Requirements Turn Off Delayed Branching Fram the settings menu, make sure Delayed branching is Show Labels Window (symbol table) Program arguments provided to MIPS program Popup dialog for input syscalls (5,6,7,8,12) Addresses displayed in hexadecimal Values displayed in hexadecimal Assemble file upon opening Assemble all files in directory Assembler warnings are considered errors Initialize Program Counter to global 'main' if defined Permit extended (pseudo) instructions and formats Delayed branching Self-modifying code Editor... Highlighting... Exception Handler. Memory Configuration... Checking this option will insert a "delay slot" which makes the next instruction after a branch execute, no matter the outcame of the branch. To avoid having your program behave in unpredictable ways, make sure Delayed branching is turned off. In addition, add a IlOP instruction after each branch instruction. The OP instruction guarantees that your program will function properly even if you forgot to turn off delayed branching. For example: LOOP: NOP ADDI $to $to 1 # nop added after the branch instruction NOP MIPS Memory Configuration To find the program arguments more easily in memory, you may choose to develop your program using a compact memory configuration (Settings - Memory Configuration) However, your program MUST function properly using the Default memory configuration. You should not run into issues as long as you do not hard-code any memory addresses in your program. Make sure to test your program thoroughly using the Default memory configuration Lab 4 Page 6 of 8 Spring 2019 0 2019, c㎝puter Engineering Department, University of California - Santa Cruz
MIPS Mamory Configuration Oxffffffff memory map limit address oxffffffff kernel space high address Oxfff fe0e0 MMIO base address exfffeffff kemel data segment I 0x98020080 kdata base address Ox8ffffffe kemel text limit address 0x88000180 exception handler address 0x880800e9 kemel space base address 0x88000000 ktext base address Default 0x71ffffff user space high address Compact, Data at Address o Compact, Text at Address 0 ox7tttfc stack base address 0x711fftft data segment limit address 0x7fffeffe stack pointer Ssp 0x18840080 stack limit address 0x 18048000 heap base address 0x1001800 data base address 0x10048800 glabal pointer Sgp 0x18628880 data segment base address 0x10040009 Jextern base address Oxefrfrffe text limit address 0x0848000 text base address Apply and Close Apply Cancel Reset Submission Instructions This assignment will be submitted in two parts. Late hours will not be used for Part A of the assignment. If you do not submit a diagram or pseudocode by the Part A deadline, you can submit it with your Part B submission for less points Lab 4 Page 7 of 8 Spring 2019 0 2019, c mputer Engineering Department, University of California - Santa Cruz
Grading Rubric point values to be determined Part A seudocode block diagram program arguments Part B pseudocode quality block diagram quality assembles without errors correct value in $se stat ements match specification invalid input detection test cases extra credit -50% if program only runs in a specific memory configuration or memory addresses are hard coded -25% incorrect naming convention No credit if you use a forbidden syscal1 (1, 5, 12, 34, 35, 36) 6 pt style and documentation 1 pt camment on register usage 1 pt useful and sufficient comments 1 pt labels, instructions, operands, conments lined up in columns 2 pt readme file complete (should total at least 150 words) 1 pt camplete headers for code and README Mote: program header must include name, CruzID, date, lab name, course name, quarter, school, program description, note on program argument usage README must include name, CruzID, lab name, course name Lab 4 Page 8 of 8 Spring 2019 0 2019, c㎝puter Engineering Department, University of California - Santa Cruz
0 0
Add a comment Improve this question Transcribed image text
Answer #1

.data

# This data will serve as our map between the roman

# and the decimal numbers. Here, each list will

# serve as our makeshift "array", where the conversion

# from decimal to roman will be according to each indice,

# i.e. decimalNumeral[i] will dictate romanNumeral[i].

# This also will be useful when converting roman to

# decimal, as romanNumeral[i] will dictate decimalNumeral[i]

decimalNumeral: .word 1000 100 50 10 5 1 # the decimal map

romanNumeral: .asciiz "MDCLXVI" # the roman map

# Request the user for a roman numeral.

req: .asciiz "Roman Numeral: "

# The error message that will be displayed if the

# format is invalid or contains a token that is not

# a valid roman/decimal numeral.

err: .asciiz "Input contains invalid tokens or format"

.text

.globl main

main:

jal conversion

conversion:

Add a comment
Know the answer?
Add Answer to:
i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to...

    Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to Programming Challenge 1 of Chapter 3 of your text, page 184 (187 in Edition 5). Given one of the Roman numerals I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV as an input your program must determine and display the corresponding decimal digit 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15....

  • Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers...

    Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...

  • I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7:...

    I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7: Customer Accounts Write a program that uses a structure to store the following data about a customer account:      Customer name      Customer address      City      State      ZIP code      Telephone      Account balance      Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the...

  • I really need help with this python programming assignment Program Requirements For part 2, i need...

    I really need help with this python programming assignment Program Requirements For part 2, i need the following functions • get floats(): It take a single integer argument and returns a list of floats. where it was something like this def get_floats(n):   lst = []   for i in range(1,n+1):     val = float(input('Enter float '+str(i)+': '))     lst.append(val)   return lst • summer(): This non-void function takes a single list argument, and returns the sum of the list. However, it does not use...

  • Need C programming help. I've started to work on the program, however I struggle when using...

    Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...

  • I need help making this work correctly. I'm trying to do an array but it is...

    I need help making this work correctly. I'm trying to do an array but it is drawing from a safeInput class that I am supposed to use from a previous lab. The safeInput class is located at the bottom of this question I'm stuck and it is not printing the output correctly. The three parts I think I am having most trouble with are in Bold below. Thanks in advance. Here are the parameters: Create a netbeans project called ArrayStuff...

  • Need three seperate files. ShoppingCartManager.java ShoppingCart.java ItemsToPurchase.java These are from part 1 what do you mean...

    Need three seperate files. ShoppingCartManager.java ShoppingCart.java ItemsToPurchase.java These are from part 1 what do you mean by deep study 7.25 LAB*: Program: Online shopping cart (Part 2) Note: Creating multiple Scanner objects for the same input stream yields unexpected behavior. Thus, good practice is to use a single Scanner object for reading input from System.in. That Scanner object can be passed as an argument to any methods that read input This program extends the earlier Online shopping cart program (Consider...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT