Page 169 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 169

Unit 11: Counters and Time Delays


             4. Read the counters, as desired, using cpc_take_sample();                           Notes

             5. Release the CPU using cpc_rele() when finished.
             The attractive aspect of these interfaces is their simplicity. Once the counters are initialized, a
             program reads them by a single call to cpc_take_sample(). No matter how easy-to-use these
             APIs are, however, people are usually reluctant to instrument code. To avoid incrementing
             code, Solaris 8 software also ships with a couple of command-line based utilities, cpustat and
             cputrack, that report on CPU performance counters.
             Solaris 8 OE Utility Tools
             The cpustat utility reports on CPU performance counters in a system-wide fashion. cpustat is
             invoked from the command line, and a pair of processor events to monitor must be passed as
             an argument. Events go by pair because the current UltraSPARC and Pentium microprocessors
             have two hardware performance counters that must be programmed simultaneously. Optional
             arguments are the sampling interval and count, i.e., the frequency at which the counters are
             read and the number of times the counters are read. Multiple pairs of events can be specified;
             in that case, the system alternates between the multiple pairs. Because cpustat is a system-
             wide utility, it must be run as root.
             Questions:
             1. What you understand to UltraSPARC and Pentium microprocessors?

             2. Differentiate between MIPS and FLOPS.


            11.8 Summary

            •  A loop is set up with a conditional jump instruction that loops back or not depending on
               whether the count has reached the termination count.
            •  PC value is either loaded with an updated version of itself, or else it is loaded with a new
               Branch Address.
            •  Delay time can serve as a time to generate periodic waveforms or to sequence an industrial
               process.

            •  Calculation remains the same except that it the formula must be applied recursively to each
               loop.

            11.9 Keywords


            Jump: Branching occurs at one of a set of special instructions known collectively as jump.
            Offset branch: It is a branch where a value is added to the current PC value to produce the new
            value.

            Program counter (PC) is a register structure that contains the address pointer value of the current
            instruction.
            Time-delay: A special class of electromechanical relays called time-delay.

                          The following program uses register pair (BC) to control the time delay length.
                          1. Explain why the program as written does not perform properly. Correct the
                             program so that it functions as required.
                             LXI B,0FFFF h : Initialize loop counter.
                             Loop: DCX B : Decrement loop counter.



                                             LOVELY PROFESSIONAL UNIVERSITY                                   163
   164   165   166   167   168   169   170   171   172   173   174