Question: Write the MIPS instructions that compute the equation $t 0 = $t 0 * 1 2 7 . 7 5 without using multiplication and division

Write the MIPS instructions that compute the equation $t0= $t0*127.75 without using multiplication and division instructions.
sll $t1, $t0,7 # $t1= $t0*128
sll $t2, $t0,6 # $t2= $t0*64
add $t1, $t1, $t2 # $t1= $t1+ $t2
sll $t2, $t0,5 # $t2= $t0*32
add $t1, $t1, $t2 # $t1= $t1+ $t2
sll $t2, $t0,4 # $t2= $t0*16
add $t1, $t1, $t2 # $t1= $t1+ $t2
sll $t2, $t0,3 # $t2= $t0*8
add $t1, $t1, $t2 # $t1= $t1+ $t2
sll $t2, $t0,2 # $t2= $t0*4
add $t1, $t1, $t2 # $t1= $t1+ $t2
sll $t2, $t0,1 # $t2= $t0*2
add $t1, $t1, $t2 # $t1= $t1+ $t2
add $t1, $t1, $t0 # $t1= $t1+ $t0($t1= $t0*127)
sll $t2, $t0,1 # $t2= $t0*2
add $t2, $t2, $t0 # $t2= $t2+ $t0($t2= $t0*3)
sra $t2, $t2,2 # $t2= $t2/4($t2= $t0*0.75)
add $t0, $t1, $t2 # $t0= $t1+ $t2($t0= $t0*127+ $t0*0.75)

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!