BALANCED MBNB CODING
The present invention concerns a method of, and apparatus for, encoding data. Moreover the invention concerns a corresponding method of, and apparatus for, decoding encoded data. More especially, although not exclusively, the present invention is pertinent to data encoding/decoding in communication systems.
Contemporary communication systems comprise a plurality of nodes mutually interconnected through communication paths, for example optical fibre waveguides, along which information is conveyed in the form of digital data (i.e. in the form of logic "0" or logic "1" states). Clients connected to input nodes of the system provide information to the input nodes. The information is encoded at the input nodes to generate corresponding encoded data which is then communicated to output nodes of the system. At the output nodes, the encoded data is correspondingly decoded to reconstitute the information which is then output to other clients connected to the output nodes.
The output nodes need to synchronize to the encoded data for purposes of decoding it. Furthermore, to provide the system with a favourably low bit error rate performance, the encoded data has to be in a form which is robust to corruption, for example robust to burst noise. Moreover, the output nodes will often include high-pass filter stages handling the encoded data for removing static offsets, for example for removing offsets arising in photodetectors. Such high-pass filter stages and associated threshold detection circuits rely on their being substantially a similar number of logic "0" states and logic "1" states in the
encoded data otherwise the threshold circuits can generate spurious output or become sensitive to system noise. There therefore arise simultaneously three problems of:
• synchronizing to the encoded data;
• balancing the number of logic 0 and logic 1 states in the encoded data; and • rendering the encoded data robust to corruption for obtaining a satisfactorily low bit error rate.
Encoding schemes known in the prior art do not adequately address these three problems simultaneously; they tend to cope satisfactorily with only two of the three problems.
The present invention arose in an endeavour to provide a method of encoding data which is capable, at least in part, of addressing the aforementioned three problems simultaneously.
According to a first aspect of the present invention, there is provided a method of encoding a serial stream of digital data blocks comprising: partitioning the stream into data blocks; translating the blocks into corresponding encoded equivalents; and assembling the encoded equivalents together to generate an output serial stream of encoded data, the method being characterised in that: each encoded equivalent includes equal numbers of logic O's and logic l's; the encoded equivalents are mutually distinguishable such that a single bit error in one or more of the equivalents is unambiguously detectable; each value of data block uniquely maps onto a corresponding encoded equivalent and at least one equivalent is a marker equivalent which is periodically inserted into the output data stream to denote
where equivalents occur in the output encoded data stream.
The method of the invention provides the advantage that it is capable of simultaneously addressing issues of balance, synchronisation and improving robustness to errors. In the context of the present application digital data is data having one of two possible logic states e.g. logic "0" or logic "1".
Preferably, the marker equivalent is operable to denote frame boundaries within the output encoded data stream. Use of marker equivalents is beneficial to assist with synchronising to the output encoded data when subsequently decoding it. More preferably, the marker equivalent is of a form which produces a sequence of logic l's and O's in the encoded data stream which is readily identifiable, for example by arranging for the marker equivalent to have its logic l's grouped consecutively together and its logic O's grouped consecutively together.
In communication systems, a situation frequently arises where it is necessary to send an alarm signal, for example where an item of equipment has failed or imminent failure is likely to occur. In order to convey alarm information, it is preferable that at least one of the equivalents is reserved for alarm indication purposes. It is especially preferable that there are two equivalents reserved for alarm indication purposes, the two equivalents corresponding to the alternative bit patterns ...0101... and ...1010... .
The method of encoding data according to the invention can employ a number of
alternative coding schemes [K, N] for translating blocks of K-bits into corresponding equivalents of N-bits. Preferably blocks are translated into equivalents using one of the following coding schemes: [1,4], [4, 6], [6, 8], [7, 10], [9, 12], [11, 14], [13, 16].
Advantageously the coding scheme satisfies a criterion:
N!
≥ 2K + B
where K is the number of bits in each of the partitioned blocks, Ν is the number of bits in each of the equivalents, and B is the number of equivalents reserved for one or more of alarm and synchronisation functions.
In practical communication hardware it especially preferred to use a [4, 6] coding scheme employing the following 6-bit equivalents to uniquely represent 4-bit blocks: 001011, 001101, 001110, 010011, 010110, 011100, 011010, 011001, 110100, 110010, 110001, 101100, 101001, 100011, 100101, 100110. This coding scheme provides an especially appropriate performance in terms of simplicity of code and data overhead. Moreover, the inventor has appreciated that it is also especially convenient in the coding scheme that at least one equivalent has the form 000111, 111000 for denoting frame boundaries in the output data. Furthermore, it is found especially beneficial to employ a coding scheme as presented in table below.
According to a second aspect of the invention there is provided an apparatus for encoding a serial stream of digital data blocks comprising: means for partitioning the stream into data blocks; means for translating the blocks into corresponding encoded equivalents; and means for assembling the encoded equivalents together to generate an output serial stream of encoded data, the apparatus being characterised in that: the means for translating the blocks is operable such that encoded equivalent includes equal numbers of logic O's and logic l's; the encoded equivalents are mutually distinguishable such that a single bit error in one or more of the equivalents is unambiguously detectable; each value of data block uniquely maps onto a corresponding encoded equivalent and at least one equivalent is a marker equivalent which is periodically inserted into the output data stream to denote
where equivalents occur in the output encoded data stream.
Preferably the marker equivalent is operable to denote frame boundaries within the output encoded data stream.
Advantageously the marker equivalent includes its logic l's grouped consecutively together and its logic O's grouped consecutively together.
Preferably at least one of the equivalents is reserved for alarm indication purposes. In one arrangement two equivalents are reserved for alarm indication purposes, the two equivalents corresponding to the alternative bit patterns ...0101... and ...1010... .
Advantageously the means for translating blocks involves use of one of the following coding schemes [K, N]: [1, 4], [4, 6], [6, 8], [7, 10], [9, 12], [11, 14], [13, 16]. In a particularly preferred arrangement the coding scheme satisfies a criterion:
N!
≥ 2K + B
where K is the number of bits in each of the partitioned blocks, N is the number of bits in each of the equivalents, and B is the number of equivalents reserved for one or more of alarm and synchronisation functions.
Preferably the coding scheme is a [4, 6] coding scheme employing the following 6-bit
equivalents to uniquely represent 4-bit blocks: 001011, 001101, 001110, 010011, 010110, 011100, 011010, 011001, 110100, 110010, 110001, 101100, 101001, 100011, 100101, 100110. With such a coding scheme it is preferred that the at least one equivalent having the form 000111, 111000 is employed for denoting frame boundaries in the output data.
According to a third aspect of the invention a method of decoding a serial stream of digital data which has been encoded as described above comprises: identifying where marker equivalents in the encoded data stream occur and thereby partitioning the encoded data into equivalents; translating the equivalents into corresponding decoded data blocks; and assembling the decoded blocks together to generate a serial stream of decoded data.
According to a fourth aspect of the invention an apparatus for decoding a serial stream of binary data which has been encoded as described above comprises: means for identifying where marker equivalents in the encoded data stream occur and thereby partitioning the encoded data into equivalents; means for translating the equivalents into corresponding decoded data blocks; and means for assembling the decoded blocks together to generate a serial stream of decoded data.
According to a fifth aspect of the invention there is provided a communication system incorporating apparatus as described above.
Embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawing which is a schematic diagram of a communication
system arranged in a ring configuration including a transponder path overhead device operable to encode and decode data according to the invention.
In the drawing there is shown a commumcation system indicated generally by 5. The system 5 comprises a transponder path overhead device 10 coupled to a communication ring 15. The ring 15 comprises a plurality of nodes, for example a node 20, serially connected to each other by first and second communications paths 25, 30 typically an optical fibre waveguide. The two communication paths 25, 30 are for conveying traffic in clockwise and counter-clockwise directions around the ring 15 respectively. The two paths 25, 30 are employed for protection in case communication along one of the paths becomes disabled, for example due to a break in an optical fibre waveguide.
The device 10 is operable to receive and decode a serial stream of encoded digital data propagating in a clockwise direction around the ring 15 at its West RX (Receive) input port, and also to receive and decode encoded data propagating in an counter-clockwise direction around the ring 15 at its East RX input port, the encoded data being encoded according to a method of the present invention. Furthermore, the device 10 is operable to encode data according to the method to generate corresponding serial stream of encoded data for output at a TX Data output port of the device 10; this TX Data output can be optionally coupled to the ring as illustrated.
The device 10 is implemented using field programmable gate arrays (FPGA) which operate from a 3.3 volt power supply. The arrays employ LNTTL logic levels at their interfaces.
Component parts of the device 10 will now be described with reference to Figure 1. The device 10 comprises a first frame alignment interface 50 coupled to a first data extractor 60, a second frame alignment interface 70 coupled to a second data extractor 80, a microprocessor interface 90 connected to the first and second data extractors 60, 80, and a transmit data injector 100 coupled to the microprocessor interface 90 and to a transmit frame generator 110. Moreover, the data injector 100 includes the aforesaid TX Data output port. The first and second frame alignment interfaces 50, 70 include the aforementioned input ports West RX and East RX respectively.
In operation, the first and second alignment interfaces 50, 70 receive the serial stream of encoded data comprising at the input ports West RX, East RX respectively. As will be ' described below the data stream periodically (i.e. at regular repeating intervals) includes frame information defining frames within the data stream. The interfaces 50, 70 synchronize to the frames and output synchronised data to the first and second data extractors 60, 80 respectively. Decoded data from the extractors 60, 80 is output therefrom to the microprocessor interface 70 which interprets the data and outputs, if required, response data to the data injector 100. The injector 100 encodes the response data according to the method of the invention, partitions the encoded response data into frames generated by the frame generator 110 and then outputs the framed encoded response data at the TX Data output port.
In the following description, a specific example of a method of encoding data according to
the present invention will initially be described in which a 4-bit data block, or character, is encoded into a 6-bit equivalent, that is a [4, 6] coding scheme. Thereafter, a general approach to selecting encoding schemes for the method will be elucidated.
In operation, the device 10 receives at its frame alignment interfaces 50, 70 a serial stream of encoded digital data from the ring 15 (i.e. a series of l's and O's) . In the stream, base-16 (hexadecimal) characters "0" to "F' are each represented by 6-bit equivalents. The hexadecimal characters, their 4-bit binary data pattern and their corresponding 6-bit equivalents in accordance with the invention are listed in Table 1.
Table 1
In Table 1, it is to be noted that:
• all the encoded equivalents are balanced, namely each encoded equivalent includes three logic O's and three logic l's;
• all the encoded equivalents include at least two transitions from 0 to 1 or vice versa; • the encoded equivalents for the characters "0" to "7" are negated versions of the encoded equivalents for the characters "8" to "F" respectively;
• a consecutive pair of encoded equivalents in the data stream will include no more than four consecutive logic O's or logic l's;
• a single bit error in any of the equivalents is immediately detectable; and • alternative patterns 101010 and 010101 in the equivalents are not used for representing characters for circumventing potential ambiguity.
When encoding data to the device 10 according to the invention, it is preferable that the data blocks within the data stream have their most significant bits first. For example, a data byte 00010110 comprises corresponding hexadecimal characters "16" which is represented by encoded equivalents in a form 001101011010 where left hand side logic digits are received before right hand side digits; in other words, with time travelling from left to right.
The method of encoding data and the method of decoding data of the present invention reserve encoded equivalents Y=000111 and Z= 111000 as special characters for frame alignment purposes. Both of the two encoded equivalents are periodically inserted into the encoded data stream to define frames within the stream. As will be appreciated insertion of
the equivalent Y immediately followed by insertion of the equivalent Z, i.e. 000111111000, uniquely produces six consecutive logic l's in the encoded data stream. As described above a consecutive pair of encoded equivalents for a data character will result in no more than four consecutive logic l's or logic O's in the encoded data stream. Thus the occurrence of six consecutive logic l's uniquely indicates the beginning/end of a frame. It will also be appreciated that inserting Z immediately followed by Y will likewise result in the occurrence of six consecutive logic O's in the encoded data stream and can accordingly be used to denote frames within the encoded data stream. It should also be noted that it would take at least two errors to occur in a consecutive pair of encoded equivalents to falsely generate six consecutive l's or O's. In the example being described the frame length is 64 data block (32 character bytes) and thus the two marker equivalents Y, Z are inserted every 64 equivalents, i.e. every 256 bits. To further reduce the likelihood of a false marker pattern being erroneously generated in the received data stream it is preferred to include the marker equivalents Y, Z, Y, Z such that frame alignment is established only when a twenty four bit sequence of three O's, six l's, six O's and six l's is identified. It is particularly important to choose a marker pattern which minimises any likelihood of corrupted data erroneously generating the pattern since it will take at least a further frame to correctly realign.
The frame alignment interfaces 50, 70 are thus operable to scan the streams of encoded data for the equivalents Y and Z (i.e. six consecutive logic l's or logic O's) and use them for identifying where frames occur in the data streams when synchronising to equivalents included within the frames.
The hexadecimal characters and their corresponding equivalents depicted in Table 1 represent a specific example of encoding in accordance with the present invention in which 4-bit characters (data blocks) are encoded into corresponding 6-bit encoded equivalents that is a [4, 6] coding scheme. However, it will be appreciated that the method of the invention is capable of being adapted to apply to other coding schemes in which the input data blocks and encoded equivalents have other numbers of bits.
Thus, the method of encoding data in the device 10 comprises the following steps:
• receiving an input serial stream of digital data blocks to be encoded; • partitioning the stream into a plurality of blocks (4-bits in the above example) corresponding to the characters in Table 1;
• translating the blocks into corresponding equivalents as depicted in Table 1;
• assembling the equivalents together to form an encoded data stream;
• inserting synchronisation marker equivalents, for example the equivalents Y and Z, at periodic intervals into the encoded data stream to denote where frames occur within the encoded data stream; and
• outputting the encoded data stream including the marker equivalents.
Moreover, the method of decoding data in the device 10 comprises the following steps to be performed:
• receiving a serial stream of encoded digital data to be decoded;
• correlating bit templates corresponding to marker equivalents, for example the
equivalents Y and Z, to determine where marker equivalents occur in the encoded stream of data, thereby synchronizing to frames of the encoded stream of data;
• partitioning the encoded stream into blocks corresponding to equivalents therein;
• translating the equivalents into corresponding characters as depicted in Table 1 but discarding marker equivalents for translation purposes;
• assembling the translated characters into a serial stream of decoded data.
In a generalised case of the method of encoding a serial stream of digital data blocks according to the invention, an input serial data stream to be encoded includes consecutive blocks of data, each block comprising K bits. Each block is converted by the method into encoded equivalents, each equivalent comprising N bits. Such coding is referred to as a [K, N] decoding scheme. The equivalents are code-words which each comprise equal numbers of logic O's and l's; in the other words, the code-words are said to be balanced.
When decoding data according to the method in the device 10, N-bit code-words are gathered. Each code-word is then decoded to yield its corresponding K-bit block of data. Such decoding is known as an [N, K] decoding scheme. Because all the code-words are balanced and as a single bit error in a code-word will always create an imbalance, it will be appreciated that all possible equivalents will unambiguously reveal single bit errors.
In addition to 2K encoded equivalents which convey corresponding characters, each character represented by a data block of K bits and each equivalent including N bits, B
additional equivalents are preferably reserved for special functions. B is preferably numerically equal to four but can have other values. When B is four, two or these four additional equivalents are beneficially reserved for special purposes, for example the aforementioned Y and Z equivalents are reserved for frame alignment purposes; another two of these four additional equivalents are alternating patterns ... 010101 ... and ... 101010 ... which are preferably reserved for indicating an alarm situation. Thus, given B additional encoded equivalents, (2K+B) balanced combination for equivalents are required to convey all characters comprising K bits. The use of specific code- words which produces a unique sequence of l's and O's in the coded data stream ensures that data patterns comprising equivalents can never induce ambiguous frame alignment. It is to be noted that synchronisation in the device 10 is necessary in order to identify code-word boundaries.
When devising a code for use in the method of encoding according to the present invention, it is necessary to commence with an N-bit binary quantity. Into this quantity is distributed N/2 logic O's and N/ logic l's. Thus, N must be an even number in the method. There are N ways of selecting a position for a first logic 0 in the quantity, N-l ways of selecting a position for a second logic 0 in the quantity, N-2 ways of selecting a position for a third logic 0, and so on. Once N/2 selections have been made for the quantity, then the remaining N/2 symbols must be logic l's for balancing purposes. Since the order of the distribution is irrelevant to the method provided that it is used systematically for encoding and subsequent corresponding decoding, it follows that the total number of balanced combinations T is given by:
E = Εq. 1
D
where A = a total number of combination arrangements possible; and
D = a corresponding number of distributions which is (N/2)(N/2-l)(N/2-2)..(l).
For example, where the method of the present invention uses an 8-bit code-word (N) in the encoded equivalents, the number of balanced combinations T is (8.7.6.5) / (4.3.2.1) = 70. A value for T can be determined in a generic case by :
T = m Εq. 2
N,
X
Hence, for a [K, N] coding scheme for use in a method of encoding data according to the present invention, a scheme exists for the method when N is even and the condition:
Example practical values of K and N which are viable for the method of encoding data according to the present invention are provided in Table 2. Basic properties of coding schemes for the method are also listed.
It can be seen from Table 2 that the encoding method of the invention becomes more efficient as more character bits K are employed giving rise to a correspondingly greater value of N. Data overhead Q is a parameter defined by:
xl00% Eq. 4 K
Table 2
From Table 2, it can be seen that [4, 6] and [6, 8] encoding schemes are convenient practical choices. Not only do large values of N require more coding effort but their relatively large number of unused codes degrades their overall efficiency to a value in the order of 20%.
It will be appreciated by one skilled in the art that modifications can be made to the method of encoding data of the present invention without departing from the scope of the invention. For example, the values of N, B and K can be modified subject to Eq. 3 being satisfied.