Hw2soln - HW2 Sample Solution Problem 1 00 loadI 1024 => r0 01 loadI 1 => r1 02 storeAI r1 => r0 0 03 addI r1 2 => r2 04 storeAI r2 => r0 4 05 sub

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

View Full Document Right Arrow Icon
HW2 -- Sample Solution Problem 1 00: loadI 1024 => r0 01: loadI 1 => r1 02: storeAI r1 => r0, 0 03: addI r1, 2 => r2 04: storeAI r2 => r0, 4 05: sub r2, r1 => r3 06: storeAI r3 => r0, 8 07: add r1, r2 => r4 08: storeAI r4 => r0, 12 09: addI r4, 1 => r5 0A; storeAI r5 => r0, 16 0B: mult r3, r5 => r6 0C: sub r5, r6 => r7 0D: storeAI r7 => r0, 20 0E: add r4, r5 => r8 0F: add r8, r7 => r9 10: storeAI r9 => r0, 24 11: loadI 1020 => r10 12: store r9 => r10 13: output 1020 Problem 2 r1 = [01, 07) r2 = [03,07) r3 = [05,0B) r4 = [07,0E) r5 = [09,0E) r6 = [0B,0C) r7 = [0C,0F) r8 = [0E,0F) r9 = [0F,12) r10 = [11,12) MAXLIVE = 3 Problem 3a 00: loadI 1024 => r0 01: loadI 1 => rA 02: storeAI rA => r0,0 03: addI rA, 2 => f1 04: storeAI f1 => r0, 4 05: sub f1, rA => f2 06: storeAI f2 => r0, 8 07: add rA, f1 => f2 08: storeAI f2 => r0, 12 09: addI f2, 1 => f1 0A: storeAI f1 => r0, 16 XX: loadAI r0, 8 => f2 0B: mult f2, f1 => f2 0C: sub f1, f2 => f2 0D: storeAI f2 => r0, 20 XX: loadAI r0, 16 => f2 0E: add f2, f1 => f1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2010 for the course CS 198:415 taught by Professor Kremer,u. during the Spring '10 term at Rutgers.

Ask a homework question - tutors are online