Abstract:
A circuit which eliminates race conditions caused by gate delay variation. In the absence of gate delay variations data is made available for a period of time which extends beyond commencement of processing of such data. This circuit prevents gate delay variations from causing processing to commence after the period of time during which data is available. Each of a pair of flip-flops initiates or terminates the data available time period. These flip-flops, an exclusive-or gate and related circuitry are arranged such that the period of time for data availability is not terminated until after processing of such data actually commences.

Description:
FIELD OF THE INVENTION 
     The present invention relates to circuitry which enables and processes data. More particularly, it relates to elimination of race conditions between such data enablement and data processing. 
     BACKGROUND OF THE INVENTION 
     Race conditions are typically eliminated through use of delay lines or specially selected gates. Another approach is to individually test the complete circuit over its full temperature range and to replace gates that cause failure. However, such methods are expensive and time consuming. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, a race condition mediator circuit is provided for use in a processing system which includes a processing unit and a data unit. The processing unit is operative to provide a data request signal and a clock signal, and the data unit is operative to provide a data signal in response to the data request signal. 
     The race condition mediator circuit comprises timing means connected to the processing unit and operative in response to the data request signal to provide a data enable signal, a first gating means connected to the timing means and the data unit and operative in response to the data enable signal and the data signal to provide a gated data signal, and output storage means connected to the first gating means and the processing unit and operative in response to the clock signal and the gated data signal to provide a latched data signal. The timing means is further operative in response to an absence of the data request and clock signals to inhibit the data enable signal. 
    
    
     DESCRIPTION OF THE DRAWING 
     FIG. 1 is a logic diagram of the prior art; and 
     FIG. 2 is a logic diagram of the Race Condition Mediator Circuit of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to FIG. 1 of the accompanying drawing, the prior art circuit is shown connectable to a central processing unit (CPU). This circuit includes inverters I1 and I2 connectable to the CPU via data enable and read leads I1a and I2a, respectively. Inverter I1 is connected to the enable (ENB) input of tri-state gate G1 via inverter I3 and inverter I2 is connected to the clock input of flip-flop F1. Tri-state gate G1 is connectable to the memory via data-in lead G1a and it is connected to the J input of flip-flop F1 via data-out lead G1b. The K input of flip-flop F1 is connected to ground and the Q output of this flip-flop is connectable to the CPU via data-latched lead F1a. 
     This circuit is typically used for strobing data into a register for further processing such as error checking. To do this the CPU applies a logic level 0 RD (read) signal to lead I2a. This logic level 0 signal is inverted to a logic level 1 signal by inverter I2 and applied to the clock input of flip-flop F1. Since this flip-flop is a negative triggered flip-flop the logic level 1 signal appearing at the clock input has no effect. 
     The CPU then applies a logic level 0 DEN (data enable) signal to lead I1a. This logic level 0 signal is inverted to a logic level 1 by inverter I1 and then a logic level 0 by inverter I3. This logic level 0 signal is then applied to the enable (ENB) input of tri-state gate G1. This gate then gates data appearing on data-in lead G1a to data-out lead G1b. Consequently, this gated data appears at the J input of flip-flop F1. 
     The CPU then removes both the logic level 0 RD and DEN signals and applies logic level 1 signals to leads I1a and I2a. The logic level 1 signal appearing on lead I1a is inverted to a logic level 0 signal by inverter I1 and then to a logic level 1 signal by inverter I3. This logic level 1 signal then appears at the enable (ENB) input of tri-state gate G1 and causes it to turn off, thereby removing data from the J input of flip-flop F1. 
     The logic level 1 RD signal appearing on lead I2a is inverted a logic level 0 signal by inverter I2. This logic level 0 signal clocks flip-flop F1 and causes the data appearing at its J input to be stored in flip-flop F1 and therefore held at the Q output of this flip-flop. This data is then available to the CPU via data-latched lead F1a. 
     If inverters I1-I3 all have the same gate delays, simultaneous removal of the data enable and read signals (i.e., application of logic level 1 signals to leads I1a and I2a)does not result in any race conditions since flip-flop F1 is clocked before tri-state gate G2 is disabled. This absence of race conditions is ensured through provision of two gate delays between tri-state gate G1 and the CPU and only one gate delay between flip-flop F1 and the CPU. However, gate delays are not always of a constant value. Typically, gate delays vary from one nanosecond (ns) minimum to 15 ns maximum. Thus, whether or not true data is clocked into the register is dependent upon the gate delays of inverters I1-I3 and tri-state gate G1. If inverters I1 and I3 and tri-state gate G1 all have minimum propagation delays of 1 ns each and inverter I2 has a maximum propagation delay of 15 ns, then this circuit would fail because tri-state gate G1 would be turned off after a 3 ns delay which is 12 ns before flip-flop F1 would be clocked. 
     The present invention ensures that tri-state gate G1 is not turned off until flip-flop F1 is clocked even if, due to gate delays, the logic level 1 DEN signal propagates through the circuit before the logic level 1 RD signal. 
     Referring now to FIG. 2 the race condition mediator circuit of the present invention is shown connectable to the CPU. This circuit includes inverters I1 and I2 connectable to the CPU via data enable lead I1a and read lead I2a, respectively. Inverter I1 is connected to the clock (CLK) input of flip-flop F1 via inverter I3. Inverters I1 and I2 are connected to OR gate G1 which is connected to the clock input of flip-flop F2. 
     The J, K and preset (PRE) inputs of these flip-flops are connected to a +5 volt source which causes a logic level 1 signal to be applied to these inputs. The Q outputs of these flip-flops are connected to exclusive-or gate G2 which is connected to the enable (ENB) input of tri-state gate G3 via inverter I4. 
     Tri-state gate G3 is connectable to the memory via data-in lead G3a. This gate is further connected to the J input of flip-flop F3 via data-out lead G3b. The clock (CLK) input of flip-flop F3 is connected to inverter I2 and the K input of this flip-flop is connected to ground. The Q output of flip-flop F3 is connectable to the CPU via data-latched lead F3a. The clear inputs of flip-flops F1-F3 are all connected to each other and they are further connnectable to the CPU via the power clear lead PC1. 
     When power is applied to the CPU and the race condition mediator circuit, a logic level 0 power clear (PWR-CLR) signal is applied to the clear (CLR) inputs of flip-flops F1-F3, thereby causing them to reset. The CPU then applies a logic level 0 data enable (DEN) signal to lead I1a. This logic level 0 signal is inverted to a logic level 1 by inverter I1 and then to a logic level 0 by inverter I3. 
     This logic level 0 signal is then applied to the clock input of flip-flop F1. Since the J and K inputs of this flip-flop are connected to a +5 volt source, logic level 1 signals are present at its J and K inputs. Consequently, when the logic level 0 signal appears at the clock (CLK) input of this flip-flop, it toggles and provides a logic level 1 signal at its Q output. Since flip-flop F2 had been reset when power was applied to the circuit, a logic level 0 signal appears at its Q output. Consequently, flip-flop F1 provides a logic level 1 signal to exclusive-or gate G2 and flip-flop F2 applies a logic level 0 signal to this gate. 
     Exclusive-or gate G2 then provides a logic level 1 signal which is inverted to a logic level 0 new-data-enable (NEW-DEN) signal. This logic level 0 signal is then applied to the enable (ENB) input of tri-state gate G3, thereby causing that gate to transfer the data appearing on its data-in lead G3a to its data-out lead G3b. The data on lead G3b then appears at the J input of flip-flop F3. Thus, tri-state gate G3 responds to the logic level 0 DEN signal in the same manner as the prior art circuit and causes data to appear at the J input of flip-flop F3. 
     Subsequently, when the data is stable at the data-out lead, the CPU removes both the data enable and read signals by simultaneously applying logic level 1 signals to leads I1a and I2a. 
     With the prior art arrangement if the gate delays of inverters I1 and I3 and tri-state gate G3 were short, and the gate delay of inverter I2 was long, then tri-state gate G3 would remove data from the J input of flip-flop F3 before that flip-flop was clocked. This would result in erroneous data being stored in flip-flop F3. However, with the arrangement of the present invention, gate delays are irrelevant since tri-state gate G3 is not turned off until the data appearing at the J input of flip-flop F3 is strobed into that flip-flop. 
     Under this arrangemennt the CPU again simultaneously removes the data enable and read signals (as in the prior art) by applying logic level 1 signals to leads I1a and I2a. The logic level 1 signal appearing on lead I1a is inverted to logic level 0 signal by inverter I1 and then to a logic level 1 signal by inverter I3. The resultant logic level 1 signal appearing at the clock input of flip-flop F1 has no effect. Thus, removal of the data enable signal does not immediately cause tri-state gate G3 to turn off. 
     The logic level 0 signal from inverter I1 is also applied to the first input of OR gate G1. The logic level 1 signal appearing on lead I2a is inverted to logic level 0 signal and this logic level 0 signal is applied to the second input of gate G1 and also to the clock input of flip-flop F3. Thus, the data appearing at the J input of flip-flop F3 is clocked into that flip-flop before tri-state gate G3 is turned off. 
     The two logic level 0 signals appearing at the inputs of OR gate G1 then cause this gate to apply a logic level 0 signal to the clock input of flip-flop F2. This logic level 0 signal causes flip-flop F2 to toggle and thereby provide a logic level 1 signal at its Q output. Therefore, logic level 1 signals appear both inputs of exclusive-or gate G2 and this gate then provides a logic level 0 signal at its output. This logic level 0 signal is inverted to logic level 1 signal by inverter I4. This logic level 1 signal then appears at the enable (ENB) input of tri-state gate G3 and causes it to be turned off. Thus, tri-state gate G3 is not turned off until after the data appearing on data-out lead G3b has been clocked into flip-flop F3. 
     With this arrangement OR gate G1 logically &#34;ORs&#34; the inverted DEN and RD signals together and withholds the clock signal from flip-flop F2 until the trailing edge of the latter of the DEN and RD signals has passed. This prevents tri-state gate G3 from turning off until the latter of these two signals has passed. This arrangement ensures that valid data is strobed into flip-flop F3 by the logic level 1 RD signal, regardless of whether the circuitry in the path of tri-state gate G3 or flip-flop F3 is faster. After the data is strobed into flip-flop F3, the NEW-DEN signal is removed from tri-state gate G3 and that gate is turned off. 
     Exclusive-or gate G2 eliminates the need for resetting flip-flops F1 and F2 after every read cycle. Flip-flop F1 toggles on every leading edge of the DEN signal and flip-flop F2 toggles on every trailing edge of the DEN and RD signals. Exclusive-or gate G2 provides a logic level 0 signal whenever both of its inputs are at a logic level 0 or a logic level 1. It provide a logic level 1 signal only when its inputs are unequal. Therefore, there is no need to to reset flip-flops F1 and F2 after every read cycle because the NEW-DEN signal will be generated only when flip-flop F1 toggles and it will be removed when flip-flop F2 toggles, regardless of the logic level that these flip-flops are being switched to. 
     Thus the race condition mediator circuit of the present invention provides a novel arrangement for eliminating race conditions caused by unequal gate delays in data enable and data strobe paths. 
     It will be obvious to those skilled in the art that numerous modifications of the present invention can be made without departing from the spirit of the invention which shall be limited only by the scope of the claims appended hereto.