954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MIPS input base Converter

Constructing a MIPS code programme that reads the keyboard input of 8-bit binary number in ASCII where the only input is 0 or 1. The code should convert the string you have read in, into a numeric value. When a string is read in, it is stored as a numeric value in memory using the ASCII mapping.

Character 0 has as ASCII value = 4810 or 0x30.
Character 1 has as ASCII value = 4910 or 0x31.

Do not worry about handling any other characters. The input should always output as 8 characters long. The program will then be outputting the value in both base 10 and base 16 representations. Assuming the value is unsigned, the sample output should appear as follows:

Enter number (1 or 0): 10101111
The number in base 16 : 0xAF
The number in base 10 : 175

Use logical operators, shifts and branching to successfully implement this program.

Thank you

vio90
Newbie Poster
1 post since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You