Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider two different implementations of the same instruction set architecture.

ID: 3907761 • Letter: C

Question

Consider two different implementations of the same instruction set architecture. There are four classes of instructions, A, B, C, and D. The clock rate and CPI of each implementation are given in the following table. Clock Rate CPI class A CPI class B CPl class C CPI class D 1.6 GHz1 2 GHz 2 P1 2 4 P2 2 Answer the following questions: Given a program with 106 instructions divided into classes as follows: 10% class A, 20% class B. 50% class C and 20% class D, which implementation is faster? if answer is P1, write P1 if answer is P2, write P2 What is the total CPU time of P1 (in milliseconds)? ljust write number number, no need to write the unit) What is the total CPU time of P2 (in milliseconds)? ljust write number number, no need to write the unit)

Explanation / Answer

Question 1

Which implementation is faster?

                  For classA,

                             CPU-time=(106*(10/100))*1*.625=6.625ns

                                      Here,(106*(10/100))=(Instructions/Program)

                                                 1=CPI and .625=1.6GHz=clock time in ns

                  For classB,

                             CPU-time=(106*(20/100))*2*.625=26.5ns

                                      Here,(106*(20/100))=(Instructions/Program)

                                                 2=CPI and .625=1.6GHz=clock time in ns

         For classC,

                             CPU-time=(106*(50/100))*3*.625=6.625ns

                                      Here,(106*(50/100))=(Instructions/Program)

                                                 3=CPI and .625=1.6GHz=clock time in ns

           For classD,

                             CPU-time=(106*(20/100))*4*.625=6.625ns

                                      Here,(106*(20/100))=(Instructions/Program)

                                                 4=CPI and .625=1.6GHz=clock time in ns

                    Total CPU-time=6.625+26.5+99.375+53=185.5ns

                  For classA,

                             CPU-time=(106*(10/100))*2*.5=10.6ns

                                      Here,(106*(10/100))=(Instructions/Program)

                                                 2=CPI and .5=2GHz=clock time in ns

                  For classB,

                             CPU-time=(106*(20/100))*2*.5=21.2ns

                                      Here,(106*(20/100))=(Instructions/Program)

                                                 2=CPI and .5=2GHz=clock time in ns

         For classC,

                             CPU-time=(106*(50/100))*2*.5=53ns

                                      Here,(106*(50/100))=(Instructions/Program)

                                                 2=CPI and .5=2GHz=clock time in ns

           For classD,

                             CPU-time=(106*(20/100))*2*.5=21.2ns

                                      Here,(106*(20/100))=(Instructions/Program)

                                                 2=CPI and .5=2GHz=clock time in ns

                    Total CPU-time=10.6+21.2+53+21.2=106ns

So,P2 implementation is faster (p2 take 106ns and p1 take 185.5ns)

---------------------------------------------------------------------------------------

Question 2:-

Total Cpu-time in millisecond?