Abstract:
A disparity detection circuit used in a signal decoder which decodes a 4-bit signal into an original 2-bit main signal and 1-bit service signal, from which the 4-bit signal is coded according to a coding rule which stipulates that an original 2-bit main signal and 1-bit service signal should be coded into a 4-bit signal with 1 additional bit added and with pre-determined disparity carrying, determines whether the 4-bit signal conforms to the coding rule and detects the disparity of the 4-bit signal which is determined as conforming to the coding rule.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a disparity detection circuit used for a 2-bit to 4-bit coded signal decoder (hereinafter simply called decoder). 
     In digital signal transmission, a self-timing method is usually used, in which a signal receiver extracts a timing signal from a signal transmitted serially and establishes synchronization with the signal based upon the timing signal. In the self-timing method, however, if a streak of logical-0 bits occurs in a data bit string to be transmitted, without including a logical-1 bit, for example, it is difficult for the receiver to discriminate a timing signal. In order to prevent such inconvenience, a 2-bit to 4-bit (hereinafter called 2B4B) coding rule is widely used in optical terminal repeater equipment or intermediate repeater equipment. 
     A 2B4B-coded signal decoder decodes a 2B4B-coded signal into an original signal by using a disparity detection circuit which detects disparity of the 2B4B-coded signal. 
     In order to reduce the cost and, therefore, the amount of circuitry of a 2B4B-coded signal decoder, it is an absolute necessity to reduce the amount of circuitry constituting each functional unit of the signal decoder, including a disparity detection circuit. 
     Therefore, a disparity detection circuit made of as small amount of circuitry as possible, is in great demand. 
     2. Description of the Related Art 
     The 2B4B coding rule is a rule for coding a 2-bit main signal and a 1-bit service signal into a 4-bit signal (hereinafter called 4B signal) according to a 2B4B coding rule (see FIG. 1), with an additional bit added. The main signal consists of 2 bits from a data bit string to be transmitted. The service signal, as the alias service channel denotes, is independent of the main signal and carries additional information, e.g., a particular bit-pattern indicating the heading of a data frame and communication control information to be interchanged between intermediate repeater equipment, for example. FIG. 1 is a coding table illustrating an example of a 2B4B coding rule. Decoding a 2B4B-coded signal (i.e., 4B signal) is performed in such a way that disparity of a 4B signal received is first detected and, based on the disparity, the 4B signal is converted into the original signal (i.e., 2-bit main signal and 1-bit service signal) according to a decoding table in FIG. 2. FIG. 2 is a decoding table illustrating an example of decoding a 4B signal. 
     Disparity shown in FIGS. 1 and 2 is a value obtained by subtracting the number of logical-0 bits from that of logical-1 bits in the 4B signal received, whose 16 bit-patterns and the corresponding disparity are shown in FIG. 3. FIG. 3 is a table illustrating the disparity for 4B signals. Disparity is any of values &#34;0&#34;, &#34;+2&#34;, &#34;-2&#34;, &#34;+4&#34; and &#34;-4&#34;. For example, when 4B signal is &#34;0000&#34;, in which the number of logical-1 bits is zero and that of logical-0 bits is 4, the disparity of &#34;0000&#34; is &#34;-4&#34;. In the same way, the disparity of &#34;0011&#34;, in which the number of logical-1 bits is 2 and that of logical-0 bits is 2, is &#34;0&#34;. 
     An additional bit is added to an original signal (2-bit main signal from data to be transmitted plus 1-bit service signal), and the four bits are coded into a 4B signal according to the FIG. 1-coding table. 
     When an original signal is any of &#34;001&#34;, &#34;010&#34; and &#34;100&#34;, an additional logical-1 bit is added after the 3 original signal bits to form a 4B signal, in which the disparity results in &#34;0&#34;. When an original signal is any of &#34;011&#34;, &#34;101&#34; and &#34;110&#34;, a logical-0 bit is added after the 3 original signal bits, in which the disparity results in &#34;0&#34;. When an original signal is &#34;000&#34; and the last-occurred disparity except &#34;0&#34; is &#34;+2&#34; or &#34;-2&#34;, the 4B signal is &#34;1101&#34; or &#34;0001&#34;, respectively. When an original signal is &#34;111&#34; and the last-occurred disparity except &#34;0&#34; is &#34;+2&#34;  or &#34;-2&#34;, the 4B signal is &#34;1110&#34; or &#34;0010&#34;, respectively. 4B signals other than those defined in the FIG. 1-coding table are erroneous since the number of combinations of 3 original signal bits are only 8 as described above. For example, 4B signal &#34;0000&#34; is an error. 
     In the decoding table shown in FIG. 2, a 4B signal (A1, A2, A3, A4) represents 4 bits into which an original signal is coded at a sending end and received at a receiving end, and a 2B signal (B1, B2, B3) represents 3 bits into which the 4B signal received is to be decoded at the receiving end. 
     When a 4B signal is a code whose disparity is defined in the FIG. 1-coding table (hereinafter simply called defined) with disparity &#34;0&#34; and the last-occurred status (hereinafter called status-in) is logical 0, the 2B signal is the first 3 bits (excluding the additional bit) from which the 4B signal is coded, at a sending end, according to the FIG. 1-coding table. That is, the 2B signal is the original signal. Then, a current status (hereinafter called status-out) is set to logical 0. 
     When a 4B signal is defined with disparity &#34;0&#34; and the status-in is logical 1, the 2B signal is the first 3 bits (i.e., the original signal) from which the 4B signal is coded according to the FIG. 1-coding table. The status-out is set to logical 1. 
     For a defined 4B signal with disparity &#34;+2&#34; and the status-in being logical 0, the 2B signal is the first 3 bits (i.e., the original signal) from which the 4B signal is coded according to the FIG. 1-coding table. The status-out is set to logical 1. 
     For a defined 4B signal with disparity &#34;+2&#34; and the status-in being logical 1, the 2B signal is A1, A2 and A3 as received. The status-out is set to logical 1. 
     For a defined 4B signal with disparity &#34;-2&#34; and the status-in being logical 1, the 2B signal is the first 3 bits (i.e., the original signal) from which the 4B signal is coded according to the FIG. 1-coding table. The status-out is set to logical 0. 
     2B signals and their status-out signals of other 4B signals are as shown in the FIG. 2-decoding table. 
     Thus, a 4B signal received can be decoded into a corresponding 2B signal by detecting disparity of the 4B signal and, based on the disparity detected, status-in and status-out, by selecting either the first 3 bits (i.e., original signal) from which a 4B signal is coded according to the FIG. 1-coding table or the first 3 bits A1, A2 and A3 as received. 
     FIG. 4 is a block diagram illustrating a decoder circuit of related art, which decodes a 2B4B-coded signal (i.e., 4B signal) into a 2B signal. 
     A 4B signal received is supplied to a selector 6a, 2B4B-coded signal decoding circuit (hereinafter called 4B2B decoder) 1a, disparity detector 2a and disparity detector 3a. The 4B2B decoder 1a decodes the 4B signal into an original signal (2-bit main signal and 1-bit service signal) from which the 4B signal is coded according to the FIG. 1-coding table. The disparity detector 2a detects the disparity (-4, +4, -2, +2) of the 4B codes undefined in the FIG. 1-coding table. The disparity detector 3a detects the disparity (0, -2, +2) of the defined 4B signals. 
     A disparity generator 7a, based on a later-explained status-in signal and the disparity detected by the disparity detectors 2a and 3a, generates a status-out signal (logical 0 or 1) according to the FIG. 2-decoding table. A status holder 4a, which is made of a flip-flop, inputs and holds the status-out signal from the disparity generator 7a. 
     A selection controller 5a, based on the disparity detected, status-in and status-out and according to the FIG. 2-decoding table, determines which to select, a 3-bit original signal from which a 4B signal is coded or 3 bits A1, A2 and A3 as received, and outputs a select signal indicating which to select. 
     Thus, the selector 6a, based on the select signal from the selection controller 5a, selects either the original signal from which a 4B signal is coded or 3 bits A1, A2 and A3 as received, thus converting a 4B signal to a 2B signal. 
     FIG. 5 is a disparity detection circuit of the related art, which is a detailed circuit of the disparity detectors 2a and 3a shown in FIG. 4. The disparity detector 3a portion (enclosed in a broken line) of the disparity detection circuit detects disparity of defined 4B signals and the disparity detector 2a portion (outside the broken line) detects the disparity of undefined 4B signals. 
     Reference numerals D1, D2, D3 and D4 correspond to A1, A2, A3 and A4 bits of a 4B signal, respectively; XD1, XD2, XD3 and XD4 are the negation of the D1, D2, D3 and D4, respectively. 
     According to the FIG. 1-coding table, the AND, NAND and NOR gates constituting the disparity detection circuit (or disparity detectors 2a and 3a shown in FIG. 4) perform respective logical operations on the D1-D4, and XD1-XD4 to output signals M2, M1, M13, M3, M0, M4 and MERR, which are low-active. Signals M2, M1, M13 and M3 represent the disparity &#34;0&#34;, &#34;-2&#34;, &#34;±2&#34; and &#34;+2&#34; of defined 4B signals, respectively. Signals M0 and M4 represent the disparity &#34;-4&#34; and &#34;+4&#34; of undefined 4B signals. Signal MERR represents undefined 4B signals. 
     Accordingly, the thus-constructed disparity detection circuit of the related art requires as large amount of circuitry as fourteen 4-input AND gates, two 4-input NAND gates, one 4-input NOR gate, three 2-input AND gates, two 2-input NOR gates and one 6-input NOR gate. 
     A problem is that the disparity detection circuit (i.e., disparity detectors 2a and 3a) of the related art occupies a large part of a 2B4B-coded signal decoder in circuit amount, increasing the cost and the size and reducing the reliability of the 2B4B-coded signal decoder. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a small-sized and economical disparity detection circuit used for a 2B4B-coded signal decoder. 
     It is another object of the present invention to provide a reliable disparity detection circuit used for a 2B4B-coded signal decoder. 
     To achieve the above and other objects, the present invention provides a disparity detection circuit used in a signal decoder which decodes a 4-bit signal into an original 3-bit signal, from which the 4-bit signal is coded according to a coding rule stipulating that an original 3-bit signal should be coded into a 4-bit signal with 1 additional bit added and with pre-determined disparity carrying, for determining whether the 4-bit signal conforms to the coding rule, and for detecting the disparity of the 4-bit signal which is determined as conforming to the coding rule. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a coding table illustrating an example of a 2B4B coding rule; 
     FIG. 2 is a decoding table illustrating an example of decoding a 4B signal; 
     FIG. 3 is a table illustrating the disparity for 4B signals; 
     FIG. 4 is a block diagram illustrating a decoder circuit of related art; 
     FIG. 5 is a disparity detection circuit of the related art; 
     FIG. 6 is a block diagram illustrating a decoder circuit of the present invention 
     FIG. 7 is a detailed circuit illustrating a part of the disparity discriminator 11; 
     FIG. 8 is a function table illustrating the function of the disparity discriminator 11; and 
     FIG. 9 is a disparity detection circuit of the present invention. 
     Throughout the above-mentioned drawings, identical reference numerals are used to designate the same or similar component parts. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 6 is a block diagram illustrating a decoder circuit of the present invention, which decodes a 2B4B-coded signal (i.e., 4B signal) into a 2B signal. 
     A 4B signal received at a receiving end is supplied to a selector 6a, 4B2B decoder 1a and disparity discriminator 11. The 4B2B decoder 1a decodes the 4B signal into an original signal (2-bit main signal and 1-bit service signal) from which the 4B signal is coded according to the FIG. 1-coding table. The disparity discriminator 11 and a disparity detector 12 connected in series thereto, which constitute a disparity detection circuit and a characteristic feature of the present invention, detect disparity (-4, +4, -2, +2) of the undefined 4B signals and that (0, -2, +2) of the defined 4B signals (see the FIG. 1-coding table). 
     A status generator 7b, based on a later-explained status-in signal and the disparity detected by the disparity discriminator 11 and a disparity detector 12, generates a status-out signal (logical 0 or 1) according to the FIG. 2-decoding table. A status holder 4b, which is a flip-flop, for example, inputs and holds the status-out signal from the status generator 7b. 
     A comparator 5b compares bit-by-bit the output of the status holder 4b (i.e., status-in) with the status-out signal from the status generator 7b. Based on a mismatch or match of the comparison, the comparator 5b outputs a select signal indicating which to select, a 3-bit original signal from which a 4B signal is coded (according to the FIG. 1-coding table) or 3 bits A1, A2 and A3 as received, respectively. Although an original signal is to be selected as a B2 signal for a defined 4B signal with disparity &#34;0&#34; according to the FIG. 2-decoding table, the select signal causes 3 bits A1, A2 and A3 to be selected as received. This is reasonable because for a particular original signal whose disparity is set to &#34;0&#34; when coded according to the FIG. 1-coding table, the original signal is output as it is with 1 additional bit added to form a 4B signal. 
     The selector 6a, based on the select signal from the comparator 5b, selects either the original signal from which a 4B signal is coded or 3 bits A1, A2 and A3 as received, thus converting a 4B signal to a 2B signal. Thus, the 2B4B-bit-coded signal decoder of the present invention decodes a 4B signal received into a proper 2B signal. 
     FIG. 7 is a detailed circuit illustrating a part of the disparity discriminator 11. 
     The disparity discriminator 11 comprises an exclusive-OR (EX-OR) gate 111 and an exclusive-NOR (EX-NOR) gate 112. High-order 2 bits D1 and D2 of 4B signal (D1, D2, D3 and D4) are input to the EX-OR gate 111 to output a signal S1. Low-order 2 bits D3 and D4 are input to the EX-NOR gate 112 to output a signal S2. 
     FIG. 8 is a function table illustrating the function of the disparity discriminator 11. 
     When both signals S1 and S2 are logical 1, disparity is not defined in the FIG. 1-coding table; otherwise, disparity is defined. That is, when signals S1 and S2 are both logical 0, disparity is &#34;+2&#34; or &#34;-2&#34; (i.e., &#34;±2&#34;); when they differ in binary value, disparity is &#34;0&#34;. 
     FIG. 9 is a disparity detection circuit of the present invention. 
     In FIG. 9, reference numerals D1, D2, D3 and D4 correspond to A1, A2, A3 and A4 bits of a 4B signal, respectively. XD1, XD2, XD3 and XD4 are the negation of the D1, D2, D3 and D4, respectively. 
     The disparity detection circuit has a two-stage configuration with the disparity discriminator 11 (an EX-OR gate 111, EX-NOR gate 112, NOR gate and NAND gate enclosed in a broken line) connected in series to the disparity detector 12 (the other gates outside the broken line). The disparity detection circuit inputs signals D1-D4, XD1-XD4 and outputs low-active signals M2, M1, M13, M3, M0, M4 and MERR, meaning the same as in FIG. 5. The disparity discriminator 11 first determines whether a 4B signal is defined or undefined in FIG. 1-coding table, as in FIG. 8, then the disparity detector 12 detects disparity for the 4B signal. 
     As shown in FIG. 9, the disparity detection circuit requires one each of EX-OR, EX-NOR, 2-input NOR and 2-input NAND [and two EX-NOR gates] for the disparity discriminator 11; and two 4-input NAND gates, one 3-input AND gate, two 2-input NAND gates, one EX-NOR gate and one inverter for the disparity discriminator 12. Thus the disparity detection circuit of the present invention, which detects disparity in two stages, requires less than half as much circuitry (i.e., in FIG. 9 there are 11 gates) as that of the related art (i.e., in related art FIG. 5 there are 23 gates and, moreover, most of the gates there are 4-input gates) which detects disparity in one stage by ANDing or NANDing all the 4 bits of the 4B signal all together, which allow 16 bit-combinations. 
     Moreover, while the selection controller 5a of the related art generates the select signal based on the disparity detected, status-in and status-out and according to the FIG. 2-decoding table, the comparator 5b of the present invention generates the select signal simply by comparing bit-by-bit the status-in signal with the status-out signal, allowing it to be an EX-OR or EX-NOR gate. 
     As is apparent by the above description, the present invention can halve the amount of circuitry required for the disparity detection circuit of the related art, thus reducing the cost and size and improving the reliability of a 2-bit to 4-bit coded signal decoder.