# HW#3 - CprE 381 Computer Organization and Assembly Level...

This preview shows pages 1–2. Sign up to view the full content.

CprE 381 – Computer Organization and Assembly Level Programming Homework #3 Assigned: September 8 Due: September 22 (9:00am) [Note from Joe: This assignment is a continuation of the type of problems covered in the previous homework. If you’ve been following our in-class discussions on memory addressing arithmetic in MIPS this assignment should be considerably shorter than Homework #2.] Reading: Patterson & Hennessy, Sections 2.8, 2.12-2.14 1) Summary (a) What is the range of values that beq , j , and jr can branch to? (b) What are the formats a MIPS instruction can fit into? What fields comprise each format? (c) What are the five MIPS addressing modes? Name an instruction that uses each. 2) Code Translation (a) Assume \$s3=i , \$s4=j , . Below is the MIPS code: Loop: addi \$s4,\$s4,1 # j = j + 1 sll \$t1,\$s3,2 # \$t1 = 4 * i add \$t1,\$t1,\$s5 # \$t1 = & A[i] lw \$t0,0(\$t1) # \$t0 = A[i] addi \$s3,\$s3,1 # i = i + 1 slti \$t1,\$t0,10 # \$t1 = \$t0 < 10 beq \$t1,\$0, Loop # goto Loop if =0

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

### Page1 / 2

HW#3 - CprE 381 Computer Organization and Assembly Level...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online