Abstract:
A programmable bit shift circuit in which data can be shifted in one operation by as many bit positions as desired, m input data lines and n output data lines are provided intersecting each other with n&gt;m. Switching elements such as transmission gates are provided at intersections of the input and output data lines. The control electrodes of switching elements at the intersections of the first through m-th input data lines and the j-th through (j+m-l)-th output data lines for each integer value of j equal to or less than (n-m+l) are interconnected. Shift control signals are coupled to the interconnected control electrodes.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to bit shift circuits and more particularly to a programmable bit shift circuit. 
     Bit shift circuits are often used in electronic computers or the like for processing binary-coded multi-bit data in accordance with predetermined programs. An example of a conventional bit shift circuit of this general type is as shown in FIG. 1. In this circuit, the input bit signals D i  (where i is a positive integer) of multi-bit data to be shifted are applied to the corresponding set input terminals S of R-S flip-flop circuits FF i  which are latch circuits. The outputs Q of the R-S flip-flop circuits FF 1  are applied in predetermined logic combinations to logic gate circuits L i+1  and L 1-1 . For instance, the logic gate circuit L n  is composed of a two-input NAND gate G 1  receiving the output Q of the flip-flop circuit FF n+1  and a right shift signal SHR, a two-input NAND gate G 2  receiving the output Q of the flip-flop circuit FF n-1  and a left shift signal SHL, and a two-input NAND gate G 3  receiving the outputs of the NAND gates G 1  and G 2 . The other logic circuits have the same arrangement as the logic gate circuit L n . 
     The output of the NAND gate G 3  in the logic gate circuit L i  is applied to one input terminal of a two-input NAND gate NG i  to the other input terminal of which a strobe signal is applied. The output of the NAND gate NG i  is applied through an inverter buffer I i  to the set input terminal S of a flip-flop circuit FF&#39; i . The outputs Q of the flip-flop circuits FF&#39; i  form the bit-shifted data SD i . 
     In the above-described circuit, the output data SD i  provided in response to the input data D i  can be represented by the following logical expression: ##EQU1## where SHL and SHR are the left shift signal and the right shift signal, respectively. When the signals SHL and SHR are at &#34;1&#34;, they represent left and right shift instructions, respectively. Accordingly, as is apparent from the expression (1), in the bit circuit of FIG. 1, the input data can be shifted to either the right or the left by one bit position. However, it is impossible to shift the data by plural bits with a single right or left shift instruction. Therefore, the above-described circuit is disadvantageous in that data multiplication takes a relatively long time. 
     In order to eliminate this disadvantage, a circuit has been proposed in which multi-bit shift circuits such as a two-bit shift circuit (SD i  =D i-2  ·SHL 2  +D i+2  ·SHR 2 ) and a four-bit shift circuit (SD i  =D i-4  ·SHL 4  +D i+4  ·SHR 4 ) are implemented separately in hardware and the two circuits then combined to carry out, for instance, a six-bit shift operation to thereby reduce the total time required. However, that technique is still disadvantageous in that the hardware itself is considerably intricate and accordingly an integrated circuit implementing such a circuit has a large chip area. 
     In another conventional circuit, a shift register is employed for subjecting data to bit shifting. This circuit can be implemented quite simply in hardware. However, the circuit is still disadvantageous in that it is difficult to process input data at high speed because the shifting operation can be carried out only at the rate of one bit per clock pulse. 
     Accordingly, an object of the present invention is to provide a programmable bit shift circuit in which data can be instantaneously shifted by as many bits as desired. 
     SUMMARY OF THE INVENTION 
     In accordance with this and other objects of the invention, a bit shift circuit is provided in which m input data lines and n output data lines are arranged intersecting one another (m and n being natural numbers and with m&lt;n), switching elements are provided at the intersections of the input and output data lines so as to electrically couple these data lines, and the control electrodes of the switching elements which are coupled at the intersections of the first through m-th input data lines and the j-th through (j+m-1)-th output data lines (j being a natural number equal to or smaller than n-m+1) are commonly connected by control lines so that input data can be shifted as many bits as desired by selectively driving a desired one of the control lines. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a circuit diagram, partly as a block diagram, showing an example of a conventional bit shift circuit; 
     FIG. 2 is a circuit diagram, partly as a block diagram, of a preferred embodiment of a programmable bit shift circuit according to the invention; and 
     FIG. 3 is a block diagram for a description of a multiplication operation which is carried out with the circuit shown in FIG. 2. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The present invention will be described with reference to FIGS. 2 and 3. 
     FIG. 2 is a circuit diagram of a preferred embodiment of a programmable bit shift circuit according to the invention in which eight-bit input data can be shifted either to the right or the left by from one to eight bits. 
     Eight input data lines D 0  through D 7  and twenty-four output data lines SD 0  through SD 23  are arranged with the former crossing the latter. At each cross point or intersection, a C-MOS type transmission gate T i ·j is provided for selectively coupling the i-th input data line D i  to the j-th output data line SD j . The control electrode of eight transmission gates arranged at the intersections of the first through eighth input data lines D 0  through D 7  and the j-th through (j+7)-th output data lines are connected to common control lines so that the transmission gates are simultaneously operated. 
     For instance in the case of j=9, the paired control electrodes of eight transmission gates T 0-8 , T 1-9 , T 2-10 , T 3-11 , . . . T 6-14  and T 5-15  arranged at the intersections of the first through eighth data input lines D 0  through D 7  and the ninth through sixteenth output data lines SD 8  through SD 15  are connected to a pair of control lines CD and C&#39;O. The output (regular phase output) of an OR gate G 0  receiving zero shift signals SHLO and SHRO is applied directly to the control CO and is further applied through an inverter I 0  as an inverted phase output to the control line C&#39;O. 
     The arrangement in the cases of j=1 through j=8 and j=10 through j=24 are the same as that described above. In the case of j=10, the eight transmission gates coupled at the intersections of the first through eighth input data lines D 0  through D 7  and the tenth through seventeenth output data lines SD 9  through SD 16  are connected to a pair of common control lines CL 1  and CL&#39; 1 . An instruction signal SHL 1  indicative of a single bit shift to the left is applied directly to the control line CL 1  and through an inverter to the control line CL&#39; 1 . In the case of j=11, the eight transmission gates coupled at the intersections of the input data lines D 0  through D 7  and the eleventh through eighteenth output data lines SD 10  through SD 17  are connected to a pair of common control lines CL 2  and CL&#39; 2 . An instruction signal SHL 2  indicative of two bits shift to the left is applied directly to the control line CL 2  and through an inverter to the control line CL&#39; 2 . The arrangements for the cases of J=12, 13, 14, 15, 16 and 17 (=n-m+1) are similar to those described above. It is evident that it is not always necessary that the arrangements for the cases j=18, 19, 20, . . . and 24 be the same as that described above. 
     In the case of j=8, the eight transmission gates coupled at the intersections of the input data lines D 0  through D 7  and the eighth through fifteenth output data lines SD 7  through SD 14  are connected to a pair of common control lines CR 1  and CR&#39; 1 . As instruction signal SHR 1  indicative of a single bit shift to the right is applied directly to the control line CR 1  and through an inverter to the control line CR&#39; 1 . In the case of j=7, the eight transmission gates coupled at the intersections of the input data lines D 0  through D 7  and the seventh through fourteenth output data lines SD 6  through SD 13  are connected to a pair of common control lines CR 2  and CR&#39; 2 . An instruction signal SHR 2  indicative of two bits shift to the right is applied to the control line CR 2  and through an inverter to the control line CR&#39; 2 . The arrangements in the cases of j=6, 5, 4 and so forth are similar to those described above. 
     It is assumed that, in the circuit thus described that the control signal SHLO is at &#34;1&#34; and the other signals are all at &#34;0&#34;. In this case, the eight transmission gates T 0-8 , T 1-9 , T 2-10 , T 3-11 , T 4-12 , T 5-13 , T 6-14  and T 7-15  are rendered conductive while the remaining transmission gates are rendered non-conductive. Accordingly, the input data D 0  through D 7  is introduced to the output data lines SD 8  through SD 15  without change. In the case also where only the control signal SHRO is at &#34;1&#34;, the outputs are provided similarly as in the above-described case. This state will be referred to as &#34;a zero right and left shift state&#34;. In the case where only the control signal SHL 1  is at &#34;1&#34;, the transmission gates T 0-9 , T 1-10 , T 2-11 , T 3-12 , T 4-13 , T 5-14 , T 6-15  and T 7-16  are rendered conductive. Therefore, the input data D 0  through D 7  is introduced to the output data lines SD 9  through SD 16  without change as a result of which a single bit left shift is effected. Similarly to the above-described case, two bits shift to the left, three bits shift to the left, four bits shift to the left and so forth can be effected instantaneously by raising the levels of the control signals SHL 2 , SHL 3 , SHL 4  and so forth to &#34;1&#34;, respectively. Similarly, a single bit shift to the right, two bits shift to the right and so forth can be effected by raising the levels of the control signals SHR 1 , SHR 2  and so forth, respectively. 
     Multiplication with the bit shift circuit including the transmission gate array as shown in FIG. 2 will be described with reference to FIG. 3. During an initial period t 1 , multiplication data IN applied via a data bus is loaded into a latch circuit 1 and, during the following period t 2 , a shift enable signal is raised to &#34;1&#34; so that, among the multiplier data SHL 0  through SHL 7 , the data SHL 7  is supplied through a gate circuit 2 to a transmission gate array 3. If, in this case, the signal SHL 7  is at &#34;1&#34;, the multiplication data left-shifted by seven bits is provided as the output data of the gate array 3. At the end of the period t 2 , a strobe signal is raised to &#34;1&#34; in response to which the output data is applied through an output gate circuit 4 to a latch circuit 5 and is stored in the latch circuit 5. If the SHL 7  is at &#34;0&#34;, all the output data lines SD 0   through SD 23  from the gate array 3 are at &#34;0&#34; and the data is transferred to the latch circuit 5. 
     During the next period t 3 , the data SHL 6  is supplied to the gate array. At the end of the period t 3 , the strobe signal is raised to &#34;1&#34; and the data is transferred to the output latch circuit 5 while the data provided during the period t 3  is added to the data obtained in the preceding period t 2  in an addition circuit (not shown) connected to the latch circuit 5. During the next period t 4 , the data SHL 5  is applied to the gate array 3 and at the end of the period t 4  the strobe signal is raised to &#34;1&#34; to transfer the data as described above so that the shifted data obtained during the period t 4  is added to the addition results of the data obtained in the preceding period t 3 . Similarly to the above-described cases, the data is processed until completion of the processing of the data SHL 0  in the period t 9  has been accomplished. The addition result obtained at the end of the period t 9  is the desired multiplication result. This data is supplied to the data bus in the final period t 10  to achieve the multiplication in one machine cycle. In order to execute each multiplication operation, the conventional circuit requires about ten to thirty machine cycles. Accordingly, the operational speed of the bit shift circuit using the transmission gate array circuit according to the invention is about ten times as fast as that of the conventional circuit. 
     In the above-described example, C-MOS type transmission gates are employed as the switching elements so that the circuit impedance is considerably small in operation and the degree of integration is improved. However, it goes without saying that other switching elements may be employed. 
     In the example shown in FIG. 2, output data lines are provided for 24 bits so that eight-bit input data can be shifted to the right or left by as much as eight bits. Therefore, in the case of shifting the eight-bit input data left maximally, that is, by eight bits, the bits of the eight-bit input data are provided on the output data lines SD 16  through SD 23 , respectively, and with no further shifting. Accordingly, it is unnecessary for the output line SD 17  to cross the input line D 0  and it is unnecessary for the output line SD 18  to cross the input lines D 0  and D 1  . The last output line SD 23  crosses the input line D 7  only with the result that the degree of integration is improved. It is evident that this same technique can be applicable to the case also where the data is shifted to the right. 
     In the above-described embodiment, the bit shift circuit is of an eight-bit arrangement. However, the invention is not limited thereto or thereby. In addition, the bit shift circuit can be so freely designed so that the data can be shifted to the right or left by as many bits as required.