Background of the Invention
1. Field of the Invention
The present invention relates to tree-type combinatorial logic circuits and more particularly to derivation of the tree-type logic circuits from iterative combinatorial logic circuits which can be described by certain Boolean recurrence formula.
2. Description of the Prior Art
Boolean recurrence formula can be translated into logic circuits by connecting identical, properly designed logic units in cascade; that is, iterative combinatorial logic circuits.
The formulas under consideration are as follows:
and
where (g.sub.K, e.sub.K) are inputs at the k-th stage to be defined depending on applications; (G.sub.K, E.sub.K) are outputs at the k-th stage; and "V" and ".multidot." denote Boolean OR and AND operations, respectively, where k=0, 1, . . . N-1.
Logic circuits such as N bit magnitude comparators, N bit group carry generators and 2 N bit parity prediction circuits for the counter can all be described by the above recurrence formulas.
With such circuits, the delay time of N-staged iterative logic circuits becomes unpractically large as N increases.
It is possible to build look-ahead type circuits to accomplish the above recurrence relations. However, such a look-ahead scheme requires logic gates with large fan-ins as well as complex, irregular interconnection of wires, and are not necessarily the optimum design for the large scale integrated (LSI) circuit applications.
Summary of the Invention
An object of the present invention is to provide a tree-type logic circuit performing a function given by the aforesaid recurrence formula.
A further object is to provide a tree-type logic circuit which operates faster than ripple circuits as the number of inputs increases.
Another object is to provide a tree-type logic circuit which functions as a magnitude comparator depending on the signal to the first input stages.
Still another object is to provide a tree-type logic circuit which may be adapted to function as a carry generator depending on the signal to the first input stage.
Still another object is to provide a tree-type logic circuit which functions as a prediction circuit depending upon the nature of the input signal to the first stage.
Briefly, a preferred embodiment of the present invention includes a logic circuit described by certain recurrence function and achieved by a tree-type logic circuit. In the tree-type logic circuit a plurality of cascading circuits each having similar logic gates can be used. The plurality of cascading circuits are provided with four input terminals and two output terminals and are arranged to build the tree circuit. Although the Boolean functions of each cascading circuit in the tree-type configuration are identical to those of the iterative linear array, indexing will be made different to avoid confusion. More explicitely, when the first signal G.sub.K, a second signal E.sub.K, a third signal g.sub.l and a fourth signal e.sub.l are applied to the four input terminals respectively, each of the cascading circuits perform the functions E.sub.K*l =E.sub.K .multidot.e.sub.l and G.sub.K*l =G.sub.K VE.sub.K .multidot.g.sub.l where * means cocatination of two indices. For example, if K=2, l=3, K*l=23. In some instances, cocatinations of more than two indices are abbreviated by using only the first index and the last index connected by "- sign" if this causes no confusion. For example, 0*1*2*3 can be abbreviated as 0-3. The desired output functions are explicitly presented at the output terminals in the final stage of the tree.
When adapted to function as a magnitude comparator, the first and third signals to the ith cascading circuits in the first stage are generally provided with a function of g.sub.i =a.sub.i b.sub.i, g.sub.i+1 =a.sub.i+1 b.sub.i+1 and the second and fourth signals in the first stage are generally provided with a function e.sub.i =a.sub.i .sym.b.sub.i =a.sub.i b.sub.i Va.sub.i b.sub.i, and e.sub.i+1 =a.sub.i+1 .sym.b.sub.i+1 wherein a.sub.i and b.sub.i are the i-th bits of binary words to be compared and "i" ranging from 0, 2, 4, . . . to an integer not exceeding (N-1)/2.
At the output terminals in the final stage of the tree circuit the fully expanded Boolean functions become
and
in a carry generator, the first and third signals in the first stage are generally provided with a function g.sub.i =a.sub.i .multidot.b.sub.i, g.sub.i+1 =a.sub.i+1 .multidot.b.sub.i+1 and the second and fourth signals in the first stage are generally provided with a function e.sub.i =a.sub.i .sym.b.sub.i and e.sub.i+1 =a.sub.i+1 .sym.b.sub.i+1. Finally, a carry generator signal will be given by the Boolean function G and an "all-propagate" signal will be given by the function E.
In a parity prediction circuit, data bits are supplied to the circuit with alternating polarity, starting with b.sub.N-1, where b.sub.N-1 is the least significant bit of the data bits. The parity of the original data bits will be flipped only when the function F in the following form becomes 1;
an "all even bits 1" signal will be given by the function E.
The tree is not balanced in general, i.e., not fully symmetric, unless the number of inputs are some power of 2. A method of finding the shape of unbalanced trees may be described as follows. As for the magnitude comparator and the carry generator, the input words may be appended with trailing zeros until the total number of bits becomes some power of 2 for the first time, for example 2.sup..gamma.. Then all the 2.sup..gamma. inputs are fed into the tree logic circuits of the appropriate size and unnecessary logic blocks are eliminated to obtain an unbalanced tree circuit. For the parity prediction circuit, the inputs are b.sub.N-1, b.sub.N-2, . . . b.sub.1, b.sub.0 for the N-bit counter. The polarity of every other bit is flipped starting b.sub.N-1, before they are fed into the tree logic and b.sub.0 is replaced by 0 if N is even. These modified inputs are appended with leading zeros until the total number of bits becomes some power of 2, for example 2.sup..gamma.. Then all the 2.sup..gamma. inputs are fed into the tree logic circuit of the appropriate size, and unnecessary logic blocks are eliminated to obtain an unbalanced tree logic circuit.
The aforesaid parity prediction circuit can be used either as the parity generator for the +1 counters, or can be used to check the operations of the +1 counters by comparing the predicted parity with the actually generated parity at the output of the counters.
The aforesaid tree circuit has a logarithmically increasing gate delay as the number of input bits increases so that it can operate very fast as compared with an iterative circuit designed to perform the same function.
Furthermore, the tree circuit can be built with a plurality of single circuit units of standard terminal arrangement. These high speed circuits and simplicity of circuit connection are highly appreciated in practical applications.
These and other objects and advantages of the present invention will no doubt become apparent after a reading of the following detailed description of the preferred embodiments which are illustrated in the several figures of the drawing.
In the Drawing
FIG. 1 is a functional block diagram of an eight-bit magnitude comparator in accordance with the present invention;
FIG. 2 is an alternative circuit for a one-bit comparator used in FIG. 1;
FIG. 3 is a further alternative circuit for a one-bit comparator used in FIG. 1;
FIG. 4 is an alternative circuit for a cascading circuit used in FIG. 1;
FIG. 5 is a functional block diagram of a seven-bit carry generator in accordance with the present invention;
FIG. 6 is a functional block diagram of a 31-bit carry generator in accordance with the present invention;
FIG. 7 is a functional block diagram of a 32-bit parity prediction circuit in accordance with the present invention;
FIG. 8 is a functional block diagram of a five-bit parity prediction circuit in accordance with the present invention; and
FIG. 9 is a functional block diagram of a six-bit parity prediction circuit in accordance with the present invention.
Detailed Description of the Preferred Embodiment
FIG. 1 is a functional block diagram of an eight-bit magnitude comparator referred to by the general reference character 1, and incorporating the present invention. The comparator 1 is adapted to receive two binary input words A and B comprised of bits a.sub.0 through a.sub.7 and b.sub.0 through b.sub.7, respectively, where a.sub.0 and b.sub.0 are the most significant bits. The comparator enables one of two outputs (G or E) indicating whether A is greater than B (A>B) or A is equal to B (A=B). If A is less than B, no output is enabled.
The comparator 1 is comprised of eight identical one-bit comparators, 2-9 and seven identical cascading circuits, 10-16. The cascading circuits 10-16 are arranged in three stages in a tree-type arrangement.
Each of the one-bit comparators 2-9, is comprised of two NAND gates 20 and 21, one inverter gate 22 and one AND-OR-inverter gate 23 which are obtainable in both bipolar and metal oxide semiconductor (MOS) devices including complementary MOS (CMOS). Each of the one-bit comparators, 2-9, generate two output signals g.sub.i and e.sub.i with g.sub.0 and e.sub.0, . . . , g.sub.7 and e.sub.7 being the pair of output bits for the comparators, 2-9, respectively.
Assuming that the arbitrary bits of input to the comparators, 2-9, are a and b, the outputs g and e of one bit comparators may be basically expressed as
and
Therefore the outputs of G and E of the comparator 16 in the final stage of the tree circuit are expressed as
and
For this purpose, the NAND gate 20 of each comparator generates ab, the NAND gate 21 generates a ab=ab, and the inverter 22 generates ab resulting in g. The AND-OR-INVERTER 23 also receives the ab signal and generates a signal of a.multidot.ab V b ab which transforms into abV a b resulting in e.
Each of the cascading circuits 10-16 in the cascading stage, include three NAND gates 24 to 26 and two inverter gates 27 and 28, respectively. The cascading circuit 10 receives the outputs g.sub.0, g.sub.1 and e.sub.0, e.sub.1 of the pair of one-bit comparators 10 and 11. The NAND gate 24 is supplied the outputs g.sub.0 and e.sub.0 g.sub.1 and generates an output of g.sub.01 =g.sub.0 .multidot.e.sub.0 g.sub.1 which is transformed into g.sub.01 =g.sub.0 Ve.sub.0 g.sub.1. The inverter gate 28 generates an output of e.sub.01. Similarly the cascading circuit 11 generates outputs of g.sub.23 and e.sub.23 which are expressed as g.sub.23 =g.sub.2 Ve.sub.2 g.sub.3 and e.sub.23 =e.sub.2 e.sub.3, respectively. The cascading circuit 12 generates outputs of g.sub.45 and e.sub.45 expressed as
and
The cascading circuit 13 generates outputs of g.sub.67 and g.sub.67 expressed as
and
The cascading circuit 14 in the second cascading stage generates outputs of g.sub.0123 and e.sub.0123 which are expressed as
and
The cascading circuit 15 in the second cascading stage generates outputs of g.sub.4567 and e.sub.4567 which are expressed as
and
The cascading circuit 16 in the third cascading stage generates outputs of g.sub.0-7 and e.sub.0-7 which are expressed as follows:
Thus, G=g.sub.0-7.
Thus, E=e.sub.0-7.
Therefore, the eight-bit magnitude comparator is built by eight one-bit comparators 2-9 generating two outputs g and e, four cascading circuits 10-13 in the first stage each of which is provided for comparing the outputs g and e of only two one-bit comparators, two cascading circuits 14 and 15 in the second stage each of which is provided for comparing the outputs of only two cascading circuits in the first cascading stage and one cascading circuit 16 in the third stage which is provided for comparing the outputs of only two cascading circuits in the second cascading stage.
From the above teachings it is apparent that a four-bit magnitude comparator may be constructed with four one-bit magnitude comparators, two cascading circuits, in the first stage, and one cascading circuit in the second stage.
A sixteen-bit magnitude comparator can be built using two sets of the eight-bit comparator illustrated by FIG. 1 and adding a cascading circuit to form a fourth cascading stage to the circuits 16.
FIG. 1 illustrates one embodiment for the one-bit comparators 2-8. FIGS. 2 and 3 illustrate alternative embodiments.
In FIG. 2 the comparator referred to as 2'; includes NAND gates 30, 31, 32 and 33, and two inverter gates 34 and 35. The gate 30 is adopted to receive the input signals a and b, the gate 31 to receive the signal a and output of gate 30, the gate 32 to receive the signal b and the output of the gate 30, the inverter 34 to receive the output of gate 31, the gate 33 to receive the output of gates 31 and 32 and the inverter 35 to receive the output of the gate 33 such that the inverters 34 and 35 provide the signals G and E, respectively.
Thus, in operation, the NAND gate 30 receives the signals a and b and generates ab. The NAND gate 31 receives the signal a and ab to generate aab or ab. The NAND gate 32 receives the signal b and ab to generate bab or ba. The inverter 34 receives ab and generates ab resulting in G. The NAND gate 33 receives ab and ba to generate ab V ab which the inverter 35 responds to and generates ab V ab which transforms into abVab resulting in the signal E.
In FIG. 3 a comparator 2" includes three inverter gates 34, 35 and 36 and four NAND gates 37, 38, 39 and 40. The inverter 34 and NAND gates 37 and 38 receive the input signal a, while the inverter 35 and NAND gates 38 and 39 receive the input signal b. The NAND gate 37 also receives the output of the inverter 35 and the NAND gate 39 also receives the output of the inverter 34. The inverter 36 receives the output of the NAND gate 37 and the NAND gate 40 receives the output of the NAND gate 38 and 39. The output of the inverter 36 is the G signal and the output of the NAND gate 40 is the E signal.
Thus, in operation, the inverter 34 receives the signal a and generates a. The inverter 35 receives the signal b and generates b. The NAND gate 37 receives the signal a and b and generates ab which the inverter 36 receives and generates ab resulting in signal G. The NAND gate 38 receives the signals a and b and generates ab. The NAND gate 39 receives the signals a and b and generates a b. The NAND gate 40 receives signals ab and a b and generates ab V a b resulting in signal E.
FIG. 4 illustrates an alternative embodiment, referred to by the general reference character 10', for the cascading circuits 10-16. The network 10' includes two AND gates 42 and 44 and an OR gate 46. The AND gates 42 and 44 each receive the e.sub.0 signal from the one-bit comparator 2. The AND gate 44 also receives the signal e.sub.1 from the one-bit comparator 3 while the AND gate 42 receives the g.sub.1 signal from the one-bit comparator 3. The two inputs to the OR gate 46 are the g.sub.0 signal of the one-bit comparator 2 and the output of the AND gate 42. The signal g.sub.01 is provided at the output of the OR gate 46 and the signal e.sub.01 is provided at the output of the AND gate 44. Each of the cascading circuits 10-16 may be replaced with a cascade circuit 10' and connected as illustrated in FIG. 1.
FIG. 5 shows a functional block diagram of a seven-bit carry generator referred to by the general reference character 50 and incorporating the present invention. The generator 50 is adapted to receive two binary input words A and B comprising a.sub.0 to a.sub.6 and b.sub.0 to b.sub.6 respectively, where a.sub.0 and b.sub.0 are the most significant bits, to be processed. The two binary words A and B, "carry in" signal and a constant signal "1" are supplied to the carry generator 50 which produces two outputs, namely a carry-generate signal G and a carry-propagate signal P, indicating whether a carry signal is generated in the carry generator itself or the carry signal is generated on a condition that the "carry in" signal is logical 1.
The carry generator 50 is comprised of seven one-bit carry generators 51-57 and the seven cascading circuits 10-16 arranged in the three stages. The circuits 51-57 and 10-16 are connected in the tree configuration.
Each of the one-bit carry generators 51 to 57 includes four NAND gates 60-63 and one inverter 64 arranged to generate outputs G.sub.0 -G.sub.6 and P.sub.0 -P.sub.6. The NAND gate 60 receives the a.sub.i and b.sub.i signals. The output of the gate 60 is connected to the NAND gates 61 and 62 and the inverter 64. The NAND gate 61 also receives the signal a.sub.i and the NAND gate 62 also receives the signal b.sub.i. The NAND gate 63 receives the outputs of the NAND gates 61 and 62. The signal G.sub.i is reflected at the output of the inverter 64 and the signal P.sub.i is reflected at the output of the NAND gate 63.
The outputs G.sub.i and P.sub.i are expressed as follows, using arbitrary bits of input a.sub.i and b.sub.i.
and
Therefore, the carry generate signal G and carry propagate signal P may be expressed as follows:
and
in operation of the one-bit carry generators 51-57, the NAND gate 60 generates ab and the inverter gate 64 generates the required output a.multidot.b. The three NAND gates 61 to 63 are supplied with the ab signal and generate the output a.multidot.ab.multidot.ab.multidot.b which is transformed into abVab.
It should be realized that the one-bit carry generators 51-57 shown in FIG. 5 are representative and other equivalent circuits may be used for the purpose.
The illustrated cascading circuits in FIG. 5 are exactly the same as the cascading circuits 10-16 of the eight-bit magnitude comparator of FIG. 1 so that the operation of the cascading circuit 10-16 of FIG. 1 can be applied to the seven-bit carry generator 50. For instance, the cascading circuit 10 in FIG. 5 generate the outputs of G.sub.01 and P.sub.01 which are expressed as follows:
and
similarly, the cascading circuit 11 generates the output of G.sub.23 and P.sub.23 which are expressed as follows:
and
the cascading circuit 12 generates the outputs of G.sub.45 and P.sub.45 which are expressed as follows:
and
The cascading circuit 13 generates the outputs of G.sub.67 and P.sub.67 which are expressed as follows:
and
the cascading circuit 14 generates the outputs of G.sub.0-3 and P.sub.0-3 which are expressed as follows:
and
the cascading circuit 15 generates the outputs of G.sub.4-7 and P.sub.4-7 which are expressed as follows:
and
finally the cascading circuit 16 generates the outputs G.sub.0-7 and P.sub.0-7 which are expressed as follows:
and
It will be seen from FIG. 5 that a three-bit carry generator can be constructed with three one-bit carry generators, e.g., 55, 56 and 57 and three cascading circuits 12, 13 and 15.
An N-bit carry generator can be built by using N one-bit carry generators and cascading circuits. An N-bit carry generator built by using a plurality of unit carry generators is shown in FIG. 6 which illustrates a functional block diagram of a 31-bit carry generator using four carry generators 50. Each of the unit carry generators 50 includes the cascading circuit 16 in the third stage. Only the cascading circuit 16 is shown in FIG. 6 for the sake of simplicity. The carry generators 50 are identical to the seven-bit carry generator 50 shown in FIG. 5; each carry generator 50 including eight one-bit carry generators to receive a pair of eight-bit input signals as a.sub.0 -a.sub.7 and b.sub.0 -b.sub.7. The outputs of the carry generators 50 are supplied to a pair of cascading circuits 70 and 72. Each of the cascading circuits 70 and 72 are provided for two of the carry generators 50. A cascading circuit 74 is provided for generating the final outputs G and P in the final cascading stage. The illustrated cascading circuits 70, 72 and 74 are structurally the same as the cascading circuits 10-16 of FIG. 1.
FIG. 7 shows a functional block diagram of a thirty-two bit parity prediction circuit, referred to by the general reference character 80 incorporating the present invention. The circuit 80 is adapted to receive a binary input word B comprised of b.sub.0 to b.sub.31 where b.sub.0 is the most significant bit. The parity prediction circuit 80 is adapted to generate a "flip-parity" signal Pf and an "all-even-bit-1's" signal A1. The parity prediction circuit is a circuit for generating the parity flip signal "Pf" from the input word B without using a result of N-bit binary counter.
Referring to the following table, the data bits b.sub.0 -b.sub.31 of the input word B, are listed in a particular arrangement in the left column together with the corresponding parity of the input word. The new parity P.sub.N for the incremented data is listed in the right column. The change of the parity is designated by asterisks in the intermediate column.
It is seen that the parity flip is required when the number of consecutive "1"'s counted from the least significant bit of the data is even, including 0. In addition, if the data bits b.sub.0 to b.sub.31 are all "1," the parity flip is not required. Therefore the Boolean function F.sub.31, which gives "1" when the number of the consecutive "1"'s is even, can be expressed as follows:
Applying a Boolean identity (avab=avb) repetitively, the above equation can be reduced to the following:
It is seen that this expression is equivalent to the aforesaid expression for G by replacing b.sub.2K+1 with g.sub.15-k and b.sub.2K with e.sub.15-k, where K=0, . . . , 15. Therefore, the function F.sub.31 may be constructed by using the cascading circuits 50 and the alternating inputs b.sub.2K+1 and b.sub.2K. The parity prediction circuit 80 of FIG. 7 has eight logic circuits 81-88 in the first stage to which 32 bit signals b.sub.0 -b.sub.31 of normal polarity may be received. The cascading circuits 81-88 of the first cascade stage, have been transformed from the cascading circuits 50 which originally had alternating inputs b.sub.2K+1 and b.sub.2K, by merely changing the connections to one inverter.
The seven cascading circuits 50 are required to construct the 32-bit parity prediction circuit in order to form the tree circuit.
When a parity prediction circuit for a counter with odd number of bits is to be constructed by using the cascading circuits, logical "0" signals are supplied to the rest of the inputs. For example, assume a five-bit case wherein the binary word has bits b.sub.0 -b.sub.4. The Boolean function F.sub.4 is expressed as follows:
FIG. 8 illustrates a five-bit parity prediction circuit referred to by the general reference character 100. Two cascading circuits 87' and 88' are tied to a cascade circuit 50 with the circuit 87' receiving bits b.sub.1, . . . b.sub.4 and the circuit 88 receiving the bit b.sub.0 and three "0" signals.
When a parity prediction circuit for even number of bits but not a power of 2 is to be constructed by using the cascading circuits, the most significant bit b.sub.0 is not supplied and a "0" signal is supplied instead of the b.sub.0 bit. For example, assume a six-bit case. The Boolean function F.sub.5 will be expressed as follows:
FIG. 9 illustrates a six-bit parity prediction circuit referred to by the general reference character 120. The circuit 87" receives the bits b.sub.2, . . . b.sub.5 and the circuit 88" receives the b.sub.1 and three "0"'s.
While the invention has been particularly shown and described with reference to certain preferred embodiments it will be understood by those skilled in the art that various alternatives and modifications in form and detail may be made therein. Accordingly, it is intended that the following claims cover all such alternatives and modifications as fall within the true spirit and scope of the invention.