Page 1 of 1

1. The following problems deal with translating from C to MIPs. Assume that variables g, h, i, and j are given and imple

Posted: Tue Jul 12, 2022 8:28 am
by answerhappygod
1 The Following Problems Deal With Translating From C To Mips Assume That Variables G H I And J Are Given And Imple 1
1 The Following Problems Deal With Translating From C To Mips Assume That Variables G H I And J Are Given And Imple 1 (147.38 KiB) Viewed 35 times
1. The following problems deal with translating from C to MIPs. Assume that variables g, h, i, and j are given and implemented as 32-bit integers in a C program. You can assume that the values have already been loaded into registers. You can select which register is assigned to each variable. a. f = (g / 2 + j + i) - j (f * 4) - (i - h) b. g = • For each C statement above, what is the corresponding MIPS code? Use a minimum number of statements. • How many bits are needed to encode the above instructions for each C statement? • How many bits are needed in the register file to store the data for each C statement? a. addi f, g, 1 b. sub 8, 8, f • How can the two MIPS instructions above be represented using C code? • Name two ways using MIPS instructions to multiple a value in a register by 2 without using a multiply instruction.