MAJORITY CIRCUIT

Abstract: The majority circuit has an (n+1)/2-notation counter cir­ cuit of a comprising a plurality of cascade-connected binary counters (31), (32) and (33). An odd number of n-bit serial data (D in ) are counted by the counter circuit, and an output (D out ) of the binary counter (33) of the last stage is taken out as a major­ ity output of the majority circuit.

Description: The present invention relates to a majority circuit to determine a majority of the level of a digital signal of a plurality of serial bits. In the field of digital circuits, majority circuits to determine a majority of the level ("1" level or "0" level) of a digital signal of a plurality of serial bits are widely used. Fig. 1 shows an example of conventional majority circuits. The majority circuit receives a serial digital signal D in of three bits and determines a majority logic of the signal. The majority circuit comprises one-bit shift registers 1 to 3 which are cascade connected and a gate circuit 4. Gate circuit 4 comprises NAND gates 5 to 8. Three-bit input serial data D in is inputted to shift register 1 of the first stage. Each of shift registers 1 to 3 shifts the input data by one bit synchronously with a clock signal. Output signals of shift registers 1 to 3 are inputted to NAND gates 5 to 7 in gate circuit 4. Output signals of NAND gates 5 to 7 are inputted to NAND gate 8 and an output signal of NAND gate 8 becomes a majority output D out . In the majority circuit of Fig. 1, the one-bit shift registers equal to the number of input serial bits are cascade connected to constitute a counter circuit, the input serial bits are converted to parallel bits, and the parallel bit data is inputted to gate circuit 4, thereby obtaining a majority output. The circuit arrangement of Fig. 1 requires the 1-bit shift registers equal to the number of input bits. Therefore, as the number "n" of input bits increases, the number of shift registers required also increases. Further, the number of NAND gates constituting gate circuit 4 also increases. For example, a majority circuit for seven input bits constituted using the circuit arrangement shown in Fig. 1 has a circuit arrangement as shown in Fig. 2. As shown in Fig. 2, seven shift registers 11 to 17 are needed as shift registers constituting a counter circuit, and thirty-five 4-input NAND gates 19 and one 35-input NAND gate 20 are needed as gate logic elements constituting a gate circuit. As mentioned above, in the conventional circuit arrangement as shown in Fig. 1, the number of logic elements required remarkably increases with an increase in number of input bits. Moreover, the wirings among those elements also become complicated in association with the increase in number of elements. Consequently, there is a problem such that the size of the required chip enlarges. Prior art document JP-A-55-115732 discloses a majority circuit comprising an input terminal to which a 3-bit serial data is inputted, a counter circuit for counting the serial data inputted to the input terminal, an output terminal from which a majority output of the serial data is outputted, and a control terminal to which a control signal is inputted. Furthermore, the counter circuit comprises cascade connected two binary counters which are both of the reset type. It is an object of the invention to provide a majority circuit which determines the majority logic of a serial data of bits of the number other than 2 k -1 e.g. the serial data of five bits. To solve this object the present invention provides a majority circuit as stated in claim 1. This invention can be more fuly understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a diagram showing a conventional majority circuit; Fig. 2 is a diagram showing another conventional majority circuit; Fig. 3 is a diagram showing a majority circuit; Figs. 4 and 5 are diagrams showing serial data which is inputted to the majority circuit of Fig. 3, respectively; Fig. 6 is a diagram showing a further majority circuit; Fig. 7 is a detailed circuit diagram of a binary counter in the majority circuits of Figs. 3 and 6; Figs. 8(a), 8(b), 8(c), 8(d) and 8(e) are time charts of signals of respective sections of the binary counter shown in Fig. 7; Fig. 9 is a diagram showing a majority circuit according to an embodiment of the invention; Fig. 10 is a detailed circuit diagram of a binary counter in the majority circuit of Fig. 9; Fig. 11 is a diagram showing a further majority circuit Fig. 12 is a detailed circuit diagram of a binary counter in the majority circuit of Fig. 11; Figs. 13(a), 13(b), 13(c), 13(d), 13(e) and 13(f) are time charts of signals of respective sections of the majority circuit shown in Fig. 11; and Figs. 14(a), 14(b), 14(c), 14(d), 14(e) and 14(f) are time charts of signals of respective sections of the majority circuit shown in Fig. 11. Fig. 3 shows a majority circuit which is for seven input bits. The majority circuit shown in Fig. 3 comprises a quaternary counter circuit comprising three binary counters 31 to 33 which are cascade connected. An input of binary counter 31 of the first stage is connected to an input terminal 35 of the majority circuit. Input data D in is inputted to input terminal 35. An output terminal of binary counter 33 of the last stage is connected to an output terminal 34 of the majority circuit. Majority output D out is taken out from the output terminal 34. Reset terminals R of binary counters 31 to 33 are connected to a reset terminal 36, respectively. A reset signal RS is inputted to the reset terminal 36. In such an arrangement, reset signal RS of a "1" level is first inputted to input terminal 36, so that binary counters; 31 to 33 are respectively reset and outputs of binary counters 31 to 33 become a "0" level (i.e., 0, 0, 0), respectively. Then, serial data D in whose majority is to be determined is inputted. As shown in Fig. 4, it is now assumed that three bits of the fourth, sixth, and seventh bits of input serial data D in are at a "0" level and other four bits are at a "1" level. The majority logic of the serial data D in is at a "1" level. After all seven bits of serial data D in have been inputted, the output signals of binary counters 31 and 32 become a "0" level and the output signal of binary counter 33 becomes a "1" level (i.e., 0, 0, 1). Majority output D out of the majority circuit of Fig. 3 is the output of binary counter 33, so that majority output D out of serial data D in becomes a "1" level. The case where serial data D in shown in Fig. 5 was inputted will then be considered. In this case as well, before this serial data D in is inputted, reset signal RS of a "1" level is inputted to input terminal 36. Thus, binary counters 31 to 33 are respectively reset and the outputs of binary counters 31 to 33 are set to a "0" level, respectively. Then, serial data D in of Fig. 5 whose majority is to be determined is inputted. As shown in Fig. 5, three bits of the second, fourth, and sixth bits of serial data D in are at a "1" level and other four bits are at a "0" level. The majority logic of the serial data D in becomes a "0" level. After all seven bits of serial data D in have been inputted, the output signals of binary counters 31 and 32 become a "1" level and the output signal of binary counter 33 becomes a "0" level (i.e., 1, 1, 0). Since the majority output of the majority circuit of Fig. 1 is the output of binary counter 33, majority output D out of serial data D in becomes a "0" level. In this manner, in the majority circuit of Fig. 3, the output signal of binary counter 33 of the last stage of the quaternary counter circuit is taken out as majority output D out . As will be obvious from this majority circuit in order to get the majority logic of serial data Din of n bits (n is an odd number of three or more), k binary counters (n = 2 k -1) are cascade connected to form a modulo (n+1) counter circuit and an output signal of the counter of the last stage is taken out as majority signal D out . Thus, the circuit arrangement can be simplified. Therefore, when this majority circuit is manufactured is a form of an IC (integrated circuit), the chip size can be miniaturized. Fig. 6 shows a majority circuit for the input serial data of fifteen bits. In the circuit of Fig. 6, binary counter 37 is added to the circuit of Fig. 3. The majority circuit shown in Fig. 6 comprises a modulo (or notation) 16 counter circuit four binary counters 31 to 33 and 37 which are cascade connected. An input of binary counter 31 of the first stage is connected to an input terminal 35 of the majority circuit. Input data D in is inputted to input terminal 35. An output terminal of binary counter 37 of the last stage is connected to an output terminal 34 of the majority circuit. Majority output D out is taken out from the output terminal 34. Reset terminals R of binary counters 31 to 33 and 37 are connected to a reset terminal 36, respectively. A reset signal RS is inputted to the reset terminal 36. In the arrangement of Fig. 6, reset signal RS of a "1" level is first inputted to input terminal 36, so that binary counters 31 to 33 and 37 are respectively reset and outputs of binary counters 31 to 33 and 37 become a "0" level (i.e., 0, 0, 0, 0), respectively. Then, serial data D in whose majority is to be determined is inputted. It is now assumed that seven those of the fifteen bits of input serial data D in are at a "0" level and other eight bits are at a "1" level. The majority logic of the serial data D in is at a "1" level. After all fifteen bits of serial data D in have been inputted, the output signals of binary counters 31, 32 and 33 become a "0" level and the output signal of binary counter 37 becomes a "1" level (i.e., 0, 0, 0, 1). Majority output D out of the majority circuit of Fig. 6 is the output of binary counter 37, so that majority output D out of serial data D in becomes a "1" level. It is assumed that seven those of the fifteen bits of serial data D in are at a "1" level and other eight bits are at a "0" level. The majority logic of the serial data Din becomes a "0" level. After all fifteen bits of serial data D in have been inputted, the output signals of binary counters 31, 32 and 33 become a "1" level and the output signal of binary counter 37 becomes a "0" level (i.e., 1, 1, 1, 0). Since the majority output of the majority circuit of Fig. 6 is the output of binary counter 37, majority output D out of serial data D in becomes a "0" level. In this manner, in the majority circuit of Fig. 6, the output signal of binary counter 37 of the last stage circuit is taken out as majority output D out . Fig. 7 shows a practical arrangement of binary counter 31 in the majority circuits of Figs. 3 and 6. The arrangements of the other binary counters are also substantially the same as that of binary counter 31. In the binary counter of Fig. 7, input serial data D in is inputted, through input terminal 35, to one input terminal of a two-input AND gate 41 and to one input terminal of a two-input NOR gate 42. An output signal S1 of AND gate 41 and an output signal S2 of NOR gate 42 are inputted to input terminals of two-input NOR gate 43. Output signal S1 of AND gate 41 is also applied to binary counter 32 of the next stage as carry signal OUT1. An output signal S3 of NOR gate 43 is inputted to a clocked inverter 44. Clocked inverter 44 is controlled by a clock signal  (Fig. 8(b)) and operates for the period of time when clock signal  is at a "1" level. An output signal S4 of clocked inverter 44 and reset signal RS are inputted to a two-input NOR gate 45. An input terminal of a clocked inverter 46 is connected to an output terminal of NOR gate 45 and an output terminal of inverter 46 is connected to an output terminal of clocked inverter 44. Clocked inverter 46 is controlled by a clock signal  and operates for the period of time when clock signal  (Fig. 8(a)) is at a "1" level. An output signal S5 of NOR gate 45 is inputted to a clocked inverter 47. Clocked inverter 47 is also controlled by clock signal  and operates for the period of time when clock signal  is at a "1" level. An output signal S6 of clocked inverter 47 and reset signal RS are inputted to a two-input NOR gate 48. An input terminal of a clocked inverter 49 is connected to an output terminal of NOR gate 48 and an output terminal of inverter 49 is connected to an output terminal of clocked inverter 47. Clocked inverter 49 is controlled by clock signal  and operates for the period of time when clock signal  is at a "1" level. An output signal S7 of NOR gate 48 is inputted to the other input terminals of AND gate 41 and NOR gate 42. Output signal S7 of NOR gate 48 constitutes majority output OUT1 in the case where binary counter 31 is considered to be the counter of the last stage. Clocked inverter 44, NOR gate 45, and clocked inverter 46 constitute a half-bit shift circuit 51 to shift output signal S3 of NOR gate 43 by a half bit of clock signal . Clocked inverter 47, NOR gate 48, and clocked inverter 49 constitute a half-bit shift circuit 52 to shift output signal S5 of half-bit shift circuit 51 by half bit of clock signal  . Half-bit shift circuits 51 and 52 constitute a one-bit shift circuit. In the binary counter of the arrangement of Fig. 7, reset signal RS is first set at a "1" level, so that the output signals of NOR gates 45 and 48, namely, output signals S5 and S7 of half-bit shift circuits 51 and 52 become a "0" level. Thus, output signals OUT1 (Fig. 8(e)) and OUT2 (Fig. 8 (d)) are set at a "0" level irrespective of input signal D in (Fig. 8(c)). Then, reset signal RS is set at a "0" level. In this state, when input signal D in as shown in Fig. 8C is inputted, output signal OUT2 becomes a signal as shown in Fig. 8D which changes in response to the leading edge of clock signal . The majority circuits shown in Figs. 3 and 6 intend to determine the majority logics of the serial data of seven bits and fifteen bits, respectively. In other words, the majority circuits shown in Figs. 3 and 6 fundamentally intend to determine the majority logics for the serial data of (2 k -1) bits, for example, three, seven, fifteen, ... bits, but cannot determine the majority logic of a serial data of bits of the number other than (2 k -1), e.g., the serial data of five bits. Fig. 9 is a diagram according to an embodiment of the present invention to obtain a majority output of the serial data of five bits. A different point of the embodiment of Fig. 9 from the majority circuit of Fig. 3 is that binary counter 31 with reset terminals R is replaced by a binary counter 38 with a set terminal S. Further, an inverter 39 is provided between reset terminal 36 and set terminal S of binary counter 38. Reset signal RS is inputted to set terminal S of binary counter 38 through inverter 39. When a reset signal RS of a "0" level is inputted to reset terminal 36, then a set signal of "1" level is inputted to set terminal S of binary counter 38 to set binary counter 38. Then, an output signal OUT1 (carry signal) of binary counter 38 to a binary counter 32 of the next stage becomes a "1" level. While, the reset signal RS of "0" level is inputted to other binary counters 32 and 33 to reset binary counters 32 and 33. Then, output signals (carry signals) of binary counters 32 and 33 become "0" level. Therefore, output signals of binary counters 38, 32 and 33 are (1, 0, 0). Therefore, in the majority circuit of the embodiment of Fig. 9, when three bits of the input signal of a "1" level are inputted, the output signal of binary counter 33 of the last stage becomes a "1" level. Thus the majority circuit of Fig. 9 functions to determine a majority of a five-bit input signal. Fig. 10 shows a detailed circuit arrangement of binary counter 38 in the majority circuit of Fig. 9. Binary counter 38 of Fig. 10 uses NAND gates 65 and 68 in place of NOR gates 45 and 48 in the binary counter shown in Fig. 7. In the binary counter 38 of Fig. 10, input serial data D in is inputted, through input terminal 35, to one input terminal of a two-input AND gate 41 and to one input terminal of a two-input NOR gate 42. An output signal S1 of AND gate 41 and an output signal S2 of NOR gate 42 are inputted to input terminals of two-input NOR gate 43. Output signal S1 of AND gate 41 is also applied to binary counter 32 of the next stage as carry signal OUT1. An output signal S3 of NOR gate 43 is inputted to a clocked inverter 44. Clocked inverter 44 is controlled by a clock signal  (Fig. 8(b)) and operates for the period of time when clock signal  is at a "1" level. An output signal S4 of clocked inverter 44 and inverted reset signal RS are inputted to a two-input NAND gate 65. An input terminal of a clocked inverter 46 is connected to an output terminal of NAND gate 65 and an output terminal of inverter 46 is connected to an output terminal of clocked inverter 44. Clocked inverter 46 is controlled by a clock signal  and operates for the period of time when clock signal  (Fig. 8(a)) is at a "1" level. An output signal S5 of NAND gate 65 is inputted to a clocked inverter 47. Clocked inverter 47 is also controlled by clock signal  and operates for the period of time when clock signal  is at a "1" level. An output signal S 6 of clocked inverter 47 and inverted reset signal RS are inputted to a two-input NAND gate 68. An input terminal of a clocked inverter 49 is connected to an output terminal of NAND gate 68 and an output terminal of inverter 49 is connected to an output terminal of clocked inverter 47. Clocked inverter 49 is controlled by clock signal  and operates for the period of time when clock signal  is at a "1" level. An output signal S7 of NAND gate 68 is inputted to the other input terminals of AND gate 41 and NOR gate 42. Output signal S7 of NAND gate 68 constitutes majority output OUT₁ in the case where binary counter 38 is considered to be the counter 33 of the last stage. Clocked inverter 44, NAND gate 65, and clocked inverter 46 constitute a half-bit shift circuit 51 to shift output signal S3 of NOR gate 43 by a half bit of clock signal . Clocked inverter 47, NAND gate 68, and clocked inverter 49 constitute a half-bit shift circuit 52 to shift output signal S5 of half-bit shift circuit 51 by half bit of clock signal  . Half-bit shift circuits 51 and 52 constitute a one-bit shift circuit. In binary counter 38 of Fig. 10, when reset signal RS of a "1" level is inputted, a signal of a "0" level is inputted to NAND gates 65 and 68 through inverter 39. Thus, output signals of NAND gates 65 and 68 become a "1" level, respectively. The embodiment of Fig. 9 is used for a 5-bit input. However, by properly selecting the number of stages of the binary counters which are cascade connected and the stage using the binary counter with the set function, it is possible to provide the majority circuit which can determine a majority output of other input data of bits of an odd number other than (2 k -1). For example, the majority circuit for a 13-bit input can be provided by replacing binary counter 31 of the first stage in the majority circuit of Fig. 6 by a binary counter with the set function. Fig. 11 shows a further majority circuit. The majority circuit of Fig. 11 is intended for seven input serial bits. The majority circuit comprises three binary counters 61, 62 and 63 cascade connected. Binary counters 61 to 63 have reset terminal R. Reset signal RS is inputted to reset terminals RS of binary counters 61 to 63. Input serial seven bits are inputted to binary counters 61 to 63. In the majority circuit Fig. 11, input serial bits are used as clock signals ,  . Input terminal IN of binary counter 61 at the first stage is connected to a predetermined carry signal. Input terminals IN of binary counters 62, 63 are connected to output signals (carry signal) OUT1 of binary counters 61 and 62, respectively. Fig. 12 shows a detailed circuit of binary counter 61. The circuit of Fig. 12 is different from the circuit of Fig. 7 is that clocked inverters 44 and 49 are controlled, not by clock pulse  , but by phase inverted input serial bits signal D in . Also, clock inverter 46 and 47 are controlled, not by clock pulse , but by input serial bits signal D in . Clocked inverters 44 and 49 operate when phase inverted bits signal D in is at a "1" level. Clocked inverters 46 and 47 operate when bits signal D in is at a "1" level. Others are substantially the same as those in the circuit as shown in Fig. 7. Figs. 13(a) to 13(f) show time charts of signals at the respective portions of the circuit of Fig. 11 appearing when input signal Din have four "1" level bits, as shown in Fig. 13(a). Reference letters A, B, C, D and E are commonly used in Fig. 11 and Figs. 13(b) to 13(f). As shown in Fig. 13(f), majority output E has "1" level, when the fourth bit of "1" level is inputted. Figs. 14(a) to 14(f) show time charts of signals at the respective portions of the circuit of Fig. 11 appearing when input signal D in have three "1" level bits, as shown in Fig. 14(a). Reference letters A, B, C, D and E are commonly used in Fig. 11 and Figs. 14(b) to 14(f). As shown in Fig. 14(f), majority output E has "0" level. As clearly understood from the above, in a majority circuit, in order to get the majority logic of serial data D in of n bits (n is an add number of three or more), k binary counters (n = 2 k -1) are cascade connected to form a modulo (n+1)/2 counter circuit and an output signal of the counter of the last stage is taken out as majority signal D out . Thus, it is possible to provide a majority circuit in which a circuit arrangement is simple and which is suitable to produce an integrated circuit.

Claims: A majority circuit comprising: an input terminal (35) to which an odd number of n-bit serial data (Din) is inputted; a counter circuit (28, 32, 33) comprising a plurality of cascade connected binary counters (38, 32, 33) for counting the logic 1 of the serial data inputted to said input terminal (35); an output terminal (34) connected to the most significant bit binary counter from which a majority output (Dout) of said serial data is outputted; and a control terminal (36) to which a control signal (RS) is inputted; characterized in that: at least one of the binary counters of said counter circuit (38, 32, 33) has a reset terminal (R), and is reset by the control signal (RS), and at least another one of the binary counters has a set terminal (S), and is set by an inverted signal of the control signal ( RS ), so that after counting of at least (n+1)/2 logical 1 data the output terminal provides a majority signal A majority circuit according to claim 1, characterized by further comprising: an inverter circuit (39) for inverting the level of said control signal (RS) to generate said inverted signal. A majority circuit according to claim 1, characterized in that said counter circuit (38, 32, 33) comprises three binary counters (38, 32, 33) of first, second and third stages, the binary counter (38) of the first stage has the set terminal (S), and is set by said inverted signal of the control signal, and the binary counters (32, 33) of the second and third stages have the reset terminal (R), and are reset by said control signal.

Inventors: KAWAKAMI, MASUMI C/O PATENT DIVISION, SUZUKI, SEIGO C/O PATENT DIVISION, YABE, YUKIHIKO
Applicants: KABUSHIKI KAISHA TOSHIBA
Application year: 1985
Main classification: H03K19
IPC codes: H03K19