1. The following problems deal with translating from C to MIPs. Assume that variables g, h, i, and j are given and imple
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. The following problems deal with translating from C to MIPs. Assume that variables g, h, i, and j are given and imple
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.
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