METHOD AND APPARTUS FOR PROVIDING HISTOGRAM DATA

Abstract: Data for a histogram is provided through generation of a pseudo-random sequence in a shift register connected in predetermined feedback relation. A histogram element stor­ age location is addressed in a random access memory and is used for loading the shift register in parallel when an event corresponding to that element takes place. The shift register proceeds from that point to increment a pseudo-random sequence for the duration of the event, and the concluding value of the sequence is loaded back into the random access memory location at the conclusion of the event. A network between the random access memory and the shift register loads the shift register with a pattern that replicates the pattern that would exist in the shift register if the shift register had already been loaded and the data therein was shifted once.

Description: Background of the Invention The present invention relates to a method and apparatus for providing data for a histogram and particularly to a method and apparatus for providing such data on a real time basis. A histogram is a representation of the number and/or duration of certain events, for example portraying the times required by a computer to execute various procedures or instructions. An illustration of a histogram is provided in FIG. 3 wherein different events are represented by different horizontal bars and the lengths of the bars represent numbers of events or elapsed time. A histogram may be generated by a computer via a software procedure employed on a sampling basis for logging the times required for different procedures or their number of occurrences, but unfortunately this approach has the effect of interfering with the software or computer being tested. A second approach would employ a plurality of hardware timers or counters, each assigned to a particular event or procedure, and each enabled when that particular event or procedure takes place. This approach is satisfactory for limited numbers of events but becomes impractical for a histogram of any size. "Polynomial counters", which are feedback linear shift registers that generate a pseudo-random sequence of numbers are illustrated in the article by D. L. Moon in Computer Design, November 1969, pages 135 - 143, entitled "The Polynomial Counter Design Technique with Applications in Four-phase Logic". Also known is the use of polynomial counters to replace binary counters in microprocessors for address calculation, as illustrated by O. Kaestner in Computer Design Vol. 14, No. 1, January 1975, pages 69 - 75: "Implementing Branch Instructions with Polynomial Counters". One prior art method for providing data is described in a paper by Steven Kerman, entitled: " A Facility for Analyzing Microprocessor System Performance", published in the Digest of Papers, IEEE Compcon, 1979. In this system, a large number of counters is simulated by one counter and a random access memory. During the occurrence of each event the counter counts clock pulses and its concluding count is added to a stored value in memory. The same adder is employed successively for updating many different memory locations. While more practical than a multiplicity of counters, this system still tends to be somewhat hardware intensive and slower than desired because of the time required for adder operation. Lack of speed significantly limits the usefulness of a histogram processor in real-time applications. Summary of the Invention In accordance with the present invention there is provided an apparatus for providing data for a histogram comprising: a random access memory (11) having a plurality of addressable locations; a shift register (15) adapted to be loaded in parallel and interconnected in a feedback relationship to provide a predetermined number sequence as data is shifted therein, the sequence being representative of the number of times shifting has occurred; and means (13) for loading data from a selected addressable location in parallel into the shift register in response to a command signal (FETCH) and for transferring the contents of the shift register back into the selected addressable location at the completion of the command signal; whereby the shift register cycles through predetermined number sequence while the command signal is present. Also according to the present invention there is provided a method of providing data suitable for a histogram comprising the steps of: loading in parallel a shift register (15) with a value stored at a selected address location of a random access memory (11) in response to a command signal (FETCH), the shift register being interconnected in a feedback relation to provide a predetermined number sequence as data is shifted therein, the sequence being representative of the number of times shifting has occurred; shifting the data within the shift register while the command signal is present according to the predetermined number sequence; and transferring the data from the shift register to the selected address location upon completion of the command signal. In the foregoing manner the implementation of a multiplicity of counters is avoided and also the implementation of a separate counter and adder is avoided thereby decreasing the equipment cost and complexity while increasing operating speed. The present invention will now be described in detail with reference to the accompanying drawings in which: Drawings FIG. 1 is a block diagram of apparatus according to the present invention for generating data for a histogram; FIG. 2 is a chart illustrating a pseudo-random sequence produced by the FIG. 1 apparatus; and FIG. 3 is an illustration of a typical histogram. Detailed Description Referring to the drawings and particularly to FIG. 1, a random access memory 11 is employed to store histogram "counts" which represent the magnitude of histogram elements, for example the lengths of the horizontal bars in the FIG. 3 histogram. It is understood that conventional graphic display equipment is utilized for displaying bars (or any other convenient kind of representation) in response to the numbers that are stored at various locations of memory 11. In the present example, histogram generation will be described in connection with depicting the accumulated times required by a computer to implement certain procedures, i. e. wherein the histogram element represents all of the occurrences of an instruction or group of instructions and the total times spent in executing the same. This data is useful for detecting procedures for which excessive time may be required. The data-out connections of random access memory 10 which are designated 25 through 32 are connected, via intervening circuitry, to parallel data inputs P₀ through P₇ of shift register 15. In particular, successive random access memory outputs 25 through 31 are connected to shift register parallel data inputs P₁ through P₇. Exclusive OR gate 35 receives inputs from data out leads 27 and 32 and supplies the P₀ parallel input of the shift register. The parallel data outputs of the shift register 15, designated Q₀ through Q₇, are returned as the data inputs for random access memory 11 through bus 39, while two shift register outputs, Q₂ and Q₇, supply the serial input D₀ of the shift register in feedback relation by way of exclusive OR gate 37. Read/write control 13 operates random access memory 11 to bring about respective reads and writes at addresses specified on address bus 21 which may comprise an address bus of a computer. Actually, only predetermined higher order bits from bus 21 may be used to address memory 21 whereby each location in memory 11 identifies a series of computer instructions. Read/write control 13 receives a fetch signal from the computer under test for initiating a read of the memory 11, and for also supplying a preset enable signal on line 17. The preset enable signal enables shift register to accept parallel data on inputs indicated at P₀ through P₇ from the memory when it is later clocked by a computer clock pulse on line 19. When not so enabled, the shift register functions in a conventional manner and shifts data received at serial input D₀ from left to right, as pulses are supplied by the computer clock. The preset enable signal on line 17 disappears after one clock pulse, whereby subsequent clock pulses shift the parallel enterred data. The data will continue to shift with each computer clock pulse so long as a particular portion of a program is being carried out, as represented by a given instruction (or series of instructions) having an address applied via bus 21. The shift register 15 in the present embodiment receives serial input data from gate 37, comprising the exclusive ORed outputs Q₂ and Q₇ from the shift register. This serial input information is shifted one position to the right for each clock pulse, and this particular feedback configuration results in the generation by the shift register of a pseudo-random sequence of known length, here comprising 217 unique combinations of parallel outputs Q₀ through Q₇. A portion of this sequence is illustrated in FIG. 2. Alternative feedback connections for supplying different pseudo-random sequences are clearly possible and the presently described configuration is given only by way of example. The sequence of unique outputs are treated as successive numbers for describing the accumulated magnitude of a given histogram element. Then when the fetch line of the computer goes false, the contents of the register are loaded back into the addressed random access memory location via lines 39 for "updating" the number theretofore stored at the same address. By way of summary, it will be seen that upon instruction fetch for a particular address (or series of addresses) the shift register will receive as parallel input the end result of prior pseudo-random sequencing and will proceed in the same pseudo-random sequence so long as that address (or series of addresses) remains current. The addressed location in random access memory is then reloaded from shift register 15 to provide updating with the latest value for the histogram element. As noted previously, the contents of random access memory 11 are not loaded directly into the parallel inputs of shift register 15, but are loaded via the intervening network including XOR gate 35. It will be seen the parallel loading of the shift register replicates the pattern that would exist if the output from the random access memory were already in the shift register and the shift register contents were then shifted to the right by one position. Thus, the clock pulse which causes the output of the memory to be loaded into the shift register, itself causes one shift in the sequence so that if the contents of the shift register are immediately written back into memory 11, the accumulation for the time period of one clock pulse is correctly made. It is observed the accumulation and reloading of the memory by the shift register is accomplished without requiring an adder, and therefore the time required for carry propagation, etc. is avoided. The present system exhibits substantially increased speed of operation and can produce information for a display in real time generated from clocks having rates of twenty MHz and faster. The generation of a histogram for depicting computer performances is given only by way of example, and histograms may be generated for a wide variety of purposes. For instance, the histogram bars in FIG. 3 may represent of the incremental time periods occupied by a given voltage level of a waveform, e.g. a square wave or the like. The histogram can then be used to derive properties of the observed waveform such as average and RMS values, duty factor, etc. In these applications the use of a fast histogram processor allows results to be computed in significantly less time than would otherwise be posssible. It is common to digitize waveforms at frequencies in the 14 to 20 MHz range for video applications, and it has heretofore been difficult to design and construct histogram processing for keeping up, but these rates are easily achieved according to the present invention. Moreover, histogram processing is applicable to the accumulation of statistical data for use in complex real-time control systems. Two potential application areas are nuclear reactor control and controls for large electrostatic precipitators. For histogram processing in a floating point context, two histogram processors of the type herein disclosed can be employed: one produces a modulo histogram, that is it accumulates the mantissa of a floating point histogram, and the second produces the characteristic or exponent of the floating point histogram by counting the modulo carries and accumulating their total at a memory address which corresponds to the memory address used for the mantissa. Typically the two processors are relatively loosely linked by a first-in-first-out buffer memory to allow the exponent processor to be constructed of slower, less costly hardware than the mantissa processor. The reason for employing a floating point histogram processor is to allow histograms of a greater depth to be processed while using fast hardware sufficient for a shallow histogram.

Claims: An apparatus for providing data for a histogram comprising: a random access memory (11) having a plurality of addressable locations; a shift register (15) adapted to be loaded in parallel and interconnected in a feedback relationship to provide a predetermined number sequence as data is shifted therein, the sequence being representative of the number of times shifting has occurred; and means (13) for loading data from a selected addressable location in parallel into the shift register in response to a command signal (FETCH) and for transferring the contents of the shift register back into the selected addressable location at the completion of the command signal; whereby the shift register cycles through predetermined number sequence while the command signal is present. The apparatus as recited in claim 1 wherein the loading means comprises logical means (35) for replicating as data in the shift register the data from the selected address location already incrementally shifted once in the predetermined number sequence. The apparatus as recited in claim 1 wherein the shift register comprises gate means (37) for receiving parallel outputs of the shift register and for providing a logical output coupled to a serial input of the shift register to supply feedback to provide the predetermined number sequence. A method of providing data suitable for a histogram comprising the steps of: loading in parallel a shift register (15) with a value stored at a selected address location of a random access memory (11) in response to a command signal (FETCH), the shift register being interconnected in a feedback relation to provide a predetermined number sequence as data is shifted therein, the sequence being representative of the number of times shifting has occurred; shifting the data within the shift register while the command signal is present according to the predetermined number sequence; and transferring the data from the shift register to the selected address location upon completion of the command signal. A method as recited in claim 4 wherein the shifting step comprises the step of feeding back to a serial input of the shift register a predetermined logical combination of the contents of the shift register to define the predetermined number sequence. A method as recited in claim 4 further comprising the step of initially loading a predetermined value from the sequence into each address location of the memory. A method as recited in claim 4 wherein the step of loading the shift register comprises incrementally shifting the value from the selected address location by one in the predetermined number sequence when loading the value from the selected address location into the shift register.

Inventors: FRISCH, ARNOLD
Applicants: TEKTRONIX, INC.
Application year: 1986
Main classification: G06F11
IPC codes: G06F17, G06T7, G06F11