Programmable macrocell circuit
TECHNICAL FIELD 
     The present invention relates to digital logic circuits of the type commonly employed as macrocells, and in particular to such macrocell circuits which can be programmed to operate as a flip-flop or as a latch, or be transparent to a signal, and which also have programmable output polarity. 
     BACKGROUND ART 
     In U.S. Pat. No. 164,612, Kaplinsky describes a programmable flip-flop circuit which includes a master inverter latch and a slave inverter latch with a pass transistor connected to the input of the master inverter latch and a special driver circuit connected between the output of the master inverter latch and the input of the slave inverter latch. The pass transistor and driver circuit are responsive to control signals supplied by complementary clock signals CLKand CLK or by multiplexers that select either the clock signals or a fixed logic level, to open or close a conductive path to the inputs of the respective master and slave latches. The driver circuit includes first and second transistors connected in series between a first terminal input and the input to the slave inverter latch, as well as third and fourth transistors connected in series between a second terminal input and the input to the slave inverter latch. The gates of the first and third transistors are driven by the output of the master inverter latch, while the gates of the second and fourth transistors are driven by one of the aforementioned control signals. The two terminal inputs connect the first and third transistors either to fixed logic high or low voltage levels or to multiplexers that provide a programmable selection of these voltage levels. In one embodiment, the selection by the multiplexers at these terminal inputs includes a feedback signal from the output of the slave inverter latch, thereby providing a toggle flip-flop programming option. The special driver circuit thus allows the flip-flop circuit to be programmed to operate as a D-type flip-flop, toggle flip-flop, or latch, or even be transparent to a signal and be programmed to provide a selected output polarity. 
     In U.S. Pat. No. 5,295,174, Shimizu describes a shift register having a plurality (N) of latch circuits which are located on a like plurality of signal paths. An N-by-1 multiplexer, located at the outputs of the plural signal paths, is controlled by a clock so as to select the output of each latch circuit in sequence. 
     In U.S. Pat. No. 5,148,052, Yellamilli describes a data latching circuit that employs a multiplexer to select either a direct input signal on one signal path or a latched input signal on an alternate signal path for output. 
     An object of the present invention is to provide a macrocell circuit which can be configured to operate as a flip-flop or as a latch, or which can be transparent to a signal, and which has a programmable output polarity, without sacrificing operational speed, and which is comparatively simple in terms of the number of transistor elements. 
     DISCLOSURE OF THE INVENTION 
     The object is met by a programmable macrocell circuit that has two master latch elements located on two, parallel, alternate signal paths, one a non-inverting &#34;true&#34; path and the other an inverting &#34;false&#34; path. Pass gates, located on the input end of each signal path and controlled by a master clock, are provided so that the input signal drives only a selected one of the two alternate signal paths. A 2-by-1 multiplexer is located between the outputs of the two signal paths and the input of a subsequent slave latch element in order to select the signal path to be used, and thereby select the output polarity. Thus, the circuit is characterized by having both true and false, i.e. complementary, signal paths, each with a separate master latch element, and by also having both pass gates for driving only one of the two signal paths and a multiplexer for selecting the output of one of the two paths. The circuit can also be configured so as to drive the pass gates or the multiplexer, or both, with fixed logic levels, instead of a clock signal, in order to provide latch or transparent circuit options. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic circuit diagram of a programmable macrocell circuit in accord with the present invention. 
    
    
     BEST MODE OF CARRYING OUT THE INVENTION 
     With reference to FIG. 1, a programmable macrocell circuit of the present invention includes an input terminal 11 receiving an input signal D, a pair of master latch signal paths 12 and 13 branching from the input terminal 11 and designated as a &#34;true&#34; path 12 and a &#34;false&#34; path 13, a pass transistor set 14 on the two signal paths 12 and 13 for selectively driving one and only one of these paths with the received input signal D, a pair of master latch elements 15 and 16, one on each path 12 and 13, a two-by-one clocked multiplexer 17 selecting one latch output for presentation at the input 18 of a single slave latch element 19, and an output terminal 20 at the output of the slave latch element 19. The true and false signal paths 12 and 13 recombine at the slave latch input 18. However, since only one of the two alternate paths 12 and 13 is driven for any particular programmed configuration, no signal conflict between the two paths 12 and 13 will ever occur at the latch input 18. 
     The pass transistor set 14 and the two-by-one clocked multiplexer 17 are similarly constructed but are placed on the true and false signal paths 12 and 13 on opposite ends of the master latch elements 15 and 16. That is, the pass transistor set 14 is located between the input terminal 11 and the inputs of the two latch elements 15 and 16, and therefore selects which latch element 15 or 16 will be driven by the input signal D, while the multiplexer 17 is located between the outputs of the two master latch elements 15 and 16 and the input 18 of the slave latch 19, and therefore selects which latch element 15 or 16 will drive the slave latch 19. Both the pass transistor set 14 and multiplexer 17 consist of complementary p-channel and n-channel field-effect transistor pairs 14a, 14b, 17a and 17b connected across the true and false signal paths 12 and 13 so that their respective transistor channels form gate-controlled switches for the signal paths. The gates of the complementary transistor pair 14a on the input side of the true path receive a complementary set of signals MCLKT and MCLKT, the gates of the complementary transistor pair 14b on the input side of the false path receive another complementary set of signals MCLKF and MCLKF, the gates of the complementary transistor pair 17a on the output side of the true path receive yet another complementary set of signals SCLKT and SCLKT, and the gates of the complementary transistor pair 17b on the output side of the false path receive a fourth complementary set of signals SCLKF and SCLKF. 
     When the true path 12 is selected, the signals applied to the transistor pairs 14b and 17b on the false path 13 will be fixed signals that are set to prevent signal transmission through the false path 13. That is, MCLKF=low, MCLKF=high, SCLKF=low, and SCLKF=high, so that all of the transistors controlled by those signals are off. Likewise, when the false path 13 is selected, the signals applied to the transistor pairs 14a and 17a on the true path 12 will be fixed signals that are set to prevent signal transmission through the true path 12. That is, MCLKT=high, MCLKT=low, SCLKT=low, and SCLKT=high, so that all of the transistors controlled by those signals are off. This ensures that only the selected signal path 12 or 13 will be driven by the input signal D and in turn drive the input 18 of the slave latch 19. Since the master latch element 15 on the true path 12 does not invert the input signal D, while the master latch element 16 on the false path 14 does invert the input signal D, selection of one or the other signal paths 12 or 13 selects the polarity of the signal applied to the input 18 of the slave latch 19, and hence the polarity at the output 20. The slave latch 19 is typically another inverting latch element, as shown, but could also be a non-inverting latch. The output 20 may also provide both inverted and non-inverted output signals Q and Q via an optional inverter element 21, in which case the polarity selection merely reverses the roles of the two outputs. In a typical macrocell for a logic circuit, one flip-flop output is couplable to an output pin, while the other flip-flop output is coupled to a feedback path to the logic circuitry. 
     Selection of flip-flop, latch and transparent operation is effected by the signals applied to the transistor pairs on the selected path 12 or 13. The following discussion will use a selected true path 12 as an example. The signals for a selected false path are analogous. For flip-flop operation, both the signals MCLKT and MCLKT applied to the transistor pair 14a and the signals SCLKT and SCLKT applied to the transistor pair 17a are clock signals, where the master and slave clock signals are synchronous and complementary. That is, MCLKT=CLK, MCLKT=CLK, SCLKT=CLK, and SCLKT=CLK, where CLK is any arbitrary clock signal. For latch operation, only the master signals MCLKT and MCLKT applied to the pass transistor pair 14a, or alternatively, only the slave signals SCLKT and SCLKTapplied to the multiplexer transistor pair 17a, are clock signals, the other set of master or slave signals being fixed to allow continuous transmission through the corresponding transistor elements. That is MCLKT=CLK, MCLKT=CLK, SCLKT= high, and SCLKT=low, or alternatively, MCLKT=low, MCLKT=high, SCLKT=CLK and SCLKT=CLK. Finally, for transparent operation, all of the signals for the selected path are fixed for continuous signal transmission, i.e. conductance of the transistor pairs. That is, MCLKT=low, MCLKT=high, SCLKT=high, and SCLKT=low. All of the transistor control signals may be received from multiplexers, not shown, that programmably select either clock inputs (CLK or CLK) or fixed signal inputs (high and low) by means of configuration memory bits, such as EPROMs or EEPROMs. For full programmability, each transistor pair 14a, 14b, 17a, and 17b receives its respective signals independently from the others and so has its own selection multiplexer. 
     Referring now to the various latch elements 15, 16 and 19 in the circuit, the master latch element 16 on the false path 13 and the slave latch 19 are normally inverter latches consisting of pairs of CMOS inverters that are cross-coupled such that the output of one inverter is connected to the input of the other. Both of these latch elements, therefore, invert the signals received at their respective inputs and provide the inverted signals at their respective outputs. The master latch element 15 on the true path 12 consists generally of a pair of CMOS inverters 25 and 26 coupled in series, with the output of the second inverter 26 coupled back to the input of the first inverter 25 along the true path 12. However, because it is preferable to inhibit the latch element&#39;s feedback path from coming in when operating in a latched mode, so that the latch element 15 effectively becomes transparent to the signal and doesn&#39;t slow down signal propagation, the second inverter 26 is normally made up of two inverter elements 26a and 26b of different strengths, both connected at their respective inputs to the output of the first inverter 25. The stronger inverter element 26a is only indirectly coupled to the true path 12 via a pass transistor pair 27 whose gates are controlled by complementary signals ACLK and ACLK, while the weaker inverter element 26b is directly coupled to the true path 12. The pass transistor pair 14a is not strong enough to rapidly switch the state of the strong inverter element 26a. Accordingly, the transistor pair 27 is shut, isolating the strong inverter element 26a, prior to the pass transistor pair&#39;s 14a opening so as to drive only the inverter elements 25 and 26b with the input signal D transmitted through the transistor pair 14a along the true signal path 12. Once the pass transistor pair 14a is closed, isolating the master latch element 15 from the input signal D, the transistor 27 opens to reconnect the strong inverter element 26a to the latch element&#39;s feedback path along path 12. To satisfy this requirement, the control signal ACLK is essentially the same as the signal MCLKT, but precedes MCLKT by about 150 psec to 200 psec. Likewise, ACLK precedes MCLKT by the same time interval. This phase difference can be readily achieved with a simple gate delay element through which the signals MCLKT and MCLKT must pass in order to reach the gates of transistors 14a. 
     The macrocell circuit in FIG. 1 is also provided with a set/reset circuit 31 for preloading a specified logic value into the master latch elements 15 and 16. A multiplexer 33 received two inputs 35 and 37, one at a logic high (or &#34;1&#34;) level and the other at a logic low (or &#34;0&#34;) level, and provides an output signal AUX IN on an output 39. The value of the output signal AUX IN is selected by the multiplexer 33 from either the logic high level on input 35 or the logic low level on input 37, in response to a selection signal SET on a control input 41. The output signal AUX IN at output 39 is transmitted to the true and false paths 12 and 13 on the input side of the master latch elements 15 and 16 via an auxiliary input path 43 through two pairs of pass transistors 45a and 45b. The complementary transistors in each pair 45a and 45b receive asynchronous signals IN2 and IN2 at their gates, which either allow the signal AUX IN to be loaded into the master latch elements 15 and 16 or block transmission of the AUX IN signal to the latch elements 15 and 16. In the normal mode, IN2 is low and IN2 is high, and the data signal D at the input 11 is passed through pass transistor 14 to one of the master latch elements 15 or 16. In the set mode, IN2 is high and IN2 is low, and both pass transistor pairs 14a and 14b are closed, allowing the selected high or low value AUX IN to be loaded into the master latch elements 15 and 16. Since the macrocell circuit in FIG. 1 is often a part of a larger logic circuit in which the input signal D is derived from programmable logic, the set circuitry 31 allows a user to bypass such programmable logic and directly input a value into the macrocell circuit&#39;s latch elements.