B.21

We need four states, two of which have the same output (Mlite).

B.22

   S (current state)       output        NS (next state)
   -----------------------------------------------------
        00                  Llite             01
        01                  Mlite             10
        10                  Rlite             11
        11                  Mlite             00
   -----------------------------------------------------
Output:
    Mlite = S0
    Rlite = (not S0) and S1
    Llite = (not S0) and (not S1) = S0 nor S1
Next state:
    NS0 = not S0
    NS1 = S0 xor S1

2.11

Assume IC is the total instructions, then instructions for each class are 0.25*I C

AVERAGE CPI = Sigma( CPIi * Ci)/Sigma(Ci) = 0.25*IC * Sigma(CPIi)/IC
            = 0.25 * Sigma(CPIi) (0 < i <= 4)

Performance for M2 / Performance for M1 = CPU Time for M1 / CPU Time for M2

   = (IC * CPI for M1/Clock Rate for M1)/(IC * CPI for M2/Clock Rate for M2)

     ( 0.25 * Sigma(CPIi for M1) / Clock Rate for M1 )
   =---------------------------------------------------
     ( 0.25 * Sigma(CPIi for M2) / Clock Rate for M2 )

   =  ( (1+2+3+4 ) / 500 ) / ( (2+2+4+4) / 750 )

   =  1.25

2.12

Let C1 be the clock rate of M1.

M1 performance

               C1            C1
       ----------------- = ------
       (1+2+3+4)*0.25*IC   2.5*IC
M2 performance
              750          750
       ----------------- = ----
       (2+2+4+4)*0.25*IC   3*IC
Solve for C1 in
         C1      750
       ------ = ------
       2.5*IC    3*IC
We get C1 = 625 MHz.

2.16

                                        MFP     MNFP
    floating point multiply     10%      30      900
    floating point add          15%      45      900
    floating point divide        5%      15      750
    integer                     70%     210      210
    total                      100%     300     2760

2.17

CPU TIME for MFP = IC * CPI / Clock Rate
        = 300 * 3.6 / 1000 = 1.08 seconds

CPU TIME for MNFP = IC * CPI / Clock Rate

     300 * 1000000 * (0.1*30 + 0.15*20 + 0.05*50 + 0.7*1) * 2
   =------------------------------------------------------------
                1000 * 1000000
   = 5.52 seconds

2.43

    fraction           speed up
    ---------------------------
      0                 1.00
      0.25              1.25
      0.50              1.67
      0.75              2.50
      1.0               5.00