Question: Question 2: a) Translate the following C code to MIPS. Assume f, g, h, i and j are assigned to registers $1, $2, $3, $4,

Question 2:

a) Translate the following C code to MIPS. Assume f, g, h, i and j are assigned to registers $1, $2, $3, $4, $5

f = g + h; i = j - 3; j = j & 0xFFFE; g = h - j;

b) For the following two MIPS instructions, show the value of the opcode, rs rt rd and immediate fields as appropriate for that type of instruction (R- or I-type).

addi $7, $9, 4 add $18, $9, $0

c) Assume for the following instructions, variable A is assigned to register $18, B is assigned to $19, x is assigned to $7 and y is assigned to $9. Translate the three instructions into C code.

addi $7, $9, 4 add $18, $9, $0 add $19, $7, $18

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!