CS计算机代考程序代写 mips assembly convert numbers using mips assembly language on mars simulator.

convert numbers using mips assembly language on mars simulator.

code should read the input number in the following format in the input file

b8B: +0000 1111
b8B: -0000 1111
b8B: 0000 1111

b8D: +0000 1111
b8D: -0000 1111
b8D: 0000 1111

b8H: +0000 1111
b8H: -0000 1111
b8H: 0000 1111

h4B: +2BFC
h4B: -2bfC
h4B: 2BFC

h4D: +2bfC
h4D: -2BFC
h4D: 2BFC

h4H: +2BFC
h4H: -2bfC
h4H: 2BFC

d3B: +108
d3B: -108
d3B: 108

d3D: +108
d3D: -108
d3D: 108

d3H: +108
d3H: -108
d3H: 108

the output should be in the following format. each input line has a output line that includes input Information at the beginning of the line

b: +0000; 1111 B: 0000 0000 0000 0000 0000 0000 0000 1111
b: -0000; 1111 B: 1111 1111 1111 1111 1111 1111 1111 0001
b: 0000; 1111 B: 0000 0000 0000 0000 0000 0000 0000 1111

b: +0000; 1111 D: 15
b: -0000; 1111 D: -15
b: 0000; 1111 D: 15

b: +0000; 1111 H: 0000 000F
b: -0000; 1111 H: FFFF FFF1
b: 0000; 1111 H: 0000 000F

h: +2BFC; B: 0000 0000 0000 0000 0010 1011 1111 1100
h: -2bfC; B: 1111 1111 1111 1111 1101 0100 0000 0100
h: 2BFC; B: 0000 0000 0000 0000 0010 1011 1111 1100

h: +2bfC; D: 11,260
h: -2BFC; D: -11,260
h: 2BFC; D: 11,260

h: +2BFC; H: 0000 2BFC
h: -2bfC; H: FFFF D404
h: 2BFC; H: 0000 2BFC

d: +108; B: 0000 0000 0000 0000 0000 0000 0110 1100
d: -108; B: 1111 1111 1111 1111 1111 1111 1001 0100
d: 108; B: 0000 0000 0000 0000 0000 0000 0110 1100

d: +108; D: 108
d: -108; D: -108
d: 108; D: 108

d: +108; H: 0000 006C
d: -108; H: FFFF FF94
d: 108; H: 0000 006C

Each request is a single line as follow:

Input type (one character, b: binary, d: decimal, or h: hexadecimal)

Input length (1 to 32, in decimal)

Output type (one character, B: binary, D: decimal, or H: hexadecimal)

Colon (:) and space

Input value in the appropriate format including optional sign. Whitespace may be used for character grouping. If used, it does not count as part of the input length.

Output the data as follows:

Input type (one character, b: binary, d: decimal, or h: hexadecimal)

Colon (:) and space

Value input Semicolon (;) and space

Output type (one character, B: binary, D: decimal, or H: hexadecimal)

Colon (:) and space

Output value

insert spaces between every grouping of four characters in binary and hexadecimal outputs.

insert commas between grouping of three characters, for decimal outputs, counting from the right.