Question: MIPS, How many bits needed to encode C instruction? I am to encode the following C code. f = x + (y*8) - (z*2) with

MIPS, How many bits needed to encode C instruction?

I am to encode the following C code. f = x + (y*8) - (z*2)

with f,x,y,z in registers $s0,$s1, $s2,$s3

1. How many bits are needed to encode the above instructions for each C statement?

2. How many bits are needed in the register file to store the data for each C statement?

How do i find this? Here is my MIPS conversion of the C Code.

addi $t0, $zero, 8 #t0 = 8

mult $s2, $t0 #y*8

mflo $t1 # t1 = y*8

add $t2,$s1, $t1 #$t2 = x+(y*8)

addi $t3, $zero, 2 # $t3 =2

mult $s3,$t3 #z*2

mflo $t4 #$t4 = z*2

sub $s0,$t2,$t4 # f = x+(y*8)-(z*2)

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!