Homework 6 Solutions

1. (a) (b)

2.

NOTE: When the execution times for this solutions were calculated, 1 cycle was added for the time it took an instruction to move from the scoreboard to execution stages. It is not necessary to add this extra cycle. If this cycle is not added, completion times may differ from those given below.

Assume starting values: F1=A, F2=B, F6=C

Annotated code:

100 MULF F3,F2,F1   D=B*A
104 DIVF F2,F1,F2   E=A/B
108 MULF F7,F6,F1   F=C*A
10C SUBF F4,F2,F1   G=E-A
110 ADDF F2,F1,F3   H=A+D
114 SUBF F1,F3,F2   I=D-H

The following activities take place during the first 7 cycles:

Time 0:

Time 1:

Time 2:

Time 3:

Time 6:

(a) When each instruction begins and ends:

Instruction  Issue  Execute  Write
   100         0       1        6
   104         0       1       21
   108         1       3        8
   10C         1      21       24
   110         2       6        9
   114         6       9       12

(b) Register Map:

Architecture  F0   F1   F2   F3   F4   F5   F6   F7
Physical      F0'  F10' F8'  F3'  F7'  F5'  F15' F6'

Register status:

Register  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
Busy      Y  n  n  Y  n  Y  Y  Y  Y  n  Y  n  n  n  n  Y
Valid     Y  Y  Y  Y  n  Y  n  n  n  Y  n  Y  Y  Y  Y  Y
Value     /  /  /  D  /  /  /  /  /  /  /  /  /  /  /  C

Free List:

F11', F13', F1', F14', F9', F12', F2'

Reservation Stations:

Add:  F7'  <- F4' -  A
      F10' <-  D  - F8'

Mult: empty

Div: empty