D 10 points now combine the above three parts to

This preview shows page 1 - 3 out of 3 pages.

(d) (10 points) Now combine the above three parts to write MIPS assembly code sequence to multiply the contents of registers r2 and r3. The final result of the multiplication will be in register r1 and r2. Note that r2 contains the multiplier and r3 contains the multiplicand.
or $t2,$t2,$t4 # put in MSB of $4 Condition: # for loop condition addi $s0,$s0,1 slti $s1,$s0,32 bne $s1,$zero,Loop (e) (4 points)Assume that each instruction in your program takes 1 clock cycle. How many clock cycle it takes to compute multiplication using your assembly code in part D? Do not forget to count loop etc. in the code.
(f) (6 points)In this part you are asked to optimize the code for multiplication (still

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture