You will write a program in MIPS to do the following.     Your program should ask the user to input a hexadecimal number.  All numbers will be positive. The hexadecimal number should be input as a string. The hexadecimal string should only be made up of the letters 0-9 and A-F.  If any other letters are in the string your program should report a bad hexadecimal value. The hexadecimal value should be converted to its base 10 value and stored in a register.  The base 10 value should be output to the screen. Extra: Take the base 10 number that was computed above and add 256 to that value. Convert the new base 10 number to a hexadecimal string. Print out the new hexadecimal value.   Example runs: Input hex-> 123Good Bad data Input hex-> ABCDEF Base 10 -> 11259375   Input hex-> 38 Base 10 -> 56

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.2: The If-else Statement
Problem 3E
icon
Related questions
Question
You will write a program in MIPS to do the following.
    Your program should ask the user to input a hexadecimal number.  All numbers will be positive. The hexadecimal number should be input as a string. The hexadecimal string should only be made up of the letters 0-9 and A-F.  If any other letters are in the string your program should report a bad hexadecimal value. The hexadecimal value should be converted to its base 10 value and stored in a register.
 The base 10 value should be output to the screen.
Extra:
Take the base 10 number that was computed above and add 256 to that value.
Convert the new base 10 number to a hexadecimal string.
Print out the new hexadecimal value.
 
Example runs:
Input hex-> 123Good
Bad data

Input hex-> ABCDEF

Base 10 -> 11259375
 
Input hex-> 38

Base 10 -> 56
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr