quiz1sol

Dowhileconstructionsstyleforloopisalsookayforfullcredi

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t significant bit of register $a0 is 1, i.e. 1 + 4*32 = 129 Page 3 of 6 ECE 154A Fall 2012 Problem 3 (30 points) Translate the following C code into equivalent MIPS one: for ( i = 0; i < 10; i++) b[i] = ( a[i] + a[i+10] ) << 1 ; Assume the base addresses for the arrays a and b are in $a0 and $a1, correspondingly. Do‐while constructions style (for‐loop is also okay for full credit) addi $t0, $a0, 40 LOOP: lw $t1, 0($a0) lw $t2, 40($a0) addi $a0, $a0, 4 addi $a1, $a1, 4 add $t1, $t1, $t2 sll $t1, $t1...
View Full Document

This note was uploaded on 07/08/2013 for the course ECE 154A taught by Professor Strukov during the Fall '12 term at UCSB.

Ask a homework question - tutors are online