Question: Q1. Write a MIPS program that prompts the user for a hexadecimal digit and then displays the decimal equivalent multiplied by 2. For example, the

 Q1. Write a MIPS program that prompts the user for a

Q1. Write a MIPS program that prompts the user for a hexadecimal digit and then displays the decimal equivalent multiplied by 2. For example, the program displays 10 for hex '5', 20 for 'A', etc. If the user enters an invalid value, the program should display an error message and asks the user to try again Hints: (14 marks) Valid characters can either be from 'O' to '9' or from 'A'to 'F' (uppercase only). what is the hexadecimal value for ASCII '0' and A'? Shifting left by one bit doubles the value (if the new value fits in current register) Hex digit X2 in decimal is 18 program is finished running (dropped off bottom) Hex digit X2 in decimal i3 26 program is finished running (dropped off bottom)- Unrecognized hex digit. Try again: R Unrecognized hex digit. Try again: r Unrecognized hex digit. Try again: d Unrecognized hex digit. Try again: D Hex digit X2 in decimal is 26 - program is finished running (dropped off bottom) -- Q1. Write a MIPS program that prompts the user for a hexadecimal digit and then displays the decimal equivalent multiplied by 2. For example, the program displays 10 for hex '5', 20 for 'A', etc. If the user enters an invalid value, the program should display an error message and asks the user to try again Hints: (14 marks) Valid characters can either be from 'O' to '9' or from 'A'to 'F' (uppercase only). what is the hexadecimal value for ASCII '0' and A'? Shifting left by one bit doubles the value (if the new value fits in current register) Hex digit X2 in decimal is 18 program is finished running (dropped off bottom) Hex digit X2 in decimal i3 26 program is finished running (dropped off bottom)- Unrecognized hex digit. Try again: R Unrecognized hex digit. Try again: r Unrecognized hex digit. Try again: d Unrecognized hex digit. Try again: D Hex digit X2 in decimal is 26 - program is finished running (dropped off bottom)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!