Page 76 -
P. 76

2.5 / PERFORMANCE ASSESSMENT 51




                             quartz
                           crystal







                                                      analog to
                                                      digital


                      From Computer Desktop Encyclopedia,  conversion
                      1998, The Computer Language Co.



                      Figure 2.14 System Clock


                  it takes some finite amount of time for the voltage levels to settle down so that an
                  accurate value (1 or 0) is available. Furthermore, depending on the physical layout
                  of the processor circuits, some signals may change more rapidly than others. Thus,
                  operations must be synchronized and paced so that the proper electrical signal
                  (voltage) values are available for each operation.
                       The execution of an instruction involves a number of discrete steps, such as
                  fetching the instruction from memory, decoding the various portions of the instruc-
                  tion, loading and storing data, and performing arithmetic and logical operations.
                  Thus, most instructions on most processors require multiple clock cycles to com-
                  plete. Some instructions may take only a few cycles, while others require dozens. In
                  addition, when pipelining is used, multiple instructions are being executed simulta-
                  neously.Thus, a straight comparison of clock speeds on different processors does not
                  tell the whole story about performance.

                  INSTRUCTION EXECUTION RATE A processor is driven by a clock with a constant
                  frequency f or, equivalently, a constant cycle time  , where t = 1/ft  . Define the in-
                  struction count, I , for a program as the number of machine instructions executed
                                 c
                  for that program until it runs to completion or for some defined time interval. Note
                  that this is the number of instruction executions, not the number of instructions in
                  the object code of the program. An important parameter is the average cycles per
                  instruction CPI for a program. If all instructions required the same number of clock
                  cycles, then CPI would be a constant value for a processor. However, on any give
                  processor, the number of clock cycles required varies for different types of instruc-
                                                                  be the number of cycles re-
                  tions, such as load, store, branch, and so on. Let CPI i
                  quired for instruction type i. and I be the number of executed instructions of type i
                                                i
                  for a given program.Then we can calculate an overall CPI as follows:
                                                    n  (CPI * I )
                                           CPI =  ai=1      i   i                     (2.1)
                                                         I c
   71   72   73   74   75   76   77   78   79   80   81