Logic circuit testable as an inverter pair and operable as a flip-flop
This is a continuation of application Ser. No. 564,193, filed Dec. 22, 1983, which was abandoned upon the filing hereof. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention relates to a logic circuit functioning as a flip-flop. 
     Use of the gate array has successfully reduced the design period of custom-circuit LSIs to anywhere from two or three months. The gate array is a semiconductor chip having a great number of logic cells, e.g., 2-input NAND or NOR gates, which cells are arrayed in a matrix fashion over a sufficient area of the chip. 
     To implement a custom-circuit logic function on a chip, a designer (as a user) selects an appropriate gate array from among various types of gate arrays, and interconnects logic cells with a dedicated metal pattern on the gate array chip. Therefore, with the omission of the design work of the semiconductor chip, the bulk of his design work for LSI development merely entails the laying out of the metal pattern for interconnecting the logic cells. Thus, the design period is greatly shortened, compared to that of the LSIs not having gate arrays. 
     The gate arrays, which are commercially available, serve as base components in designing and manufacturing custom-circuit LSIs. For this reason, the design cost can be shared among the users, resulting in an overall cost reduction of the LSIs. This cost reduction resulting from the use of gate arrays becomes effective in the production of from 2,000 to 3,000 or more LSIs. 
     The gate array suffers from the following defects, however. First, the integration density of the logic cells on the gate array chip is low, due to the need to ensure the flexibility of the interconnection. Also, a redundancy in the length of the metal pattern must be accepted in designing the custom-circuit LSIs. This redundancy impairs the operational speed of the custom-circuit LSIs. 
     In a defect inspection of newly manufactured custom-circuit LSIs, test data is applied to the custom-circuit LSIs on the chips, to check a circuit response. In cases wherein custom-circuit LSIs contain a number of flip-flops, such as CPUs, various items of test data must be prepared for the LSIs&#39; defect inspection. Therefore, since the test data is structurally complex, the preparation of such data imposes heavy and troublesome work on the designers. 
     To lighten the load of testing requirements, one approach used is the so called LSSD (level sensitive scan design), in which a plurality of flip-flops are operated as a shift register at the time of the defect inspection. This approach requires a number of additional lines and circuit elements, however. Therefore, when the LSSD circuit is formed on a gate array chip bearing logic cells with a low integration density, the need for a great number of components restrains the effective chip area; and, thus, might possibly render the metal pattern even more rendundant. 
     SUMMARY OF THE INVENTION 
     Accordingly, the primary object of the present invention is to provide a logic circuit which can facilitate the defect inspection of a LSI circuit. 
     According to the present invention, a logic circuit is provided, which comprises first and second gate circuits having at least first and second inputs and one output, and for producing signals according to a combination of input signals; a switching section for selecting one of first and second operation mode in accordance with a control signal, and wherein the switching section, in the first operation mode, connects the output of the first gate circuit to the first input of the second gate circuit, and connects the output of the second gate circuit to the first input of the first gate circuit, and, in the second operation mode, disconnects at least one of the first and second gate circuits from the first input of the other gate circuit. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a logic circuit of an embodiment according to the present invention; 
     FIG. 2 is a logic circuit which contains CMOS transistors and is equivalent to the logic circuit of FIG. 1; 
     FIG. 3 is a plan view of a portion of a gate array chip containing one block of logic cells; 
     FIG. 4 is a logic circuit of another embodiment according to the present invention, which embodiment is featured by using one of the transfer gates of the FIG. 1; 
     FIG. 5 is a logic circuit of yet another embodiment according to the present invention, which embodiment is featured in that transfer gates of FIG. 1 are respectively supplied with control signals; and 
     FIG. 6 is a logic circuit of a further embodiment according to the present invention, which embodiment is featured in that transfer gates of FIG. 5 are replaced by AND gates, respectively. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 shows a logic circuit according to an embodiment of the present invention. This logic circuit is provided with 2-input NOR gates 10 and 12 and transfer gates 14 and 16. A first input of the NOR gate 10 is connected to a SET input terminal. A second input of the NOR gate 10 is connected to the output of the NOR gate 12, via the transfer gate 14. The output of the NOR gate 10 is connected to the Q output terminal. The first input of the NOR gate 12 is connected to a RESET input terminal. The second input of the NOR gate 12 is connected to the output of the NOR gate 10 via the transfer gate 16. The output of the NOR gate 12 is connected to the O output terminal. The control inputs of the transfer gates 14, 16 are interconnected and joined to a MODE select terminal which is supplied with a control signal for selecting the first and second operation modes (i.e., the flip-flop mode and test mode). 
     In the flip-flop mode operation, a low level control signal &#34;L&#34; is supplied to a MODE select terminal. The transfer gate 14 and 16 are rendered conductive in response to control signal &#34;L&#34; and permit the passage of the respective signals therethrough. At this juncture, the output signal from NOR gate 12 is fed to NOR gate 10, through transfer gate 14, and the output signal of NOR gate 10 is fed to NOR gate 12, via transfer gate 16. Thus, cross-coupled NOR gates 10 and 12 may cooperate to serve as an RS flip-flop. For example, when the SET signal (i.e., high level signal &#34;H&#34;) is supplied to the SET input terminal, the NOR gate 10 produces a low level signal &#34;L&#34; in response to the SET signal supplied from the SET input terminal. This output signal &#34;L&#34; is fed to the NOR gate 12 through the transfer gate 16 and Q output terminal. At this time, if the RESET signal (i.e., high level signal &#34;H&#34;) is not input to the RESET input terminal, NOR gate 12 produces a signal &#34;H&#34; at the Q output terminal. The output signal &#34;H&#34; from NOR gate 12 is fed to NOR gate 10, through transfer gate 14. Therefore, NOR gate 10 continuously produces signal &#34;L&#34;, even if the supply of the SET signal is stopped; and, then, NOR gate 12 continuously produce signal &#34;H&#34; in response to the signal &#34;L&#34; derived from NOR gate 10. When the RESET signal &#34;H&#34; is applied to the RESET input terminal, NOR gate 12 produces a signal &#34;L&#34; at the Q output in response to the RESET. Then, the signal &#34;H&#34; derived from NOR gate 10 appears at the Q output terminal. Thus, NOR gates 10 and 12 are symmetrically connected to each other. 
     In the test mode operation, a high level control signal &#34;H&#34; is supplied to the MODE select terminal. Transfer gates 14 and 16 respond to the control signal &#34;H&#34; and are turned off and reject the passage of signals therethrough. As a result, NOR gates 10 and 12 are not supplied with the Q and Q output signals; and, hence, those gates merely invert the signals from the SET and RESET input terminals, and produce them at the Q and Q output terminals, respectively. 
     In the logic circuit, a desired operation mode can be designated by the control signal. The logic circuit serves as an RS flip-flop in the flip-flop mode, and as a couple of inverters in the test mode. If such logic circuits are used as parts for a custom-circuit requiring a number of RS flip-flops, such as a CPU, and, if all logic circuits assembled into the CPU are operated in the test mode at the time of the defect inspection, it is possible to find a defect or defects of the custom-circuit by merely supplying simple test data, except in the feed lines for cross-coupling of the logic circuits. 
     FIG. 2 shows a practical arrangement of the logic circuit shown in FIG. 1, in which arrangement CMOS transistors are used, allowing for its organization on the semiconductor chip. In particular, p-channel transistors 20 to 23 are provided for the NOR gates 10, 12; and n-channel transistors 28 and 29 are provided for the transfer gates 14, 16, as shown in FIG. 1. The gates of transistors 20 and 24 are interconnected and are joined to the SET input terminal. The gates of transistors 22 and 26 are interconnected and joined to the RESET input terminal. A series circuit of transistors 20 and 21 is connected, at one end, to a VDD terminal, at the other end, to a VSS terminal via a parallel circuit of transistors 24 and 25, and, further, to the Q output terminal. The gates of transistors 23 and 27 are connected to the Q output terminal, via transistor 29. A series circuit of transistors 22 and 23 is connected at one end to the VDD terminal, and, at the other end, to a VSS terminal through a parallel circuit of transistors 26 and 27, and, further, to the Q output terminal. The gates of transistors 21 and 25 are coupled to the Q output terminal, via transistor 28. The gates of transistors 28 and 29 are jointly connected to a MODE select terminal supplied with the control signal. 
     A description of the operation of the logic circuit of FIG. 2 may be given as follows. The p-channel transistors 20 to 23 are turned ON and OFF, in response to signals &#34;L&#34; and &#34;H&#34;, respectively. The n-channel transistors 24 to 29 are turned OFF in response to the signal &#34;L&#34;, and turned ON in response to the signal &#34;H&#34;. For example, when the control signal &#34;L&#34; is supplied to a MODE select terminal, the Q and Q output signals are interrupted by the transistors 28 and 29 being placed in an OFF state, to keep the gate voltage of the transistors 21, 23, 25 and 27 at low level. Therefore, the transistors 21 and 23 are conductive, while the transistors 25 and 27 are non-conductive. The input signal at the SET input terminal is inverted by a CMOS inverter of p- and n-channel transistors 20 and 24, and appears at the Q output terminal. The input signal at the RESET input terminal is likewise inverted by a CMOS inverter of transistors 22 and 26, and is applied to the Q output terminal. 
     When the control signal &#34;H&#34; is applied to the MODE select terminal, transistors 28 and 29 are turned ON. The Q output is passed through transistor 28 to transistors 21 and 25, while the Q output signal is fed to transistors 23 and 27, through transistor 29. As the combination of the transistors 20, 21, 24, 25 which corresponds to NOR gate 10 (FIG. 1), and the combination of the transistors, 22, 23, 26, 27 which corresponds to NOR gate 10 (FIG. 1) are cross-coupled with each other, the above-mentioned RS flip-flop function is realized. 
     Shown in FIG. 3 is one block of logic cells on a gate array chip. The gate array chip is provided with a number of blocks of logic cells, which cells can be connected to build any logic function. Logic cells of one block each contain a couple of 2-input NOR gates and a couple of transfer gates, enough to build the logic circuit of FIG. 2. The logic cells in FIG. 3 are interconnected, for example, to form the logic circuit of FIG. 2, with a metal pattern as indicated by the solid line M. In manufacture, the P and N-type regions 30-33 may be deposited after conductive strips 40-43 are laid down. 
     The logic cells of FIG. 3 may now be described in greater detail. The p-type semiconductor layers 30 and 31 and n-type semiconductor layers 32 to 35 are formed on the gate array, while being appropriately spaced apart from one another. Conductive layers 40 to 45 are layered on the semiconductor layers 30 to 35, through an insulating layer (not shown). The transistors 20, 24 of FIG. 2 are formed in the semiconductor layers 30, 32, through a conductive layer 40 providing gates. The transistors 21 and 25 of FIG. 2 are likewise formed in the semiconductor layers 30 and 32 through the conductive layer 41 interposed therebetween. The transistors 23 and 27 of FIG. 2 are formed in the semiconductor layers 31 and 33 through the conductive layer 42. Similarly, the transistors 22, 26 of FIG. 2 are formed in the semiconductor layers 31 and 33 through the conductive layer 43. Transistor 28 is formed in the semiconductor layer 34, through the conductive layer 44, and the transistor 29 is formed in the semiconductor layer 35, through the semiconductor layer 45. 
     With such an arrangement of transistors, the metal pattern M for the logic circuit of FIG. 2 can not be redundant. 
     FIG. 4 shows a logic circuit according to a second embodiment of the present invention. This logic circuit is provided with a coupled of 2-input NOR gates 10, 12 and a transfer gate 14, which components are the same as those of FIG. 1. In this embodiment, however, the transfer gate 16 of FIG. 1 is not used. In the logic circuit, the second input of NOR gate 12 is directly connected to the output of NOR gate 10. With this exception, the logic circuit of FIG. 4 has an interconnection similar to that of the logic circuit of FIG. 1. 
     In actual operation, when the control signal &#34;L&#34; is input to the MODE select terminal, the transfer gate 14 is turned ON in response to the control signal &#34;L&#34;. At this juncture, the Q output of NOR gate R is fed to NOR gate 10, through a transfer gate 14. In other words, the NOR gates 10, 12 are cross-coupled with each other and serve as an RS flip-flop. When the control signal &#34;H&#34; is supplied to the MODE select terminal, the transfer gate 14 is turned OFF in response to the control signal &#34;H&#34;. 
     As a result, the Q output signal of NOR gate 12 is shut off at the transfer gate 12 and, during the period of this shutting off of the signal, the voltage level on the second input of NOR gate 10 is low. NOR gate 10 inverts the input signal on the SET input terminal and produces an inverted one at the Q output terminal. NOR gate 12 receives the output signal from NOR gate 10 and the signal from the RESET input terminal to generate an output signal based on those received signals and outputs it at the Q output terminal. 
     With the arrangement of this embodiment, the output signal from the NOR gate 10 is supplied to NOR gate 12 in the test mode. Thus, it is further possible to find defects on the feed line which couples the output of NOR gate 10 and the second input of the NOR gate 12. 
     FIG. 5 shows a logic circuit according to a third embodiment of the present invention. This logic circuit is provided with a couple of 2-input NOR gates 10, 12 and a couple of transfer gates 14, 16, as in the embodiment of FIG. 1. The transfer gates 14 and 16 are respectively connected to a MODE-1 select terminal to be supplied with a first control signals and a MODE-2 select terminal to be supplied with a second control signal. Except for this circuit connection, the logic circuit of FIG. 5 has an interconnection similar to that of FIG. 1. 
     During the flip-flop mode operation, when the control signal &#34;L&#34; is supplied to the MODE-1 and MODE-2 select terminals, transfer gates 14 and 16 are turned ON, respectively, in response to the control signals &#34;L&#34; from the MODE-1, MODE-2 select terminals. With this circuit operation, the NOR gates 10, 12 cooperate to provide an RS flip-flop, as in the first and second embodiments. 
     In a test mode, when the control signal &#34;H&#34; is supplied to the MODE-1 and MODE-2 select terminals, transfer gates 14 and 16 are turned OFF, respectively, in response to the control signals &#34;H&#34; from the corresponding select terminals. NOR gates 10 and 12, respectively, invert the input signals from the SET and RESET input terminals, and supply the inverted ones to the Q and Q output terminals. NOR gates 10 and 12 produce output signals as in the case wherein the logic circuit of FIG. 1 operates in the test mode. 
     When control signals &#34;H&#34; and &#34;L&#34; are applied to the MODE-1 and MODE-2 select terminals, respectively, the transfer gate 14 is turned OFF in response to control signal &#34;H&#34;, while the transistor 16 is turned ON in response to control signal &#34;L&#34;. Then, NOR gates 10 and 12 respectively produce output signals at the Q and Q output terminals, as in the case wherein the logic circuit of FIG. 2 operates in the test mode. On the other hand, when control signals &#34;L&#34; and &#34;H&#34; are respectively applied to the MODE-1 and MODE-2 select terminals, transistors 14 and 16 are respectively turned on and off. 
     In other words, the logic circuit of this embodiment has four types of functions. Therefore, if the combination of the states of the control signals &#34;H&#34; or &#34;L&#34; applied to MODE-1 and MODE-2 is changed, it is further possible to find defects on the feed lines which cross-couple the NOR gates 10 and 12. 
     FIG. 6 shows a logic circuit according to a fourth embodiment of the present invention. This logic circuit, similar to the logic circuit of FIG. 5, uses AND gates 60 and 62 in place of transfer gates 14 and 16. The second input of the NOR gate 10 is connected to the output of the NOR gate 12 via the AND gate 60. The second input of the NOR gate 12 is connected to the output of the NOR gate 10 via the AND gate 62. And gates 60 and 62 are connected to the MODE-1 and MODE-2 select terminals, respectively. Except for the above connection, this embodiment has an interconnection similar to that of the FIG. 5 embodiment. 
     The AND gates 60, 62 permit the signals to pass therethrough in response to the control signals &#34;H&#34; derived from the corresponding select terminals. Further, these gates interrupt the passage of the signals in response to the other control signals &#34;L&#34;. 
     The logic circuit with such a circuit arrangement can be organized on the gate array chip having only NOR gate logic cells. 
     As may be seen from the foregoing description, the logic circuit according to the present invention can designate a desired operation mode by using a control signal. In the manufacturing stage of the custom-circuit, the logic circuit is used as a flip-flop; and, at the time of the defect inspection of the custom-circuit, the operation mode of the logic circuit is set to the test mode by using the control signal. In this way, the defect inspecting work can be performed easily. The logic circuit operating in the test mode produces a signal based on the mere combination of the input signals. Therefore, the work load of designers in preparing the test data is remarkably reduced, as compared of the conventional test data preparation work. 
     The logic circuit is effective in use, particularly when the custom-circuit is formed on the semiconductor chip. When the gate array is designed to allow for an interconnection adaptable to such a logic circuit, there is no need for the additional use of the inspection-easing-circuit based on the LSSD. Further, being structurally simple, the custom circuit does not occupy excessive area on the chip. Moreover, the transfer gate cells on the gate array chip may be used in organizing circuits other than the logic circuit, if necessary, for custom-circuit organization. In this respect, the gate array is decidedly flexible in use. 
     While NOR gates are used in realizing the RS flip-flop function in the above embodiments, these may be replaced by NAND gates. The essential feature of this invention lies in its ability to provide a switching means on a feed line of cross-coupling for a flip-flop function.