Background of the Invention
It is well known in the digital systems art to design general purpose computers and other types of digital systems using a common bus structure having bi-directional address, data and control lines. (A bi-directional line is a single line which a given device may use to either transmit or receive a particular signal). A typical such system is shown in FIG. 1 and consists of a central processing unit (CPU) 10, a random access memory (RAM) 20, a disk controller 30 and a communications controller 40. Each of these devices, except for RAM 20, has the capability to read or write data to or from any addressable location connected to bus 50 by asserting the address of a location on address lines 52, executing a read or a write sequence using control lines 54 and, as appropriate, either asserting data to be written or reading data from, data lines 56. The RAM 20 contains the bulk of the addressable locations in the system. However, it should be noted that controllers 30 and 40 and even in principle, CPU 10 may contain storage locations which are addressable from bus 50.
In systems having such a bus, it is necessary to have some technique for avoiding errors caused by two units attempting to transfer data on the bus simultaneously. In order to avoid such errors, bus structures include bus arbitration circuitry which establishes priorities for granting requests for control of the bus and grants control of the bus to the requesting unit having the highest priority.
A common technique for bus arbitration is shown in FIG. 2 and includes a bi-direction bus busy signal (BBSY), a bus request signal (BRQ) and a bus grant signal (BG) which is "daisy-chained" through the bus arbitration logic of each unit which is capable of gaining control of the bus. (By "daisy-chained" herein is meant that the signal flows undirectionally and sequentially through each of the units which is capable of gaining control of the bus. Within each unit, the signal flows through arbitration logic which allows the signal to pass on to the next unit only if the unit passing on the signal is not requesting control of the bus.)
FIG. 2 shows a block diagram of a typical bus arbitration scheme used in a digital system such as that described above. Bus arbitrator 110 receives BRQ on BRQ line 116. Line 116 is a control line common to all units which may take control of the bus and typically is driven by open collector circuits to ground and a pull-up resistor to a plus voltage. BRQ is asserted at a low level by one or more units driving line 116 low. When arbitrator 110 sees BBSY on control line 114 indicate that the bus is no longer busy, it asserts BG on control line 1112.
As described above, this signal is daisy-chained through each unit, except RAM 20 which is a passive device not capable of assuming control of bus 50. The first unit to receive BG which is asserting BRQ may then assert BBSY and take control of bus 50. By not passing on BG that unit prevents any other unit which is electrically further from arbitrator 110 from gaining control of bus 50. Thus units are given priority of access to bus 50 in the order in which they are connected to the BG daisy-chain.
Such bus arbitration techniques are well known to those skilled in the art, however, heretofore they have suffered from a problem arising from the asynchronous nature of the various units connected to the common bus. Because of the asynchronous type of operation typical of units requesting control of the common bus, it is possible for such a unit to request control of the common bus at any time; in particular, in the prior art, it was possible for a higher priority unit to pass on BG and then assert BRQ before a lower priority unit which had originally asserted BRQ, would have had time to assert BBSY and take control of the common bus. Under these circumstances, it was possible for two units to attempt to control the common bus at the same time, generally resulting in a fatal system error.
Thus it is an object of the subject invention to provide an improved bus arbitration system of the type described which substantially reduces the probability of two units simultaneously obtaining control of the bus.
It is a further object of the subject invention to provide a bus arbitration circuit for use in such an improved bus arbitration system which is associated with a unit in a system such as that described above which will either pass along a bus grant signal or will assert control of the bus but which will not simultaneously do both.
It is another object of the subject invention to provide such a circuit which may be incorporated into such a system without change to existing bus protocols.
Brief Summary of the Invention
The disadvantages of the prior art are overcome and the above objects are achieved by a bus arbitration system in accordance with the subject invention which comprises a plurality of digital devices connected to a bi-directional digital communications bus, the bus having control lines including a bi-directional bus request line upon which any of said devices may assert a signal to request control of the bus, a bi-directional bus busy line upon which any of said devices may assert a signal indicating that that device has control of the bus, and bus grant in and bus grant out lines which are used to sequentially pass a bus grant signal through each of said devices. The system also includes a bus arbitrator for initially generating a bus grant signal in response to the assertion of the bus request signal and the absence of the bus busy signal.
A digital circuit is operatively associated with the digital devices and further comprises a first flip-flop responsive to the input of the bus grant signal and to an internal bus request signal generated by the associated digital device to set when said bus grant signal is asserted if the internal bus request signal is not asserted, a second flip-flop circuit responsive to the input of the bus grant signal to set when the bus grant signal is asserted if the internal bus request signal is asserted, and logic associated with the flip-flop circuits to prevent both flip-flop circuits from being set simultaneously. The output of the first flip-flop circuit enables the bus grant output so that the bus grant signal is passed on and the output of the second flip-flop circuit asserts the busy signal and enables the associated device to take control of the bus.
Since the associated logic prevents both flip-flops from being set simultaneously, the circuit prevents the associated device from taking control of the bus after the bus grant signal is passed on.
It will be apparent to those skilled in the art that the subject invention achieves the objects set forth above while advantageously minimizing the delay in propagating the bus grant signal. Other objects and advantages of the subject invention will be apparent to those skilled in the art from consideration of the attached drawings and the detailed description set forth below.
Brief Description of the Drawings
FIG. 1 is a schematic block diagram of a prior art digital system having a bi-directional communications bus.
FIG. 2 is a schematic block diagram of a prior art bus arbitration system.
FIG. 3 is a schematic logic diagram of a bus arbitration circuit in accordance with the subject invention.
FIG. 4 is a timing diagram of the circuit of FIG. 3.
Detailed Description of a Preferred Embodiment
The following conventions apply to FIGS. 3 and 4 and to the detailed description set forth below.
(a) logic elements are depicted in accordance with Military Standard 806C;
(b) inputs and outputs shown as circled are asserted or active at a low voltage level;
(c) signals whose names have a * suffix are asserted at a low voltage level;
(d) a bar over a signal name indicates the non-asserted state;
(e) inputs not shown are permanently wired to be inactive;
(f) flip-flops are positive edge triggered "D" type, with overriding preset and clear inputs;
(g) BGIN* and BGO* are bus grant in and bus grant out signals, respectively;
(h) BRQ* is a common, bi-directional bus request signal on the bus;
(i) BBSY* is a common bi-directional bus busy signal on the bus;
(j) CBRQ* is an internal bus request signal asserted when a device requests control of the bus and removed when the device gains control of the bus;
(k) OWNB* is an internal signal asserted when a device gains control of the bus and removed when the device releases the bus;
(l) time internals are each arbitrary and are shown as uniform for ease of illustration only.
Turning to FIGS. 3 and 4, the digital circuit of the subject invention comprises two flip-flop circuits; flip-flop L0 and the logic defining its inputs, and flip-flop L1 and the logic defining its inputs, and additional output gating to the bus. At time t0, all bus and internal signals are not asserted and flip-flops L0 and L1 are reset. (Note that L0 and L1 may be initially cleared by RST* generating RST1* through OR gate 206.)
The embodiment shown will be described with respect to the following conditions:
(A) another device of lower priority requests control of the bus and the device associated with the illustrated circuit does not request control of the bus;
(t1) another device, of lower priority, asserts BRQ*;
(t2) a bus arbitrator responds to BRQ* and BBSY* and asserts BGIN*. L0 responds to BGIN* and CBRQ* through invertor 208 and AND gate 214 and sets. L0 holds the output of AND gate 212 high and L1 does not set. L0 and L1 assert BGO* through AND gate 214;
(t3) the other device responds to BGO* and asserts BBSY* and releases BRQ*;
(t4) the bus arbitration responds to BBSY* and removes BGIN*. L0 responds to BGINB* and BGO through inverters 208 and 220, AND gate 222 and OR gate 216 and resets, removing BGO*;
(t5) the other device releases BBSY*, restoring initial ditions;
(B) The associated device requests control of the bus and no other device requests control;
(t6) the associated device asserts CBRQ* AND gate 202 responds to BGIN*, CBRQ* and L1 through invertors 208 and 200, and AND gate 214 to assert BRQ*;
(t7) the bus arbitrator asserts BGIN*. L1 responds to BGINB* and L0 through AND gate 212 and sets, asserting BBSY* and releasing BRQ*. (Note that if a higher priority device requests control of the bus before BGIN* is received, CBRQ* and BRQ* will remain asserted until the higher priority device passes on a BGIN*.) The associated device removes CBRQ* and asserts OWNB*;
(t8) the bus arbitrator responds to BBSY* and removes BGIN*;
(t9) the associated device removes OWNB* when it is through with the bus. L1 responds to CBRQ* and OWNB* through AND gate 204 and OR gate 206 and resets, releasing BBSY* and restoring initial conditions;
(C) The associated device requests control of the device after BGO* is asserted but before the lower priority device asserts BBSY*;
(t10) the lower priority device asserts BRQ*;
(t11) the bus arbitrator asserts BGIN*. L0 sets and BGO* is asserted as at time t2;
(t12) the associated device asserts CBRQ* before the lower priority device can respond to BGO*. Because BGIN* is the "D" input to L0, the input is held high through invertor 208 and AND gate 214 and L0 remains set, L1 reset;
(t13) the other device asserts BBSY* and releases BRQ*;
(t14) the bus arbitrator responds to BBSY* and removes BGIN*. L0 and BGO* reset as at time +4. AND gate 202 responds to BGIN* CBRQ* and L1 through invertors 200 and 208 and AND gate 214 and asserts BRQ*;
(t15) the lower priority device releases BBSY*;
(t16) the bus arbitrator responds to BBSY* and asserts BGIN*. L1 sets, asserting BBSY* and releasing BRQ*, and the associated device removes CBRQ* and asserts OWNB*, as at time t7;
(t17) the associated device removes OWNB* when it is through with the bus resetting L1 and releasing BBSY* as at time t9; restoring the initial conditions.
The embodiment of the subject invention described above and shown in the attached drawings are given by way of illustration only. Other embodiments of the subject invention will be apparent to those skilled in the art upon consideration of the present teaching. Accordingly, limitations on the scope of the subject invention are to be found only in the claims set forth below.