Docsity

Computer Architecture II - Assignment 8 Questions | ECE 332, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
ec332 Name_______________________
Date________________________
Module 8 Due the next class meeting after Module 8 is done in class.
1. Modify the dot product routine to use Word-Wide Optimization
MVK .S1 40, A2 ; A2 = 40, loop count
loop: LDH .D1 *A5++, A0 ; A0 = a(n)
LDH .D1 *A6++, A1 ; A1 = x(n)
MPY .M1 A0, A1, A3 ; A3 = a(n) * x(n)
ADD .L1 A3, A4, A4 ; Y = Y + A3
SUB .L1 A2, 1, A2 ; decrement loop count
[A2] B .S1 loop ; if A2 ≠ 0, branch
STH .D1 A4, *A7 ; *A7 = Y
2. How many cycles does the original code take? Be sure to include nop’s.
3. How many cycles does the Word-Wide optimized code take?

Partial preview of the text

Download Computer Architecture II - Assignment 8 Questions | ECE 332 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

ec332 Name_______________________ Date________________________

Module 8 Due the next class meeting after Module 8 is done in class.

1. Modify the dot product routine to use Word-Wide Optimization MVK .S1 40, A2 ; A2 = 40, loop count loop: LDH .D1 *A5++, A0 ; A0 = a(n) LDH .D1 *A6++, A1 ; A1 = x(n) MPY .M1 A0, A1, A3 ; A3 = a(n) * x(n) ADD .L1 A3, A4, A4 ; Y = Y + A SUB .L1 A2, 1, A2 ; decrement loop count [A2] B .S1 loop ; if A2 ≠ 0, branch STH .D1 A4, *A7 ; *A7 = Y

  1. How many cycles does the original code take? Be sure to include nop’s.
  2. How many cycles does the Word-Wide optimized code take?