Abstract:
A parity checker circuit for performing a parity check in the serial transfer of data in an integrated circuit having an odd or even decision circuit receiving sequential bits constituting a data stream and generating an output signal having a level which becomes high or low and representing whether the number of &#34;1&#34; or &#34;0&#34; in the data is odd or even, and a parity flag circuit connected to receive the output signal from the decision circuit and operable in accordance with a write signal received simultaneously with the high or low level output signal and, in response to these signals, for outputting a parity flag indicative of the parity of the data.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a parity checker circuit used in case that data in an integrated circuit are serially transferred. 
     According to a conventional parity checker circuit of this type, a selection bit for selecting a parity enable bit, an odd or even parity is provided. When a parity is detected, odd or even parity is detected, and if it is coincidence, an error flag is set. 
     In the above-mentioned conventional parity checker circuit, a problem arises in that its circuit area becomes excessively large, and the size of the chip of its integrated circuit increases. 
     SUMMARY OF THE INVENTION 
     The present invention is directed to solve the problems pointed out above, and has for its object to provide a parity checker circuit capable of reducing the size of the chip of an integrated circuit as small as possible. 
     According to the present invention, there is provided a parity checker circuit for performing a parity check in the serial transfer of data in an integrated circuit comprising an odd or even decision circuit receiving sequential bits constituting a data stream and generating an output signal having a level which becomes high or low after reception of the data stream and representing whether the number of &#34;1&#34; or &#34;0&#34; in the data is odd or even, and a parity flag circuit connected to receive the output signal from said decision circuit and operable in accordance with a write signal received simultaneously with the high or low level output signal and, in response to said signals, for outputting a parity flag indicative of the parity of the data stream. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a circuit showing a parity checker circuit according to an embodiment of the present invention; and 
     FIG. 2 is a timing chart for explaining the operation of the embodiment of FIG. 1. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 shows an embodiment of the present invention. Numeral 1 designates an odd or even decision circuit varying according to the number of &#34;1&#34; bits of received data, and numeral 2 designates a parity flag circuit receiving an output signal from the odd or even decision circuit 1. Numerals 3 and 8 designate inverters, and numeral 4 and 7 designate 2-input NAND gates. Numerals 5, 6, 9 and 10 designate transmission gates, which are controlled ON or OFF according to a signal A or its complementary signal A. 
     The output of the inverter 3 is connected to the input of NAND gate 4, and also connected to the transmission gate 5. The transmission gate 5 becomes an ON state when the signal A is &#34;1&#34; to connect the output of the inverter 3 to the one input of the NAND gate 7. The transmission gate 5 becomes an OFF state when the signal A is &#34;0&#34;. 
     Another input of the NAND gate 4 is connected to a reset signal RE, and the output of the NAND gate 4 is connected to the transmission gate 6. The transmission gate 6 becomes an ON state when the signal A is &#34;1&#34; to connect the output of the NAND gate 4 to the input of the inverter 3. The transmission gate 6 becomes an OFF state when the signal A is &#34;0&#34;. 
     Another one input of the NAND gate 7 is connected to the reset signal RE, and the output of the NAND gate 7 is connected to the input of the inverter 8. The output of the inverter 8 is connected to the transmission gate 9. The transmission gate 9 becomes an ON state when the signal A is &#34;1&#34; to connect the output of the inverter 8 to the input of the NAND gate 7. The transmission gate 9 becomes an OFF state when the signal A is &#34;0&#34;. The output of the inverter 8 is also connected to the transmission gate 10. The transmission gate 10 becomes an ON state when the signal A is &#34;1&#34; to connect the output of the inverter 8 to the input of the inverter 3. The transmission gate 10 becomes an OFF state when the signal A is &#34;0&#34;. 
     Numerals 11, 12 and 13 designate 2-input NAND gates, and the NAND gates 12 and 13 construct a flip-flop. Numeral 14 designates an inverter. Character B designates the output of the NAND gate 7, which is connected to the input of the NAND gate 11. To another one input of the NAND gate 11 is inputted a write signal W, and the output is connected to the input of the NAND gate 12. Another one input of the NAND gate 12 is connected to the output of the NAND gate 13, and the output of the NAND gate 12 is connected to the one input of the NAND gate 13. To the other one input of the NAND gate 13 is connected a clear signal CL. The output of the NAND gate 13 is connected to the input of the inverter 14. Character C designates the output of the inverter 14, which is a parity flag. 
     FIG. 2 is a timing chart for explaining the operation of the embodiment in FIG. 1. In FIG. 2, data D is 8-bit data having a &#34;0&#34; level start bit. These 8 bits are represented by D 0  to D 7  and illustrated to be all &#34;1&#34; bits in this case. Character CLO designates a received clock signal, character E designates a signal produced by inverting the received data D by delaying the data by a half cycle, character A has an inverted relationship to the signal A as described above, and is produced by taking a NOR of the signal E and the received clock signal CLO. 
     The received clock signal CLO falls from &#34;1&#34; to &#34;0&#34; in accordance with the start bit of the data D to start the operation and to stop the operation according to &#34;1&#34; when the reception of the data D is completed. Further, the received data D maintains &#34;1&#34; state when not received, the reception is started when receiving the start bit of &#34;0&#34; from &#34;1&#34;, and 8 bits after the start bit are data. The output B is &#34;1&#34; since the reset signal RE is normally &#34;0&#34;, and varies at every rise of the signal A when the signal RE becomes &#34;1&#34;. 
     The operation of the embodiment of the parity checker circuit will be described. 
     The example of reception of data will be first considered. 
     When the reception of data is started, the clear signal CL once falls to &#34;0&#34;, and then immediately becomes &#34;1&#34;. The write signal W is a signal for writing the received data in the data bus of the integrated circuit, generates a pulse becoming &#34;1&#34; only when the reception is completed, and normally becomes &#34;0&#34;. Thus, when the reception is started, the parity flag C is &#34;0&#34; at least until the reception is completed. 
     The reset signal RE is normally &#34;0&#34;, becomes &#34;1&#34; when the reception is started, and remains &#34;1&#34; until the reception is completed. Therefore, the output B of the NAND gate 7 becomes &#34;1&#34; when the reception is started. 
     However, the signal A is normally &#34;0&#34;, and whenever the received data is &#34;1&#34;, it generates a pulse from &#34;0&#34; to &#34;1&#34;, and the signals A and A have an inverted relationship as described above. 
     The signal B alters from &#34;1&#34; to &#34;0&#34; or &#34;0&#34; to &#34;1&#34; at every rise of the signal A from &#34;0&#34; to &#34;1&#34;. 
     As shown, since the number of pulses of the signal A is the number of &#34;1&#34; bits of the received data, the signal B becomes &#34;1&#34; when the number of &#34;1&#34; of the received data is odd. Since the write signal W becomes &#34;1&#34; simultaneously when the reception is completed, the parity flag C becomes &#34;1&#34;. Further, when the number of &#34;1&#34; of the received data is even, the signal B becomes &#34;0&#34;. Therefore, even the write signal W simultaneously becomes &#34;1&#34; when the reception is simultaneously completed, the parity flag C does not alter but remain &#34;0&#34;. 
     More particularly, since 8 bits of the data D are all &#34;1&#34; in this embodiment, the number of &#34;1&#34; becomes even, the parity flag C becomes &#34;0&#34;, if the number of &#34;1&#34; of the 8 bits becomes odd such as, for example, the last bit D 7  is &#34;0&#34;, &#34;1&#34; of the signal A becomes less by one. Therefore, the output B becomes &#34;1&#34; as designated by a broken line in FIG. 2, and the parity flag C becomes &#34;1&#34;. 
     When the number of &#34;1&#34; of the received data is odd immediately after the received data is completely received as described above, the parity flag C is &#34;1&#34;. When the number of &#34;1&#34; is the received data is even, the parity flag C can remain &#34;0&#34;. As a result, the parity check can be performed by such a parity flag C. 
     The foregoing description has been of an example of reception of data. The parity check can be performed by a similar circuit in the case of transmission of data. For example, when the write signal W is completely transmitted as a transmission completion signal, a pulse becoming &#34;1&#34; may be simultaneously generated. Further, the signal A may be a signal for generating a pulse from &#34;0&#34; to &#34;1&#34; whenever the transmitted data is &#34;1&#34;. In addition, in both the reception and the transmission of data, when the number of &#34;1&#34; or &#34;0&#34; in the transferred data is odd, the parity flag C is set to &#34;1&#34; and when the number of &#34;1&#34; or &#34;0&#34; is even, it is set to &#34;1&#34; and in both cases, it can be readily performed by a similar circuit. 
     According to the present invention as described above, since the parity checker circuit of the invention comprises an odd or even decision circuit for deciding the odd or even of the number of &#34;1&#34; or &#34;0&#34; in the data and the parity flag circuit for outputting the parity flag in response to the content of the odd or even decision circuit, the circuit area of the integrated circuit can be remarkably reduced, and the size of the chip of the integrated circuit having the parity checker mechanism can be substantially reduced.