Abstract:
A self-resetting status register has two flip-flops per status bit to provide a stable output signal while the register is being read and to recognize event signals that are applied to the register during the read operation.

Description:
FIELD OF THE INVENTION 
     This invention relates to microprocessor interface circuits and, more particularly, to status registers. 
     BACKGROUND OF THE INVENTION 
     Microprocessor-based control systems rely on interrupt signals from peripheral devices (&#34;peripherals&#34;) to notify a central processing unit (&#34;CPU&#34;) when specific events occur. These events include expected events, such as completed operations, as well as unexpected events, such as errors. A typical peripheral can detect several kinds of events and the total number of events that can be detected by all the peripherals of a system is generally larger than the number of unique interrupt signals that a CPU can recognize, so generally each peripheral is allocated only one of these unique interrupt signals and each peripheral has a status register by which it indicates to the CPU one or more reasons for an interrupt signal. Each bit in the status register corresponds to an event that the device can detect and the setting of any combination of status bits in the status register generates one interrupt signal. When the CPU services an interrupt signal it reads the status bits in the interrupting device&#39;s status register to ascertain which event(s) occurred and then it resets the status bits to signify to the peripheral that it has serviced the event(s) and to enable the peripheral to post a subsequent event. 
     Requiring the CPU to perform separate read and reset (write) operations on the status register increases the time it takes the CPU to service an interrupt signal and, therefore, delays the servicing of interrupt signals from other peripherals, possibly beyond their maximum wait (&#34;latency&#34;) time. Designers of prior-art circuits, such as the Motorola MC6821 Peripheral Interface Adapter, reduce the time to service an interrupt signal by providing self-resetting registers, which automatically reset all their bits upon being read. However, and quite problematically, if a new event occurs while the CPU is reading such a status register, the associated peripheral does not generate a corresponding interrupt signal because at the end of the read operation the register resets itself, including the bit that corresponds to the new event. 
     SUMMARY OF THE INVENTION 
     The invention is a self-resetting status register that recognizes events that occur while the register is being read. During a read operation the register provides a stable output signal, i.e., none of the status bits changes states during a read operation, and after the read operation the register resets to a &#34;ZERO&#34; state those bits that were in a &#34;ONE&#34; state before the read operation began. During the read operation circuitry within the register records events that would otherwise change the states of any of the bits from a ZERO to a ONE and after the read operation it sets those bits to the ONE state. 
     The status register thus ensures that no event occurring during a read operation, i.e., while the CPU services a &#34;current interrupt,&#34; goes unserviced by the CPU. If the status bit corresponding to the event is not set prior to the read operation, the register sets the bit after the read operation, which causes a subsequent interrupt. The CPU then services the event in response to the subsequent interrupt signal. On the other hand, if the status bit is already set before the beginning of the read operation, the CPU services the event as part of the current interrupt and then the register resets the status bit at the end of the read operation. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The above and further advantages of the invention may be better understood by referring to the following description in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a schematic diagram of a one-bit, self-resetting status register according to the present invention; and 
     FIG. 2 is a schematic diagram of a multi-bit, self-resetting status register, which utilizes the one-bit status register of FIG. 1. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A one-bit self-resetting status register 100, shown schematically in FIG. 1, is set, e.g. by a peripheral (not shown), by applying an event signal 102 to the register, and it is read, e.g. by a CPU (not shown), that applies a read signal 104 to the register while sensing a status signal 106 produced by the register. A buffer flip-flop 108 and a status flip-flop 110 are connected to a source of periodic clock pulses 112 and, being edge-triggered flip-flops, they change states only on the leading edges of clock pulses. Both flip-flops 108 and 110 are reset, i.e., set to the ZERO state, by an initialization circuit (not shown) when power is first applied to the status register 100. 
     An event occurring within the peripheral generates the event signal 102 for at least the period of the clock pulses 112. Assuming either that the status flip-flop 110 is in the ZERO state or that no read signal 104 is present, a NAND-gate 114 produces a resulting ONE signal, which enables an AND-gate 116. The event signal 102 thus passes through an OR-gate 118 and the AND-gate 116 and then sets the buffer flip-flop 108 on the next clock pulse 112. On the succeeding clock pulse 112, a signal from the buffer flip-flop 108 sets the status flip-flop 110 to the ONE state. Once the buffer flip-flop 108 is set, a feed-back circuit 120 sends a ONE signal through the OR-gate 118 and the AND-gate 116 to set the buffer flip-flop 108 on each succeeding clock pulse 112, as long as no read signal 104 is present. Thus, once set, the buffer flip-flop 108 remains set until a read signal 104 is applied to the register 100. 
     A CPU initiates a read operation of the status register 100 by applying the read signal 104 for at least the period of the clock pulses 112 and simultaneously sensing the status signal 106, which indicates the state of the status flip-flop 110. As long as the read signal 104 is present, the status flip-flop 110 is disabled from changing states by the read signal being present on a NOT-LOAD-ENABLE (LE) terminal 122 of the status flip-flop. 
     If the status flip-flop 110 is in the ONE state during the read signal 104, the NAND-gate 114 produces a ZERO signal, which disables the AND-gate 116. Regardless of whether the event signal 102 is present and despite the feed-back signal 120, the AND-gate 116 produces a ZERO signal, which resets the buffer flip-flop 108 on the next clock pulse 112. On the other hand, if the status flip-flop 110 is in the ZERO state during the read signal 104, the NAND-gate 114 produces a ONE signal, which enables the AND-gate 116. If the event signal 102 is present it passes through the OR-gate 118 and the AND-gate 116 and then sets the buffer flip-flop 108 on the next clock pulse 112. In either case, on the succeeding clock pulse 112 a signal from the buffer flip-flop 108 sets the status flip-flop 110 to the same state as the buffer flip-flop. Thus, after being read, the status register 100 resets itself if it is in the ONE state prior to the read operation, but the occurrence of the event signal 102 during a read operation sets the register if the register is in the ZERO state prior to the read operation. 
     FIG. 2 shows a multi-bit, self resetting status register 200 that employs the one-bit, self-resetting status register 100 of FIG. 1 for each bit 100a, b, c . . . , n of the status register. Such a multi-bit status register can be used by a peripheral (not shown) that can detect more than one event. Event signals 102a, b, c, . . . , n set the respective bits 100a, b, c, . . . , n, as described above. A read signal 204 and a source of periodic clock pulses 206 supply, respectively, the read signal 104 and clock pulses 112 to each one-bit register 100a, b, c, . . . , n. 
     If the status signal 106 from any of the one-bit registers 100a, b, c, . . . , n is a ONE, an OR-gate 210 produces an interrupt signal 212, which interrupts a CPU (not shown). Collectively, the status signals 106 from the one-bit registers 100a, b, c, . . . , n provide a multi-bit, composite status signal 208. When the CPU services the interrupt signal and generates the read signal 204, it reads the composite status signal 208, thereby reading the state of each status bit. Each one-bit register 100a, b, c, . . . , n then resets itself if it is in the ONE state, but the one-bit registers that are in the ZERO state before the read operation recognize event signals that occur during the read operation. 
     It will therefore be seen that I have developed a self-resetting status register that recognizes event signals that occur while the register is being read, which can be utilized with a variety of peripherals and controllers. The terms and expressions employed herein are used as terms of description and not of limitation, and there is no intention, in the use of such terms and expressions, of excluding any equivalents of the features shown and described or portions thereof, but it is recognized that various modifications are possible within the scope of the invention claimed. For example, those skilled in the art will recognize that although the circuits of FIGS. 1 and 2 are described as utilizing signals, such as the event signal 102, that are asserted on TRUE, i.e., on a HIGH logic level, some or all of the signals can be asserted on FALSE with only minor modifications to the circuits. NAND-gate 114, AND-gate 116 and OR-gate 118, constitute a gating arrangement, but other arrangements of components can be substituted therefor without departing from the scope of the invention. Furthermore, buffer flip-flop 108 and status flip-flop 110 are D-type flip-flops in the preferred embodiment, but other types of memories, such as J-K flip-flops, can be used.