Encoding and Decoding Methods and Devices, and System

Information

  • Patent Application
  • 20240007131
  • Publication Number
    20240007131
  • Date Filed
    September 18, 2023
    a year ago
  • Date Published
    January 04, 2024
    11 months ago
Abstract
An encoding method includes: obtaining a generator matrix for encoding, where the generator matrix is determined based on a target parity-check matrix of a Hamming code for encoding, the target parity-check matrix is based on a target function for decoding, the target function is used to determine a not-all-zero row vector extended based on the target parity-check matrix, and the target function is one of a predetermined function set; encoding information bits using the generator matrix to obtain an encoded data stream; and sending the encoded data stream.
Description
TECHNICAL FIELD

Embodiments of this disclosure generally relate to the field of communication technologies, and more specifically, to encoding and decoding methods and devices, and a system.


BACKGROUND

In a communication system, information is sent from a transmit end in a form of a signal, and is transmitted to a receive end through a communication channel such as an optical fiber, a cable, or a radio wave. In this process, noise in the channel or noise from the receive end and the transmit end is usually superimposed on a signal, thereby causing an error of a signal received by the receive end. In order that the receive end can restore, based on the erroneously received signal, the original signal sent by the transmit end, currently the forward error correction (FEC) technology is generally used in the communication system to encode the information before the signal is sent. In addition, the FEC technology is also widely applied to storage systems.


FEC-based encoding technologies include, for example, a Hamming code, a Bose, Chaudhuri, and Hocquenghem (BCH) code, a Reed-Solomon (RS) code, and a Turbo product code (TPC). The Hamming code is a perfect code with a simple hard-decision decoding scheme, and the Hamming code can detect and correct a one-bit error. Specifically, for the Hamming code, a concept of a parity bit is used. Information is first grouped, and then a check bit is added before each group of information bits. In this design, validity of the information can be verified, and a location of an error in the information can be further indicated. In practice, various forms of extended Hamming codes have been provided. A principle of the extended Hamming codes is to extend a conventional Hamming code by using an additional parity bit or row vector to implement enhanced detection and error correction capabilities. However, currently performance of a single-extended Hamming code is not ideal, and performance of a double-extended Hamming code is improved but coding and decoding complexity is relatively high.


SUMMARY

In general, example embodiments of this disclosure provide a scheme for generating a double-extended Hamming code and related encoding and decoding schemes.


According to a first aspect of this disclosure, an encoding method is provided. In the method, a generator matrix for encoding is obtained. In the context of this disclosure, the generator matrix is determined based on a target parity-check matrix of a Hamming code for encoding, and the target parity-check matrix is determined based on a target function for decoding. The target function is used to determine a not-all-zero row vector extended based on the target parity-check matrix. The target function is one of a predetermined function set. In this method, information bits are encoded by using the generator matrix, to obtain an encoded data stream. The method further includes: sending the encoded data stream.


In the encoding method provided in this embodiment of this disclosure, the improved double-extended Hamming code is used, and the target parity-check matrix of the improved double-extended Hamming code is obtained based on the target function that has a smaller operation quantity and that is selected from the predetermined function set, so that such an extended Hamming code can implement lower encoding complexity and optimized performance in specific code space.


In a first implementation of the first aspect, the target function h(s0,i,s1,i,s2,i) determines the not-all-zero row vector based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector, and the predetermined function set includes one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,is2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,is1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,is2,i), h(s0,i,s1,i,s2,i)=(s0,is1,i)∧(s1,i∧s2,i), h(s0,is1,is2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,is2,i)∨(s0,i∧s1,i), and h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,i∧s2,i).


In a second implementation of the first aspect, a code length of the Hamming code is 180, a length of the information bits is 170, all elements in a ninth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i. Herein i is an integer greater than or equal to 0 and less than 180, i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a third implementation of the first aspect, a code length of the Hamming code is 128, a length of the information bits is 119, all elements s8,i in an eighth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector as one of s7,i=h(s0,i,s1,i,s2,i)=s0,1∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 128, i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a fourth implementation of the first aspect, a code length of the Hamming code is 64, a length of the information bits is 56, all elements s7,i in a seventh row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s6,i, s5,i, s4,i, s3,i, s2,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a fifth implementation of the first aspect, the target parity-check matrix is transformed to obtain a system check matrix, and the generator matrix is determined based on the system check matrix.


In a sixth implementation of the first aspect, the predetermined function set includes a plurality of candidate functions for determining the not-all-zero row vector extended based on the target parity-check matrix.


In a seventh implementation of the first aspect, in the method, the target parity-check matrix is determined in the following manner: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions; selecting a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set; transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form; determining a third parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, where the third parameter indicates encoding complexity of the Hamming code; selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the third parameter; and determining the target parity-check matrix from the first group of candidate parity-check matrices.


In an eighth implementation of the first aspect, in the method, the target parity-check matrix is determined from the first group of candidate parity-check matrices in the following manner: determining a fourth parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, where the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices; selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices based on the fourth parameter; and determining the target parity-check matrix from the second group of candidate parity-check matrices.


In a ninth implementation of the first aspect, in the method, the target parity-check matrix is determined in the following manner: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions; selecting a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set; transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form; determining a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, where the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set; selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the fourth parameter; and determining the target parity-check matrix from the first group of candidate parity-check matrices.


In a tenth implementation of the first aspect, in the method, the target parity-check matrix is determined from the first group of candidate parity-check matrices in the following manner: determining a third parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, where the third parameter indicates encoding complexity of the Hamming code; selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices, where the second group of candidate parity-check matrices has the third parameter below a predetermined threshold; and determining the target parity-check matrix from the second group of candidate parity-check matrices.


In an eleventh implementation of the first aspect, in the method, the second candidate parity-check matrix set in the systematic form is obtained through transformation in the following manner: for each candidate parity-check matrix in the first candidate parity-check matrix set, moving at least some linearly independent column vectors from right to left to the rightmost of the corresponding candidate parity-check matrix, and performing elementary row transformation, so that a right part of the corresponding candidate parity-check matrix is an identity matrix.


In a twelfth implementation of the first aspect, in the method, the target parity-check matrix is determined from the second group of candidate parity-check matrices in the following manner: determining an operation quantity of a function corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set; and determining the target parity-check matrix based on the operation quantity.


According to a second aspect of this disclosure, a decoding method is provided. The method includes: receiving a data stream; obtaining a target parity-check matrix of a Hamming code for decoding, where the target parity-check matrix is determined based on a target function for decoding, the target function is used to determine a not-all-zero row vector extended based on the target parity-check matrix, and the target function is one of a predetermined function set; and decoding the data stream by using the target parity-check matrix.


In the decoding method provided in this embodiment of this disclosure, the improved extended Hamming code is used, and the target parity-check matrix of the improved extended Hamming code is obtained based on the target function that has a smaller operation quantity and that is selected from the predetermined function set, so that such an extended Hamming code can implement lower decoding complexity and optimized performance at a decoding end without changing a codeword output by an encoding end.


In a first implementation of the second aspect, the target function h(s0,i,s1,i,s2,i) determines the not-all-zero row vector based on at least some elements of first three elements s0,1, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector, and the predetermined function set includes one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,is2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,is1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,is2,i)=(s0,is1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,is2,i)∧(s0,i∧s1,i), and h(s0,i,s1,i,s2,i)=(s0,is2,i)∧(s1,i∧s2,i).


In a second implementation of the second aspect, a code length of the Hamming code is 180, a length of information bits is 170, all elements in a ninth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i. Herein i is an integer greater than or equal to 0 and less than 180, i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a third implementation of the second aspect, a code length of the Hamming code is 128, a length of information bits is 119, all elements s8,i in an eighth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector as one of s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s7,i=h(s0,i,s1,i,s2,i)=s1,i, Herein i is an integer greater than or equal to 0 and less than 128, i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a fourth implementation of the second aspect, a code length of the Hamming code is 64, a length of the information bits is 56, all elements s7,i in a seventh row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In a fifth implementation of the second aspect, the predetermined function set includes a plurality of candidate functions for determining the not-all-zero row vector extended based on the target parity-check matrix.


In a sixth implementation of the second aspect, in the method, the target parity-check matrix is determined in the following manner: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions; selecting a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set; transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form; determining a third parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, where the third parameter indicates encoding complexity of the Hamming code; selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the third parameter; and determining the target parity-check matrix from the first group of candidate parity-check matrices.


In a seventh implementation of the second aspect, in the method, the target parity-check matrix is determined from the first group of candidate parity-check matrices in the following manner: determining a fourth parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, where the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices; selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices based on the fourth parameter; and determining the target parity-check matrix from the second group of candidate parity-check matrices.


In an eighth implementation of the second aspect, in the method, the target parity-check matrix is determined in the following manner: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions; selecting a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set; transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form; determining a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, where the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set; selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the fourth parameter; and determining the target parity-check matrix from the first group of candidate parity-check matrices.


In a ninth implementation of the second aspect, in the method, the target parity-check matrix is determined from the first group of candidate parity-check matrices in the following manner: determining a third parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, where the third parameter indicates encoding complexity of the Hamming code; selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices, where the second group of candidate parity-check matrices has the third parameter below a predetermined threshold; and determining the target parity-check matrix from the second group of candidate parity-check matrices.


In a tenth implementation of the second aspect, in the method, the second candidate parity-check matrix set in the systematic form is obtained through transformation in the following manner: for each candidate parity-check matrix in the first candidate parity-check matrix set, moving at least some linearly independent column vectors from right to left to the rightmost of the corresponding candidate parity-check matrix, and performing elementary row transformation, so that a right part of the corresponding candidate parity-check matrix is an identity matrix.


In an eleventh implementation of the second aspect, in the method, the target parity-check matrix is determined from the second group of candidate parity-check matrices in the following manner: determining an operation quantity of a function corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set; and determining the target parity-check matrix based on the operation quantity.


In a twelfth implementation of the second aspect, in the method, the decoding the data stream by using the target parity-check matrix includes: calculating a syndrome for the data based on the target parity-check matrix; and if the syndrome is zero, outputting at least some bits of the data stream as decoded information bits; or if the syndrome is not zero, determining whether there is a first column vector equal to the syndrome in the target parity-check matrix: if there is the first column vector equal to the syndrome in the target parity-check matrix, flipping bits corresponding to the first column vector in the data stream; and outputting at least some bits of the data stream after the flipping as the decoded information bits.


According to a third aspect of this disclosure, an encoding device is provided. The encoding device includes at least one processor and at least one memory including computer program code. The at least one memory and the computer program code are configured to work with the at least one processor to enable the encoding device to perform the method in the first aspect of this disclosure.


According to a fourth aspect of this disclosure, a decoding device is provided. The decoding device includes at least one processor and at least one memory including computer program code. The at least one memory and the computer program code are configured to work with the at least one processor to enable the decoding device to perform the method in the second aspect of this disclosure.


According to the fifth aspect of this disclosure, a communication system is provided. The communication system includes: the encoding device according to the third aspect of this disclosure and the decoding device according to the fourth aspect of this disclosure.


Based on the improved extended Hamming code provided in embodiments of this disclosure, for the encoding device, the decoding device, and the communication system including the encoding device and the decoding device, a bit error rate can be significantly reduced, and a capability of resisting channel interference can be improved, thereby improving system performance.





BRIEF DESCRIPTION OF DRAWINGS

The foregoing and other features, advantages, and aspects of embodiments of this disclosure become more obvious with reference to the accompanying drawings and with reference to the following detailed description. In the accompanying drawings, same or similar reference numerals represent same or similar elements.



FIG. 1 is a schematic diagram of an architecture of a communication system according to an example embodiment of this disclosure;



FIG. 2 is a flowchart of an encoding method according to an example embodiment of this disclosure;



FIG. 3 is a flowchart of a decoding method according to an example embodiment of this disclosure;



FIG. 4 is a diagram of performance of a double-extended Hamming code and a conventional extended Hamming code according to an example embodiment of this disclosure; and



FIG. 5 is a block diagram of an electronic device according to an example embodiment of this disclosure.





DESCRIPTION OF EMBODIMENTS

The following describes some example embodiments with reference to the accompanying drawings. Although some example embodiments of this disclosure are shown in the accompanying drawings, it should be understood that this disclosure may be implemented in various forms, and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided so that this disclosure can be thoroughly and completely understood. It should be understood that the accompanying drawings and embodiments of this disclosure are merely used as examples, but are not intended to limit the protection scope of this disclosure.


The term “include” and variants thereof used in this specification indicate open inclusion, that is, “include but is not limited to”. Unless otherwise stated, the term “or” means “and/or”. The term “based on” means “at least partially based on”. The terms “example embodiments” and “some embodiments” represent “at least one example embodiment”. Other explicit and implicit definitions may also be included below.


A minimum Hamming distance of a conventional Hamming code is 3, and the conventional Hamming code can detect and correct a one-bit error. To enhance performance of the Hamming code, an additional parity bit may be added to the conventional Hamming code, for example, the Hamming code (2m−1, 2m−1−m), to obtain a single-bit extended Hamming code (eHamming) (2m, 2m−1−m) that is also referred to as an “extended Hamming code” or a “conventional extended Hamming code” in the following. The conventional extended Hamming code has a parity-check matrix with a size of (m+1)×2m, which may be represented as follows:










H
e

=

[



H


0




1


1



]





(
1
)







Herein, H represents the parity-check matrix of the conventional Hamming code (Hamming) (2m−1, 2m−1−m), a size of the parity-check matrix is m×(2m−1), 1 represents an all-one row vector with a length of 2m−1, and 0 represents an m-dimensional all-zero column vector. Clearly, a last row of H e is an all-one row vector with a length of 2m.


A minimum Hamming distance of the conventional extended Hamming code (eHamming) is 4, and can detect a two-bit error and correct a one-bit error. A code rate of the conventional extended Hamming code (eHamming) (2m, 2m−1−m) is Re=(2m−1−m)/2m. To implement a lower code rate, q information bits may be set to 0 by using a shortening (shorten) technology, to obtain a shortened extended Hamming code (2m−q, 2m−1−m−q), where 0≤q<(2m−1)/2.


Although a function expression of the conventional extended Hamming code (eHamming) is simple, performance of the conventional extended Hamming code needs to be further improved. In addition, in cases of some specific code lengths, a length of shortened bits of the conventional extended Hamming code is longer. For example, for a conventional extended Hamming code (eHamming) (180,170), a code parameter of the conventional extended Hamming code is m=9, and a length of shortened bits is q=332, where q is almost twice an information length k=170. In view of this, the Hamming code needs to be improved and optimized.


According to embodiments of this disclosure, an improved double-extended Hamming code and encoding and decoding methods based on the improved double-extended Hamming code are provided. A target parity-check matrix of the improved double-extended Hamming code is obtained based on a target function that has a smaller operation quantity and that is selected from a predetermined function set, so that such an extended Hamming code can implement lower encoding and decoding complexity and a lower bit error rate in specific code space and provide optimized performance. In this way, an interference resistance capability of the communication system is improved.



FIG. 1 is a schematic diagram of an architecture of a communication system 100 according to an example embodiment of this disclosure. As shown in FIG. 1, the communication system 100 includes an encoding device 110, a decoding device 120, and a channel 104 connecting the encoding device 110 and the decoding device 120. The architecture of the communication system 100 is merely an example and is not intended to imply any limitation on the scope of this disclosure. Embodiments of this disclosure may also be implemented in other communication systems. In addition, it should be further understood that the communication system 100 may further include another element or entity configured to receive, send, encode, decode, or the like information or data. These elements or entities are not shown in the communication system 100 for simplicity of description. However, it does not mean that embodiments of this disclosure do not include these elements or entities.


The encoding device 110 serves as a transmit end of information or data. The encoding device 110 obtains to-be-sent information bit sequence u from a source (not shown), encodes the information bit sequence u into a data stream c, and sends the data stream c to the decoding device 120 through the channel 104. The channel 104 may be implemented in various forms such as wired or wireless connection, including but not limited to an optical fiber, a cable, or a radio wave. In a process of transmitting information or a data stream, noise in the channel 104 or noise introduced by the transmit end and/or the receive end is usually superimposed, so that an error exists in the data stream received by the receive end. By using various encoding and decoding technologies, interference resistance performance of the communication system 100 can be well enhanced.


The encoding device 110 may encode information in various encoding manners. In some embodiments, the encoding device 110 may use a Hamming code as an encoding technology, and correspondingly the decoding device 120 also uses the Hamming code as a decoding technology. The Hamming code corresponds to a generator matrix G for encoding and a parity-check matrix H for decoding. The generator matrix G is determined based on the parity-check matrix H. In some embodiments, the generator matrix G is configured for the encoding device 110. Before sending the information bit sequence u, the encoding device 110 encodes the information bit sequence u by using the generator matrix G, to generate the encoded data stream c.


The decoding device 120 serves as a receive end. The decoding device 120 receives the data stream c from the encoding device 110 through the channel 104, and decodes the data stream c to obtain an original information bit sequence u sent by the encoding device 110. The decoding device 120 may decode the data stream c in a decoding manner corresponding to an encoding manner of the encoding device 110. In some embodiments, the decoding device 120 may use the Hamming code as a decoding technology. In such an embodiment, the parity-check matrix H corresponding to the generator matrix G of the Hamming code may be configured for the decoding device 120. After receiving the data stream c, the decoding device 120 first determines a syndrome T based on the data stream c and the parity-check matrix H. If the syndrome is zero, that is, T=0, it indicates that the data stream c does not need to be corrected. If the syndrome is not zero, it indicates that an error exists in the data stream. In this case, the decoding device 120 corrects the data stream by flipping bits corresponding to a column vector that is consistent with the syndrome and that is in the parity-check matrix H, to obtain the original information bit sequence u.


According to an example embodiment of this disclosure, an optimized Hamming code is provided, to further shorten a bit length and implement double extension based on a conventional Hamming code. The optimized Hamming code is generated by using a relatively simple function, so that the Hamming code has lower design complexity. In addition, the optimized Hamming code can reduce encoding and decoding complexity for various code lengths and information bit lengths, and provide good interference resistance performance of a system.


A code length of the Hamming code (DE-Hamming) in this disclosure is 2m−q, and a length of information bits is 2m−2−m−q, where m is a positive integer, m≥3, and 0≤q<(2m−1)/2. A parity-check matrix HDE of the Hamming code is a matrix of m×(2m−1−q), and may be expressed as follows:










H
DE

=

[




0


H





D




1



]





(
2
)







Herein H is a parity-check matrix of a conventional Hamming code whose code length is 2m−1−q and whose information bit length is 2m−1−m−q, 1 represents an all-one row vector with a length of 2m−q, 0 represents an m-dimensional all-zero column vector, and D represents a not-all-zero row vector that is to be extended and whose length is 2m−q.


It may be determined from Formula (2) that the row vectors D and 1 are extended on the parity-check matrix of the conventional Hamming code, to obtain a parity-check matrix HDE of the Hamming code (DE-Hamming) in this disclosure. In other words, the parity-check matrix HDE includes an (m+2)-dimensional row vector. According to embodiments of this disclosure, an appropriate function is selected to generate the not-all-zero row vector D for extension, to effectively reduce design complexity of the Hamming code (DE-Hamming) in this disclosure, so that the Hamming code in this disclosure has better encoding and decoding performance than the conventional Hamming code and a conventional extended Hamming code (eHamming).


To determine the not-all-zero row vector D, a function g is considered, and the function may map an (m+2)-dimensional row vector of the parity-check matrix HDE to an (m+2)-dimensional column vector. Specifically, the function g maps the (m+2)-dimensional column vector based on an integer i, where 0≤i≤2m−q−1. Herein the function g may be determined as follows:










g

(
i
)

=

[




s

0
,
i







s

1
,
i












s


m
-
1

,
i







s

m
,
i






1



]





(
3
)







Herein i=2m-1sm-1,i+2m-2sm-2,i+ . . . +2s1,i+s0,i, s0,i, s1,i, . . . , and sm-1,i respectively represent elements of column vectors corresponding to a row vector of the parity-check matrix H, sm,i represent an element of a column vector corresponding to the not-all-zero row vector D, and all elements of a last column vector are 1.


Further, a function h may be used to determine sm,i. This is described as follows:






s
m,i
=h(s0,i,s1,i,s2,i)  (4)


The function h has a 3-bit input, that is, s0,i, s1,i, and s2,i, and outputs a 1-bit element sm,i.


Clearly, the function h has 28 input-output possibilities that form a set of the function h. The set of the function h may be represented by a truth table. Because a length of the not-all-zero row vector D is 2m−q, an output of the function h includes at least one value “1”. In addition, cases in which the output of the function h includes seven, six, and five 1 s are respectively equivalent to cases in which the output of the function h includes one, two, and three values “1”. Therefore, in an example embodiment, only cases in which the output of the function h includes one, two, three, and four values “1” are considered. In this way, the function h has C81+C82+C84+C84=8+28+56+70=162 possibilities. In other words, the set of the function h includes 162 functions, as shown in Table 1 to Table 4. Herein, the function hjj represents a jth case, where 0<j≤162.









TABLE 1







The output of the function h includes one value “1”

















Sequence












number
i %8
0
1
2
3
4
5
6
7
Logical expression




















0
h1
1
0
0
0
0
0
0
0
h = s0, is1, is2, i


1
h2
0
1
0
0
0
0
0
0
h = s0, i s1, is2, i


2
h3
0
0
1
0
0
0
0
0
h = s0, i ∧ s1, i s2, i


3
h4
0
0
0
1
0
0
0
0
h = s0, i ∧ s1, i s2, i


4
h5
0
0
0
0
1
0
0
0
h = s0, is1, i ∧ s2, i


5
h6
0
0
0
0
0
1
0
0
h = s0, i s1, i ∧ s2, i


6
h7
0
0
0
0
0
0
1
0
h = s0, i ∧ s1, i ∧ s2, i


7
h8
0
0
0
0
0
0
0
1
h = s0, i ∧ s1, i ∧ s2, i
















TABLE 2







The output of the function h includes two values “1”

















Sequence












number
i %8
0
1
2
3
4
5
6
7
Logical expression




















0
h9
1
1
0
0
0
0
0
0
h = (s0, is1, is2, i) ∨












(s0, i s1, is2, i) =













s1, is2, i



1
h10
1
0
1
0
0
0
0
0
h = (s0, is1, is2, i) ∨












(s0, i ∧ s1, i s2, i) =













s0, is2, i



2
h11
0
1
1
0
0
0
0
0
h = (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i s2, i)


3
h12
1
0
0
1
0
0
0
0
h = (s0, is1, is2, i) ∨












(s0, i ∧ s1, i s2, i)


4
h13
0
1
0
1
0
0
0
0
h = (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i s2, i) =












s0, i s2, i


5
h14
0
0
1
1
0
0
0
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i s2, i) =












s1, i s2, i


6
h15
1
0
0
0
1
0
0
0
h = (s0, is1, is2, i) ∨












(s0, is1, i ∧ s2, i) =













s0, is1, i



7
h16
0
1
0
0
1
0
0
0
h = (s0, i s1, is2, i) ∨












(s0, is1, i ∧ s2, i)


8
h17
0
0
1
0
1
0
0
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i)


9
h18
0
0
0
1
1
0
0
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i)


10
h19
1
0
0
0
0
1
0
0
h = (s0, is1, is2, i) ∨












(s0, i s1, i ∧ s2, i)


11
h20
0
1
0
0
0
1
0
0
h = (s0, i s1, is2, i) ∨












(s0, i s1, i ∧ s2, i) =












s0, i s1, i


12
h21
0
0
1
0
0
1
0
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i)


13
h22
0
0
0
1
0
1
0
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i)


14
h23
0
0
0
0
1
1
0
0
h = (s0, is1, i ∧ s2, i) ∨












(s0, i s1, i ∧ s2, i) =













s1, i ∧ s2, i



15
h24
1
0
0
0
0
0
1
0
h = (s0, is1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


16
h25
0
1
0
0
0
0
1
0
h = (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


17
h26
0
0
1
0
0
0
1
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =













s0, i ∧ s1, i



18
h27
0
0
0
1
0
0
1
0
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


19
h28
0
0
0
0
1
0
1
0
h = (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =













s0, i ∧ s2, i



20
h29
0
0
0
0
0
1
1
0
h = (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


21
h30
1
0
0
0
0
0
0
1
h = (s0, is1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


22
h31
0
1
0
0
0
0
0
1
h = (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


23
h32
0
0
1
0
0
0
0
1
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


24
h33
0
0
0
1
0
0
0
1
h = (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












s0, i ∧ s1, i


25
h34
0
0
0
0
1
0
0
1
h = (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


26
h35
0
0
0
0
0
1
0
1
h = (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












s0, i ∧ s2, i


27
h36
0
0
0
0
0
0
1
1
h = (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












s1, i ∧ s2, i
















TABLE 3







The output of the function h includes three values “1”

















Sequence












number
i %8
0
1
2
3
4
5
6
7
Logical expression




















0
h37
1
1
1
0
0
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i s2, i) =












(s1, is2, i) ∨ (s0, is2, i)


1
h38
1
1
0
1
0
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i s2, i) =












(s1, is2, i) ∨ (s0, i s2, i)


2
h39
1
0
1
1
0
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i s2, i) =












(s0, is2, i) ∨ (s1, i s2, i)


3
h40
0
1
1
1
0
0
0
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i s2, i) =












(s0, i s2, i) ∨ (s1, i s2, i)


4
h41
1
1
0
0
1
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, is1, i ∧ s2, i) =












(s1, is2, i) ∨ (s0, is1, i)


5
h42
1
0
1
0
1
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i) =












(s0, is2, i) ∨ (s0, is1, i)


6
h43
0
1
1
0
1
0
0
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i)


7
h44
1
0
0
1
1
0
0
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i) =












(s0, is1, i) ∨ (s0, i ∧ s1, i s2, i)


8
h45
0
1
0
1
1
0
0
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i) =












(s0, i s2, i) ∨ (s0, is1, i ∧ s2, i)


9
h46
0
0
1
1
1
0
0
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, is1, i ∧ s2, i) =












(s0, i s2, i) ∨ (s0, is1, i ∧ s2, i)


10
h47
1
1
0
0
0
1
0
0
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s1, is2, i) ∨ (s0, i s1, i)


11
h48
1
0
1
0
0
1
0
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s0, is2, i) ∨ (s0, i s1, i ∧ s2, i)


12
h49
0
1
1
0
0
1
0
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s0, i s1, i) ∨ (s0, i ∧ s1, i s2, i)


13
h50
1
0
0
1
0
1
0
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i)


14
h51
0
1
0
1
0
1
0
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s0, i s2, i) ∨ (s0, i s1, i)


15
h52
0
0
1
1
0
1
0
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s1, i s2, i) ∨ (s0, i ∧ s1, i s2, i)


16
h53
1
0
0
0
1
1
0
0
h = (s0, is1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s0, is1, i) ∨ (s1, i ∧ s2, i)


17
h54
0
1
0
0
1
1
0
0
h = (s0, i s1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s0, i s1, i) ∨ (s1, i ∧ s2, i)


18
h55
0
0
1
0
1
1
0
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, i ∧ s1, i s2, i)


19
h56
0
0
0
1
1
1
0
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, i ∧ s1, i s2, i)


20
h57
1
1
0
0
0
0
1
0
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, is2, i) ∨ (s0, i s1, is2, i)


21
h58
1
0
1
0
0
0
1
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, is2, i) ∨ (s0, i ∧ s1, i)


22
h59
0
1
1
0
0
0
1
0
∨(s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s0, i s1, is2, i)


23
h60
1
0
0
1
0
0
1
0
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


24
h61
0
1
0
1
0
0
1
0
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i s2, i) ∨ (s0, i s1, is2, i)


25
h62
0
0
1
1
0
0
1
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i s2, i) ∨ (s0, i ∧ s1, i)


26
h63
1
0
0
0
1
0
1
0
h = (s0, is1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, is1, i) ∨ (s0, i ∧ s2, i)


27
h64
0
1
0
0
1
0
1
0
h = (s0, i s1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s0, i s1, is2, i)


28
h65
0
0
1
0
1
0
1
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s0, i ∧ s2, i)


29
h66
0
0
0
1
1
0
1
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s0, i ∧ s1, i s2, i)


30
h67
1
0
0
0
0
1
1
0
h = (s0, is1, is2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


31
h68
0
1
0
0
0
1
1
0
h = (s0, i s1, is2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i s1, i) ∨ (s0, i ∧ s1, i ∧ s2, i)


32
h69
0
0
1
0
0
1
1
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s0, i s1, i ∧ s2, i)


33
h70
0
0
0
1
0
1
1
0
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


34
h71
0
0
0
0
1
1
1
0
h = (s0, is1, i ∧ s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, i ∧ s2, i)


35
h72
1
1
0
0
0
0
0
1
h = (s0, is1, is2, i) ∨ (s0, i s1, is2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, is2, i) ∨ (s0, i ∧ s2, i ∧ s2, i)


36
h73
1
0
1
0
0
0
0
1
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, is2, i) ∨ (s0, i ∧ s2, i ∧ s2, i)


37
h74
0
1
1
0
0
0
0
1
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


38
h75
1
0
0
1
0
0
0
1
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i 2, i) =












(s0, i ∧ s1, i) ∨ (s0, is1, is2, i)


39
h76
0
1
0
1
0
0
0
1
h = (0, i s1, is2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i s2, i) ∨ (s0, i ∧ s1, i)


40
h77
0
0
1
1
0
0
0
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i s2, i) ∨ (s0, i ∧ s1, i)


41
h78
1
0
0
0
1
0
0
1
h = (s0, is1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, is1, i) ∨ (s0, i ∧ s2, i ∧ s2, i)


42
h79
0
1
0
0
1
0
0
1
h = (s0, i s1, is2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


43
h80
0
0
1
0
1
0
0
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i)


44
h81
0
0
0
1
1
0
0
1
h = (s0, i 1, i s2, i) ∨ (s0, is1, i ∧ s2, i) ∨












(s0, i 1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s0, is1, i ∧ s2, i)


45
h82
1
0
0
0
0
1
0
1
h = (s0, is1, is2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s0, is1, is2, i)


46
h83
0
1
0
0
0
1
0
1
h = (s0, i s1, is2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i s1, i) ∨ (s0, i ∧ s2, i)


47
h84
0
0
1
0
0
1
0
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s0, i ∧ s1, i s2, i)


48
h85
0
0
0
1
0
1
0
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s0, i ∧ s2, i)


49
h86
0
0
0
0
1
1
0
1
h = (s0, is1, i ∧ s2, i) ∨ (s0, i s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, i ∧ s2, i)


50
h87
1
0
0
0
0
0
1
1
h = (s0, is1, is2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, is1, is2, i)


51
h88
0
1
0
0
0
0
1
1
h = (s0, i s1, is2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s1, i ∧ s2, i) ∨ (s0, i s1, is2, i)


52
h89
0
0
1
0
0
0
1
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s1, i ∧ s2, i)


53
h90
0
0
0
1
0
0
1
1
h = (s0, i ∧ s1, i s2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s1, i) ∨ (s1, i ∧ s2, i)


54
h91
0
0
0
0
1
0
1
1
h = (s0, is1, i ∧ s2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s1, i ∧ s2, i)


55
h92
0
0
0
0
0
1
1
1
h = (s0, i s1, i ∧ s2, i) ∨ (s0, i ∧ s1, i ∧ s2, i) ∨












(s0, i ∧ s1, i ∧ s2, i) =












(s0, i ∧ s2, i) ∨ (s1, i ∧ s2, i)
















TABLE 4







The output of the function h includes four values “1”

















Se-












quence












num-
i











ber
%8
0
1
2
3
4
5
6
7
Logical expression




















0
h93 
1
1
1
1
0
0
0
0
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i s2,i) = s2,i


1
h94 
1
1
1
0
1
0
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,is2,i)












∨ (s0,is1,i)


2
h95 
1
1
0
1
1
0
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,is1,i) ∨ (s0,i ∧ s2,i)


3
h96 
1
0
1
1
1
0
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


4
h97 
0
1
1
1
1
0
0
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


5
h98 
1
1
1
0
0
1
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s0,i ∧ s2,i)


6
h99 
1
1
0
1
0
1
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i)


7
h100
1
0
1
1
0
1
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


8
h101
0
1
1
1
0
1
0
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i text missing or illegible when filed  =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


9
h102
1
1
0
0
1
1
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












∨ (s0,i 1,i ∧ s2,i) = s1,i


10
h103
1
0
1
0
1
1
0
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


11
h104
0
1
1
0
1
1
0
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


12
h105
1
0
0
1
1
1
0
0
h = (s0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


13
h106
0
1
0
1
1
1
0
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












( 0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


14
h107
0
0
1
1
1
1
0
0
h = (s0,i ∧ s1,i s2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


15
h108
1
1
1
0
0
0
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)


16
h109
1
1
0
1
0
0
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


17
h110
1
0
1
1
0
0
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ 1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧  1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i)


18
h111
0
1
1
1
0
0
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s0,i ∧ s1,i)


19
h112
1
1
0
0
1
0
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)


20
h113
1
0
1
0
1
0
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) = s0,i


21
h114
0
1
1
0
1
0
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i s1,i ∧ s2,i)


22
h115
1
0
0
1
1
0
1
0
h = (s0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


23
h116
0
1
0
1
1
0
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s0,i ∧ s2,i)


24
h117
0
0
1
1
1
0
1
0
h = (s0,i ∧ s1,i s2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)


25
h118
1
1
0
0
0
1
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


26
h119
1
0
1
0
0
1
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


27
h120
0
1
1
0
0
1
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s1,i)


28
h121
1
0
0
1
0
1
1
0
h = (s0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


29
h122
0
1
0
1
0
1
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


30
h123
0
0
1
1
0
1
1
0
h = (s0,i ∧ s1,i s2,i) ∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


31
h124
1
0
0
0
1
1
1
0
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s2,i)


32
h125
0
1
0
0
1
1
1
0
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)


33
h126
0
0
1
0
1
1
1
0
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


34
h127
0
0
0
1
1
1
1
0
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


35
h128
1
1
1
0
0
0
0
1
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,is2,i)












∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


36
h129
1
1
0
1
0
0
0
1
h = ( 0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)


37
h130
1
0
1
1
0
0
0
1
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,is2,i) ∨ (s0,i ∧ s1,i)


38
h131
0
1
1
1
0
0
0
1
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i)


39
h132
1
1
0
0
1
0
0
1
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =


40
h133
1
0
1
0
1
0
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,is1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


41
h134
0
1
1
0
1
0
0
1
h = (s0,i s1,is2,i) ∨












(s0,i ∧ s1,i 2,i)












∨ ( 0,i ∧ s1,i ∧ s2,)












∨ (s0,i ∧ s1,i ∧ s2,i)


42
h135
1
0
0
1
1
0
0
1
h = (s0,is1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s1,i) ∨ s0,i ∧ s1,i)


43
h136
0
1
0
1
1
0
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


44
h137
0
0
1
1
1
0
0
1
h = (s0,i ∧ s1,i s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i s2,i) ∨ (s0,i ∧ s1,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


45
h138
1
1
0
0
0
1
0
1
h = (s0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s1,i) ∨ s0,i ∧ s2,i)


46
h139
1
0
1
0
0
1
0
1
h = (s0,i ∧ s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s0,i ∧  2,i)


47
h140
0
1
1
0
0
1
0
1
h = (s0,i s1,is2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


48
h141
1
0
0
1
0
1
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


49
h142
0
1
0
1
0
1
0
1
h = (s0,i s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) = s0,i


50
h143
0
0
1
1
0
1
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0,i ∧ s2,i)


51
h144
1
0
0
0
1
1
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)


52
h145
0
1
0
0
1
1
0
1
h = (s0,i s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i 1,i) ∨ ( 1,i ∧ s2,i)












∨ (s0, ∧ s2,i)


53
h146
0
0
1
0
1
1
0
1
h = (s0,i ∧ s1,i s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s0, ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


54
h147
0
0
0
1
1
1
0
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


55
h148
1
1
0
0
0
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s1,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


56
h149
1
0
1
0
0
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


57
h150
0
1
1
0
0
0
1
1
h = (s0,i s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i s1,i ∧ s2,i)


58
h151
1
0
0
1
0
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


59
h152
0
1
0
1
0
0
1
1
h = (s0,i s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)


60
h153
0
0
1
1
0
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) = s1,i


61
h154
1
0
0
0
1
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


62
h155
0
1
0
0
1
0
1
1
h = (s0,i s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i s1,i ∧ s2,i)


63
h156
0
0
1
0
1
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s1,i ∧ s2,i)


64
h157
0
0
0
1
1
0
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)


65
h158
1
0
0
0
0
1
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)


66
h159
0
1
0
0
0
1
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)


67
h160
0
0
1
0
0
1
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)


68
h161
0
0
0
1
0
1
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) =












(s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)












∨ (s1,i ∧ s2,i)


69
h162
0
0
0
0
1
1
1
1
h = (s0,i ∧ s1,i ∧ s2,i) ∨ (s0,i s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i)












∨ (s0,i ∧ s1,i ∧ s2,i) = s2,i






text missing or illegible when filed indicates data missing or illegible when filed







For a given function hj in the set of the function h: h1 to h162, 0<j≤162, and the following parity-check matrix Hj with a size of (m+2)×(2m−q) is determined:






H
j
=[g(0),g(1),g(2), . . . ,g(2m−q−1)]  (5)


Based on Formula (5), the function g may be determined as follows:










g

(
i
)

=


[




s

0
,
i







s

1
,
i












s


m
-
1

,
i







s

m
,
i






1



]

=

[




s

0
,
i







s

1
,
i












s


m
-
1

,
i








h
j

(


s

0
,
i


,

s

1
,
i


,

s

2
,
i



)





1



]






(
6
)







Further, a rank of the parity-check matrix Hj is determined. If the parity-check matrix Hj is not non-singular, it indicates that the function hj corresponding to the parity-check matrix Hj is unavailable. Otherwise, if the parity-check matrix Hj is a non-singular matrix, it indicates that the function h 1 corresponding to the parity-check matrix Hj is available.


In some example embodiments, a non-singular parity-check matrix Hj is transformed into a systematic form. For example, m+2 linearly independent column vectors may be selected from the parity-check matrix Hj from right to left, and these column vectors are moved to the rightmost of the parity-check matrix Hj, as shown below:






H
DE,j
=[H
L
;H
R]  (7)


Herein HR represents a right part of a parity-check matrix HDE,j, and is a matrix that includes m+2 linearly independent column vectors and whose size is (m+2)×(m+2); and HL represents an (m+2)×(2m−2−m−q) matrix obtained after the matrix HR is removed from the matrix Hj.


Further, elementary row transformation is performed on the parity-check matrix HDE,j, so that a right part of the parity-check matrix is an identity matrix, to obtain a system check matrix Hsys,j:






H
sys,j
=[P;I]  (8)


Herein I represents an identity matrix with a size of (m+2)×(m+2), P represents a matrix with a size of (m+2)×(2m−2−m−q), and P=(HR)−1HL.


Further, for the function hj, a generator matrix Gj that is of a system Hamming code and whose size is (2m−2−m−q)×(2m−q) may be determined according to Formula (9):






G
j
=[I;P
T]  (9)


Herein I represents an identity matrix with a size of (2m−2−m−q)×(2m−2−m−q).


Herein, encoding complexity of the Hamming code is related to a quantity of elements 1 in the matrix P, and the quantity of elements 1 is denoted as custom-character. Therefore, in some example embodiments, the parameter custom-character may be used as an indicator indicating the encoding complexity of the Hamming code (DE-Hamming) in this disclosure.


Based on the system check matrix Hsys,j, a weight hierarchy of the Hamming code (DE-Hamming) in this disclosure may be further determined. Since a quantity Aj of minimum code weights 4 has dominant impact on performance of the Hamming code, in some example embodiments, the parameter Aj may be used as an indicator indicating the performance of the Hamming code.


For the set of the function h shown in Table 1 to Table 4, that is, functions h1 to h162, the foregoing operations are repeated, and parameters custom-character and Aj that respectively indicate the encoding complexity and the Hamming code performance are determined. Based on one or more of the parameters custom-character and Aj, the target function h(s0,i,s1,i,s2,i), the target parity-check matrix HDE, and the generator matrix G for generating the Hamming code that can provide low encoding complexity and excellent performance can be determined.


The following briefly describes a Hamming code generating method according to an embodiment of this disclosure. In some embodiments, corresponding parity-check matrices Hj may be determined for all the functions h1 to h162 in the set of the function h. In some other embodiments, parity-check matrices Hj obtained by using some functions h in the set of the function h are definitely not non-singular, for example, functions h93, h102, h113, h142, h153, and h162 in Table 1 to Table 4. In consideration of this, subsequent steps may not be performed for these functions h and their parity-check matrices Hj. In this embodiment, a predetermined function set that includes some functions in the set of the function h may be used, and includes a plurality of candidate functions h.


The predetermined function set is used as an example. A plurality of corresponding candidate parity-check matrices Hj may be determined based on the plurality of candidate functions h. A non-singular matrix is selected from these candidate parity-check matrices Hj as a first candidate parity-check matrix set. The first candidate parity-check matrix set is transformed to obtain a second candidate parity-check matrix set in a systematic form. For the second candidate parity-check matrix set, matrices P corresponding to the second candidate parity-check matrix set may be first sorted based on parameters custom-character, and a matrix P with a parameter custom-character less than a predetermined threshold is selected from the second candidate parity-check matrix set. Then, parity-check matrices HDE corresponding to these matrices P are determined as a first group of candidate parity-check matrices. Further, a target parity-check matrix HDE may be determined from the first group of candidate parity-check matrices, and a target function h(s0,i,s1,i,s2,i) corresponding to the target parity-check matrix may be determined. In this embodiment, the predetermined threshold may be a predetermined quantity of elements 1. Additionally, or alternatively, a matrix P with a minimum value in all the parameters custom-character may be selected.


In an implementation of the foregoing embodiment, a corresponding parameter Aj may be further determined for each candidate parity-check matrix in the determined first group of candidate parity-check matrices. Then, based on the parameter Aj, the target parity-check matrix is determined from the first group of candidate parity-check matrices, and the corresponding function h is determined as the target function h(s0,i,s1,i,s2,i). For example, a candidate parity-check matrix with a minimum quantity of minimum code weights may be selected from the first group of candidate parity-check matrices as a second group of candidate parity-check matrices based on the parameter Aj. Then, the target parity-check matrix is determined from the second group of candidate parity-check matrices, and the corresponding function h is determined as the target function h(s0,i,s1,i,s2,i).


In other example embodiments, the parameter Aj may be considered first. Similarly, the predetermined function set is used as an example. A plurality of corresponding candidate parity-check matrices Hj may be determined. A non-singular matrix is selected from these candidate parity-check matrices Hj as a first candidate parity-check matrix set. Similarly, the first candidate parity-check matrix set is transformed to obtain a second candidate parity-check matrix set in a systematic form. For the second candidate parity-check matrix set, sorting may be performed based on the parameter Aj, and a parity-check matrix with a minimum quantity of minimum code weights is selected from the second candidate parity-check matrix set as a first group of candidate parity-check matrices. Further, the target parity-check matrix is determined from the first group of candidate parity-check matrices.


In an implementation of the foregoing embodiment, a corresponding parameter custom-character may be further determined for each candidate parity-check matrix in the determined first group of candidate parity-check matrices. Then, based on the parameter custom-character, the target parity-check matrix is determined from the first group of candidate parity-check matrices, and the corresponding function h is determined as the target function h(s0,i,s1,i,s2,i). For example, a candidate parity-check matrix with a parameter custom-character less than a predetermined threshold may be selected as a second group of candidate parity-check matrices based on a parameter custom-character associated with each candidate parity-check matrix in the first group of candidate parity-check matrices. For example, a candidate parity-check matrix with a minimum quantity of minimum code weights may be selected from the first group of candidate parity-check matrices as the second group of candidate parity-check matrices. Then, the target parity-check matrix is determined from the second group of candidate parity-check matrices, and the corresponding function h is determined as the target function h(s0,i,s1,i,s2,i).


In an implementation of determining the target parity-check matrix from the second group of candidate parity-check matrices, an operation quantity of a function h that is in the set of the function h and that corresponds to each candidate parity-check matrix in the second group of candidate parity-check matrices may be determined, to determine, based on the operation quantity, the corresponding target function h(s0,i,s1,i,s2,i) and the target parity-check matrix from the second group of candidate parity-check matrices. For example, a function h with a minimum operation quantity is selected as the target function h(s0,i,s1,i,s2,i).


In an example embodiment of this disclosure, the predetermined function set for determining the target function h(s0,i,s1,i,s2,i) may be obtained according to logical expressions of the function h shown in Table 1 to Table 4, and the predetermined function set includes one or more of the following functions: h(s0,i,s1,i,s2,i)=s0,i∧s1,is2,i, h(s0,i,s1,i,s2,i)=s0,is1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s1,i ∧s2,i, h(s0,i,s1,i,s2,i)=(s0,i∧s2,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,is1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∨s2,i), h(s0,i,s1,i,s2,i)=(s1,is2,i)∨(s0,1∧s2,i), and h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,i∧s2,i) that respectively correspond to h4, h6, h7, h33, h35, h36, h40, h54, h65, h143, and h152 in Table 1 to Table 4. However, it should be understood that the predetermined function set and the universal set of the function h provided above are merely examples. In practice, according to a requirement, more or fewer candidate functions may be included, and a candidate function h that is not shown in Table 1 to Table 4 may be included. The scope of this disclosure is not limited in this aspect.


According to an embodiment of this disclosure, a Hamming code generating method is provided. According to the method, for various code lengths and information bit lengths, an appropriate function is selected from a function set for determining a parity-check matrix. Therefore, a generated Hamming code can implement excellent performance and reduce encoding and decoding complexity at both encoding and decoding ends, thereby enhancing performance of a communication system and improving communication quality.


An optimized Hamming code according to embodiments of this disclosure, an example encoding process, and an example decoding process based on the optimized Hamming code are discussed in detail below with reference to FIG. 2 to FIG. 5.



FIG. 2 is a flowchart of an encoding method 200 according to an example embodiment of this disclosure. The method 200 may be implemented by the encoding device 110 shown in FIG. 1, and may involve the channel 104 and the decoding device 120 shown in FIG. 1. For ease of discussion, the following describes the method 200 with reference to FIG. 1. It should be understood that the method 200 is also applicable to other communication scenarios and other encoding devices.


At a block 201, the encoding device 110 obtains a generator matrix G for encoding. The generator matrix G is determined based on a target parity-check matrix HDE of a Hamming code for encoding. In some example embodiments, the target parity-check matrix HDE is determined based on a target function h(s0,i,s1,i,s2,i) for decoding. The target function h(s0,i,s1,i,s2,i) is one of a predetermined function set, and is used to determine a not-all-zero row vector D extended based on the target parity-check matrix HDE.


The predetermined function set may include a plurality of candidate functions for determining the not-all-zero row vector D extended based on the target parity-check matrix HDE. In some example embodiments, the target function h(s0,i,s1,i,s2,i) may determine the not-all-zero row vector D based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector D. For example, the predetermined function set may include one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,is2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,is1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,i s2,i)∨(s1,is2,i), h(s0,i,s1,i,s2,i)=(s0,is1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,is2,i)∨(s0,i∨s2,i), and h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,i∧s2,i). For another example, the predetermined function set may alternatively include some or all functions h shown in Table 1 to Table 4, or functions not shown in Table 1 to Table 4.


In some example embodiments, a specified code length of the Hamming code is 180, a length of to-be-sent information bits is 170, all elements in a ninth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i. Herein i is an integer greater than or equal to 0 and less than 180, i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In some other example embodiments, a specified code length of the Hamming code is 128, and a length of to-be-sent information bits is 119. In this embodiment, all elements s8,i in an eighth row of the target parity-check matrix HDE are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector D as one of s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 128, i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In still other example embodiments, a specified code length of the Hamming code is 64, and a length of information bits is 56. In this embodiment, all elements s7,i in a seventh row of the target parity-check matrix HDE are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In some example embodiments, the generator matrix G is determined by using a system check matrix, and the system check matrix is obtained by transforming the target parity-check matrix HDE, for example, as described in the foregoing Hamming code generating method provided in embodiments of this disclosure.


In an example implementation of determining the target parity-check matrix HDE, a plurality of candidate parity-check matrices Hj may be determined based on a plurality of candidate functions hj. A non-singular matrix is selected from the plurality of candidate parity-check matrices Hj, to obtain a first candidate parity-check matrix set. Then, the first candidate parity-check matrix set is transformed to a second candidate parity-check matrix set in a systematic form. An associated third parameter may be determined for each candidate parity-check matrix in the second candidate parity-check matrix set. For example, the third parameter may indicate encoding complexity of the Hamming code. A first group of candidate parity-check matrices may be selected from the first candidate parity-check matrix set based on the third parameter. Then, the target parity-check matrix HDE may be determined from the first group of candidate parity-check matrices.


In some example embodiments, the target parity-check matrix HDE may be further determined from the first group of candidate parity-check matrices based on a fourth parameter indicating a quantity of minimum code weights of the Hamming code. Specifically, the associated fourth parameter is determined for each candidate parity-check matrix in the first group of candidate parity-check matrices, and the fourth parameter may indicate a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices. A second group of candidate parity-check matrices may be selected from the first group of candidate parity-check matrices based on the determined fourth parameter. Then, the target parity-check matrix HDE may be determined from the second group of candidate parity-check matrices.


In another example implementation of determining the target parity-check matrix HDE, after the second candidate parity-check matrix set in the systematic form is obtained, a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set may be determined. For example, the fourth parameter may indicate a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set. The first group of candidate parity-check matrices may be selected from the first candidate parity-check matrix set based on the fourth parameter. For example, a candidate parity-check matrix corresponding to the Hamming code with a minimum quantity of minimum code weights may be selected as the first group of candidate parity-check matrices. Then, the target parity-check matrix HDE may be determined from the first group of candidate parity-check matrices.


In some example embodiments, the target parity-check matrix HDE may be further determined from the first group of candidate parity-check matrices based on the third parameter indicating the encoding complexity of the Hamming code. Specifically, an associated third parameter may be determined for each candidate parity-check matrix in the first group of candidate parity-check matrices. For example, the third parameter may indicate the encoding complexity of the Hamming code. Then a second group of candidate parity-check matrices may be selected from the first group of candidate parity-check matrices based on the determined third parameter. For example, the second group of candidate parity-check matrices has the third parameter less than a predetermined threshold. Additionally, or alternatively, a candidate parity-check matrix with the lowest encoding complexity may be selected as the second group of candidate parity-check matrices. Then, the target parity-check matrix HDE may be determined from the second group of candidate parity-check matrices.


In an example implementation of determining the target parity-check matrix HDE from the second group of candidate parity-check matrices, an operation quantity of a function hj corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set may be further determined, for example, a total quantity of operators “negate b”, “and ∧”, and “or ∨” in a logical expression of the function hj. Then, the target parity-check matrix HDE is determined based on the determined operation quantity. For example, a target function hj with a minimum operation quantity may be selected as the target function h(s0,i,s1,i,s2,i), and a parity-check matrix HDE,j corresponding to the target function is determined as the target parity-check matrix HDE.


In some example embodiments, for each candidate parity-check matrix in the first candidate parity-check matrix set, at least some linearly independent column vectors are moved from right to left to the rightmost of the corresponding candidate parity-check matrix, and elementary row transformation is performed, so that a right part of the corresponding candidate parity-check matrix is an identity matrix, to obtain the second candidate parity-check matrix set in the systematic form.


At a block 202, the encoding device 110 encodes an information bit sequence by using the generator matrix G to obtain an encoded data stream c. For example, for the information bit sequence b, the encoded data stream corresponding to the information bit sequence is c=bG.


At a block 203, the encoding device 110 sends the encoded data stream. For example, the encoding device 110 may send the encoded data stream to the decoding device 120 through the channel 104.


According to this embodiment of this disclosure, the encoding method is provided. In the method, a double-extended Hamming code is obtained based on a conventional Hamming code, and the parity-check matrix HDE is generated by selecting an appropriate function hj. Therefore, in specific code space, both encoding complexity custom-character and a quantity Aj of minimum code weights 4 of the designed double-extended Hamming code are minimum. In addition, a target function with a minimum quantity of operations (for example, “negate b”, “and ∧”, or “or ∨”) in a logical expression of a function may be selected, to reduce encoding complexity of using the Hamming code.



FIG. 3 is a flowchart of a decoding method 300 according to an example embodiment of this disclosure. The method 300 may be implemented by the decoding device 120 shown in FIG. 1, and may involve the channel 104 and the encoding device 110 shown in FIG. 1. For ease of discussion, the following describes the method 300 with reference to FIG. 1. It should be understood that the method 300 is also applicable to other communication scenarios and other decoding devices.


At a block 301, the decoding device 120 receives a data stream. For example, the decoding device 120 may receive, from the encoding device 110 through the channel 104, the data stream encoded by using a Hamming code.


At a block 302, the decoding device 120 obtains a target parity-check matrix HDE of a Hamming code for decoding. In some example embodiments, the target parity-check matrix HDE is determined based on a target function h(s0,i,s1,i,s2,i) for decoding. The target function h(s0,i,s1,i,s2,i) is one of a predetermined function set, and is used to determine a not-all-zero row vector D extended based on the target parity-check matrix HDE.


The predetermined function set may include a plurality of candidate functions for determining the not-all-zero row vector D extended based on the target parity-check matrix HDE. In some example embodiments, the target function h(s0,i,s1,i,s2,i) may determine the not-all-zero row vector D based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector D. For example, the predetermined function set may include one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,is2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,is1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,is2,i, h(s0,i,s1,i,s2,i)=(s0,is1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,is2,i)∨(s0,i∨s2,i), and h(s0,i,s1,i,s2,i)=(s0,is2,i)∨(s1,i∧s2,i). For another example, the predetermined function set may alternatively include some or all functions h shown in Table 1 to Table 4, or functions not shown in Table 1 to Table 4.


In some example embodiments, a specified code length of the Hamming code is 180, a length of received information bits is 170, all elements in a ninth row of the target parity-check matrix are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i. Herein i is an integer greater than or equal to 0 and less than 180, i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In some other example embodiments, a specified code length of the Hamming code is 128, and a length of received information bits is 119. In this embodiment, all elements s8,i in an eighth row of the target parity-check matrix HDE are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector D as one of s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 128, i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In still other example embodiments, a specified code length of the Hamming code is 64, and a length of information bits is 56. In this embodiment, all elements s7,i in a seventh row of the target parity-check matrix HDE are 1, and the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i. Herein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+s0,i, and s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


In some example embodiments, a generator matrix G is determined by using a system check matrix, and the system check matrix is obtained by transforming the target parity-check matrix HDE, for example, as described in the foregoing Hamming code generating method provided in embodiments of this disclosure.


In an example implementation of determining the target parity-check matrix HDE, a plurality of candidate parity-check matrices Hj may be determined based on a plurality of candidate functions hj. A non-singular matrix is selected from the plurality of candidate parity-check matrices Hj, to obtain a first candidate parity-check matrix set. Then, the first candidate parity-check matrix set is transformed to a second candidate parity-check matrix set in a systematic form. An associated third parameter may be determined for each candidate parity-check matrix in the second candidate parity-check matrix set. For example, the third parameter may indicate encoding complexity of the Hamming code. The first group of candidate parity-check matrices may be selected from the first candidate parity-check matrix set based on the third parameter. Then, the target parity-check matrix HDE may be determined from the first group of candidate parity-check matrices.


In some example embodiments, the target parity-check matrix HDE may be further determined from the first group of candidate parity-check matrices based on a fourth parameter indicating a quantity of minimum code weights of the Hamming code. Specifically, the associated fourth parameter is determined for each candidate parity-check matrix in the first group of candidate parity-check matrices, and the fourth parameter may indicate a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices. A second group of candidate parity-check matrices may be selected from the first group of candidate parity-check matrices based on the determined fourth parameter. Then, the target parity-check matrix HDE may be determined from the second group of candidate parity-check matrices.


In another example implementation of determining the target parity-check matrix HDE, after the second candidate parity-check matrix set in the systematic form is obtained, a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set may be determined. For example, the fourth parameter may indicate a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set. The first group of candidate parity-check matrices may be selected from the first candidate parity-check matrix set based on the fourth parameter. For example, a candidate parity-check matrix corresponding to the Hamming code with a minimum quantity of minimum code weights may be selected as the first group of candidate parity-check matrices. Then, the target parity-check matrix HDE may be determined from the first group of candidate parity-check matrices.


In some example embodiments, the target parity-check matrix HDE may be further determined from the first group of candidate parity-check matrices based on the third parameter indicating the encoding complexity of the Hamming code. Specifically, an associated third parameter may be determined for each candidate parity-check matrix in the first group of candidate parity-check matrices. For example, the third parameter may indicate the encoding complexity of the Hamming code. Then a second group of candidate parity-check matrices may be selected from the first group of candidate parity-check matrices based on the determined third parameter. For example, the second group of candidate parity-check matrices has the third parameter less than a predetermined threshold. Additionally, or alternatively, a candidate parity-check matrix with the lowest encoding complexity may be selected as the second group of candidate parity-check matrices. Then, the target parity-check matrix HDE may be determined from the second group of candidate parity-check matrices.


In an example implementation of determining the target parity-check matrix HDE from the second group of candidate parity-check matrices, an operation quantity of a function hj corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set may be further determined, for example, a total quantity of operators “negate b”, “and ∧”, and “or ∨” in a logical expression of the function hj. Then, the target parity-check matrix HDE is determined based on the determined operation quantity. For example, a target function hj with a minimum operation quantity may be selected as the target function h(s0,i,s1,i,s2,i), and a parity-check matrix HDE,j corresponding to the target function is determined as the target parity-check matrix HDE.


In some example embodiments, for each candidate parity-check matrix in the first candidate parity-check matrix set, at least some linearly independent column vectors are moved from right to left to the rightmost of the corresponding candidate parity-check matrix, and elementary row transformation is performed, so that a right part of the corresponding candidate parity-check matrix is an identity matrix, to obtain the second candidate parity-check matrix set in the systematic form.


At a block 303, the decoding device 120 decodes the data stream by using the target parity-check matrix HDE. In this way, the decoding device 120 may obtain original information bits sent by a transmit end.


In some example embodiments, the decoding device 120 may calculate a syndrome for the data based on the target parity-check matrix HDE. If the syndrome is zero, at least some bits of the data stream may be output as decoded information bits. Otherwise, if the syndrome is not zero, it is determined whether there is a first column vector equal to the syndrome in the target parity-check matrix HDE. If there is the first column vector equal to the syndrome in the target parity-check matrix, bits in the data stream that correspond to the first column vector are flipped, and at least some bits of the data stream after the flipping are output as the decoded information bits.


According to an example embodiment of this disclosure, a decoding method is provided. This method uses the double-extended Hamming code based on a conventional Hamming code. The parity-check matrix HDE of the Hamming code is generated by using a more concise target function selected from the predetermined function set based on the complexity custom-character, the quantity Aj of minimum code weights, and the quantity of operations (for example, “negate b”, “and ∧”, “or ∨”) of the logical expression of the function. In this way, in specific code space, by using the designed double-extended Hamming code, a same data stream is generated at the transmit end, and lower decoding complexity can be implemented at a receive end, thereby improving performance of a communication system and further reducing a bit error rate.


Although the steps of the foregoing methods 200 and 300 are described in a particular order, the order is merely for illustration instead of limitation. Unless expressly stated, it should not be understood that such processes are required to be completed in the shown particular order or in a successive order. In some cases, multitasking or parallel processing is advantageous. In addition, the methods 200 and 300 may further include additional operations that are not shown, and/or one or more shown operations may be omitted.


The following describes some example embodiments of this disclosure.


First Embodiment

In a first embodiment of this disclosure, an improved Hamming code (DE-Hamming) (180, 170) is provided. A code length is 180, and a length of to-be-sent information bits is 170. The Hamming code (DE-Hamming) according to this disclosure may be obtained by shortening 76 bits based on a conventional Hamming code (255, 247) and performing double extension, that is, m=8 and q=76. It may be considered that decoding is performed based on a finite field GF(28). A target parity-check matrix HDE of the Hamming code (DE-Hamming) according to this disclosure has a form of Formula (2).


In this embodiment, a size of a parity-check matrix H of a shortened Hamming code (179,171) is 8×179, 1 is an all-one row vector with a length of 180, 0 is an all-zero column vector whose length is 8, and a length of a not-all-zero row vector D of the target parity-check matrix HDE is 180. The following can be obtained according to Formula (3):










g

(
i
)

=

[




s

0
,
i







s

1
,
i












s

7
,
i







s

8
,
i






1



]





(
10
)







Herein i is an integer greater than or equal to 0 and less than 180, i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and elements in a ninth row of the target parity-check matrix HDE are all 1. A target function h(s0,i,s1,i,s2,i) of the Hamming code (DE-Hamming) according to this disclosure determines an element s8,i of a column vector corresponding to the not-all-zero row vector D as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, and s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


According to Formula (6) and Table 1 to Table 4, the following candidate parity-check matrix Hj with a size of 10×180 may be determined, where 0<j≤162.






H
j
=[g(0),g(1),g(2), . . . ,g(179)]  (11)


A non-singular matrix is selected from a plurality of candidate parity-check matrices Hj, to obtain a first candidate parity-check matrix set. Further, the first candidate parity-check matrix set is transformed to a second candidate parity-check matrix set in a systematic form according to Formula (7). Specifically, in this embodiment, 10 linearly independent column vectors are selected from the candidate parity-check matrices Hj from right to left, and are moved to the rightmost of the matrix. Herein HR is a 10×10 matrix formed by the 10 linearly independent column vectors, and HL is a 10×170 matrix obtained after HR is removed from the candidate parity-check matrix Hj.


Further, according to Formula (8), a system check matrix Hsys,j may be obtained through elementary row transformation. Herein I is a 10×10 identity matrix, and a matrix P=(HR)−1HL has a size of 10×170.


A generator matrix Gj with a size of 170×180 may be determined according to Formula (9).


For the 162 functions hj shown in Table 1 to Table 4, corresponding candidate parity-check matrices Hj are respectively obtained according to Formula (4) and Formula (5). It may be determined that 14 matrices in the 162 candidate parity-check matrices Hj are not non-singular matrices. For 148 non-singular matrices Hj, eight linearly independent column vectors are selected from right to left and moved to the rightmost of the matrix through transformation according to Formula (7), to obtain a first group of candidate parity-check matrices HDE,j.


From the first group of candidate parity-check matrices HDE,j, based on a third parameter custom-character indicating encoding complexity and a fourth parameter Aj indicating a quantity of minimum code weights 4, a target parity-check matrix HDE may be selected, and a target function h(s0,i,s1,i,s2,i) may be selected. Table 5 shows a logical expression of a candidate function hj for this embodiment and an operation quantity custom-character corresponding to the candidate function.









TABLE 5







Predetermined function set of the Hamming code


(180, 170) according to this disclosure

















i












%8
0
1
2
3
4
5
6
7
Logical expression
custom-characterj





h15
1
0
0
0
1
0
0
0
s8,i = s0,i ∧ s1,i
3


h20
0
1
0
0
0
1
0
0
s8,i = s0,i ∧ s1,i
2


h26
0
0
1
0
0
0
1
0
s8,i = s0,i ∧ s1,i
2


h33
0
0
0
1
0
0
0
1
s8,i = s0,i ∧ s1,i
1


h97
0
1
1
1
1
0
0
0
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h100
1
0
1
1
0
1
0
0
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h109
1
1
0
1
0
0
1
0
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h127
0
0
0
1
1
1
1
0
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h128
1
1
1
0
0
0
0
1
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h146
0
0
1
0
1
1
0
1
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h155
0
1
0
0
1
0
1
1
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9


h158
1
0
0
0
0
1
1
1
s8,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i) ∨ (s0,i ∧ s1,i ∧ s2,i)
9









It may be determined from Table 5 that, according to the first embodiment, the encoding complexity of the Hamming code is that custom-character=706, and the quantity of minimum code weights 4 is that Aj=107660.


Further, a function with lower complexity may be selected from the 12 candidate functions h based on the operation quantities custom-character shown in Table 5. In this embodiment, function complexity of h33=s0,i∧s1,i is that custom-character33=1 and is the lowest among the 12 candidate functions h, and complexity of a shortened double-extended Hamming code corresponding to this function is lower.



FIG. 4 is a diagram of performance of a double-extended Hamming-code (180, 170) and a conventional extended Hamming-code (180, 170) according to an example embodiment of this disclosure. Herein the double-extended Hamming-code (DE-Hamming) (180, 170) uses maximum a posteriori decoding(maximum a posteriori decoding, MAP). In this example, the conventional extended Hamming code (eHamming) (180, 170) is shortened by 332 bits and implements single-bit extension based on the conventional Hamming code (Hamming) (511, 502). Decoding for the conventional extended Hamming code may be considered to be implemented based on a finite field GF(29). As shown in FIG. 4, the Hamming code (DE-Hamming) (180, 170) according to this disclosure has better performance than the conventional extended Hamming code (eHamming) (180, 170). In addition, hard-decision decoding of the double-extended Hamming code (DE-Hamming) (180, 170) according to this disclosure is based on a finite field GF(28), while hard-decision decoding of the conventional extended Hamming codes (eHamming) (180, 170) is based on a finite field GF(29). Therefore, decoding complexity of the double-extended Hamming code (DE-Hamming) (180, 170) provided in this disclosure is lower than that of the conventional extended Hamming code (180, 170).


The conventional extended Hamming code (180, 170) uses a function shown in Formula (12):






s
8,i=(s0,i∧s2,i)∧(s0,is1,is2,i)∨(s0,i∧s1,is2,i)  (12)


Encoding complexity of the conventional extended Hamming code (180, 170) is 748, and a quantity of minimum code weights 4 is 107749. Encoding complexity of the double-extended Hamming code (DE-Hamming) (180, 170) provided in this disclosure is 706, and a quantity of minimum code weights 4 is 107660, which are both better than the conventional extended Hamming code (180, 170). In addition, in the first embodiment, a function logical expression of the target function s8,i=h33=s0,1∧s1,i is simpler than Formula (12). Therefore, function complexity of the double-extended Hamming code (DE-Hamming) provided in this disclosure is also lower.


Second Embodiment

In a second embodiment of this disclosure, an improved Hamming code (DE-Hamming) (128, 119) is provided. A code length is 128, a length of to-be-sent information bits is 119, m=7, and q=0. The Hamming code (DE-Hamming) (128, 119) according to this disclosure may be obtained through performing double extension based on a conventional Hamming code (Hamming) (127, 120), that is, m=7, and q=0. It may be considered that decoding is performed based on a finite field GF(27). A target parity-check matrix HDE of the Hamming code (DE-Hamming) (128, 119) according to this disclosure has a form of Formula (2).


In this embodiment, a size of a parity-check matrix H of the conventional Hamming code (Hamming) (127, 120) is 8×179, 1 is an all-one row vector with a length of 128, 0 is an all-zero column vector with a length of 7, and a length of a not-all-zero row vector D of the target parity-check matrix HDE is 128. The following can be obtained according to Formula (3):










g

(
i
)

=

[




s

0
,
i







s

1
,
i












s

6
,
i







s

7
,
i






1



]





(
13
)







Herein i is an integer greater than or equal to 0 and less than 128, i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and elements in an eighth row of the target parity-check matrix HDE are all 1. A target function h(s0,i,s1,i,s2,i) of the Hamming code (DE-Hamming) according to this disclosure determines an element s7,i of a column vector corresponding to a not-all-zero row vector D as one of s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, and s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


According to Formula (5) and Table 1 to Table 4, the following candidate parity-check matrix Hj with a size of 9×128 may be determined, where 0<j≤162.






H
j
=[g(0),g(1),g(2), . . . ,g(127)]  (14)


A non-singular matrix is selected from a plurality of candidate parity-check matrices Hj, to obtain a first candidate parity-check matrix set. Further, the first candidate parity-check matrix set is transformed to a second candidate parity-check matrix set in a systematic form according to Formula (7). Specifically, in this embodiment, 9 linearly independent column vectors are selected from the candidate parity-check matrices Hj from right to left, and are moved to the rightmost of the matrix. Herein HR is a 9×9 matrix formed by the 9 linearly independent column vectors, and HL is a 9×128 matrix obtained after HR is removed from the candidate parity-check matrix Hj.


Further, according to Formula (8), a system check matrix Hsys,j may be obtained through elementary row transformation. Herein I is a 9×9 identity matrix, and a matrix P=(HR)−1HL has a size of 9×119.


A generator matrix Gj with a size of 119×128 may be determined according to Formula (9).


For a first group of candidate parity-check matrices HDE,j, corresponding candidate parity-check matrices Hj may be respectively obtained according to Formula (4) and Formula (5) for the 162 functions h 1 shown in Table 1 to Table 4. It may be determined that 14 matrices in the 162 candidate parity-check matrices Hj are not non-singular matrices. For 148 non-singular matrices Hj, 9 linearly independent column vectors are selected from right to left and moved to the rightmost of the matrix through transformation according to Formula (7), to obtain the first group of candidate parity-check matrices HDE,j.


Based on a third parameter custom-character indicating encoding complexity and a fourth parameter Aj indicating a quantity of minimum code weights 4, a target parity-check matrix HDE may be selected, and a target function h(s0,i,s1,i,s2,i) may be selected. Table 6 shows a logical expression of a candidate function hj for this embodiment and an operation quantity custom-character corresponding to the candidate function.









TABLE 6







Predetermined function set of the Hamming code


(128, 119) according to this disclosure

















i %8
0
1
2
3
4
5
6
7
Logical expression
custom-characterj





h9
1
1
0
0
0
0
0
0
s7,i = s1,i ∧ s2,i
3


h10
1
0
1
0
0
0
0
0
s7,i = s0,i ∧ s2,i
3


h13
0
1
0
1
0
0
0
0
s7,i = s0,i ∧ s2,i
2


h14
0
0
1
1
0
0
0
0
s7,i = s1,i ∧ s2,i
2


h15
1
0
0
0
1
0
0
0
s7,i = s0,i ∧ s1,i
3


h20
0
1
0
0
0
1
0
0
s7,i = s0,i ∧ s1,i
2


h23
0
0
0
0
1
1
0
0
s7,i = s1,i ∧ s2,i
2


h26
0
0
1
0
0
0
1
0
s7,i = s0,i ∧ s1,i
2


h28
0
0
0
0
1
0
1
0
s7,i = s0,i ∧ s2,i
2


h33
0
0
0
1
0
0
0
1
s7,i = s0,i ∧ s1,i
1


h35
0
0
0
0
0
1
0
1
s7,i = s0,i ∧ s2,i
1


h36
0
0
0
0
0
0
1
1
s7,i = s1,i ∧ s2,i
1


h97
0
1
1
1
1
0
0
0
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h100
1
0
1
1
0
1
0
0
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h104
0
1
1
0
1
1
0
0
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h105
1
0
0
1
1
1
0
0
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h109
1
1
0
1
0
0
1
0
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h114
0
1
1
0
1
0
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











v (s0,i ∧ s1,i ∧ s2,i)



h115
1
0
0
1
1
0
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h118
1
1
0
0
0
1
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h119
1
0
1
0
0
1
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h122
0
1
0
1
0
1
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h123
0
0
1
1
0
1
1
0
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0, ∧ s1,i ∧ s2,i)



h127
0
0
0
1
1
1
1
0
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











v (s0,i ∧ s1,i ∧ s2,i)



h128
1
1
1
0
0
0
0
1
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h132
1
1
0
0
1
0
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











v (s0,i ∧ s1,i ∧ s2,i)



h133
1
0
1
0
1
0
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h136
0
1
0
1
1
0
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h137
0
0
1
1
1
0
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h140
0
1
1
0
0
1
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h141
1
0
0
1
0
1
0
1
s7,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i, s1,i ∧ s2,i)



h146
0
0
1
0
1
1
0
1
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h150
0
1
1
0
0
0
1
1
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h151
1
0
0
1
0
0
1
1
s7,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h155
0
1
0
0
1
0
1
1
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h158
1
0
0
0
0
1
1
1
s7,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)









It may be determined from Table 6 that, according to the second embodiment, the encoding complexity of the Hamming code is that custom-character=471, and the quantity of minimum code weights 4 is that Aj=52576.


Further, a function with lower complexity may be selected from the 36 candidate functions h based on the operation quantities custom-character shown in Table 6. In this embodiment, function complexity of s7,i=h33=s0,i∧s1,i, s7,i=h35=s0,i∧s2,i, and s7,i=h36=s1,i∧s2,i is 1. The three functions have the lowest complexity in the 36 candidate functions h, and complexity of shortened double-extended Hamming codes corresponding to the three functions is lower.


Particularly, when s7,i=h36=s1,i ∧s2,i, the following may be determined according to Formula (5).






H=[g(0):g(62),g(64):g(94),g(96):g(110),g(112):g(118),g(120),g(122),g(124),g(63),g(95),g(111),g(119),g(121),g(123),g(125):g(127)]   (15)


Herein g(a):g(b) indicates [g(a), g(a+1), g(a+2), . . . , g(b)].


A generator matrix G may be determined according to Formula (9) and Formula (16).






P=B[g(0):g(62),g(64): g(94),g(96): g(110),g(112): g(118),g(120),g(122),g(124)]   (16)


Herein B=[g(63),g(95),g(111),g(119),g(121),g(123),g(125):g(127)]−1.


In the second embodiment of this disclosure, the corresponding parity-check matrix HDE,36 of the Hamming code in this embodiment is different from a Hamming code (DE-Hamming) (128,119)OIF defined in the OIF-400ZR standard, but both a systematic parity-check matrix Hsys,36 and a generator matrix Gj of the Hamming code in this embodiment are the same as those of the Hamming code (128,119)OIF defined in the OIF-400ZR standard. In other words, same codewords are obtained through encoding based on the two double-extended Hamming codes (128, 119) and (128,119)OIF. In other words, data streams output from a transmit end are consistent. The double-extended Hamming code (DE-Hamming) according to this disclosure has lower function complexity s7,i=h36=s1,i∧s2,i at a receive end.


Third Embodiment

In a third embodiment of this disclosure, an improved Hamming code (DE-Hamming) (64, 56) is provided. A code length is 64, and a length of to-be-sent information bits is 56. The Hamming code DE-Hamming(64, 56) may be obtained through performing double extension based on a conventional Hamming code (Hamming) (63, 57), that is, m=6, and q=0. It may be considered that decoding is performed based on a finite field GF(26). A target parity-check matrix HDE of the Hamming code (DE-Hamming) according to this disclosure has a form of Formula (2).


In this embodiment, a size of a parity-check matrix H of the conventional Hamming code (Hamming) (63, 57) is 6×63, 1 is an all-one row vector with a length of 64, 0 is an all-zero column vector with a length of 6, and a length of a not-all-zero row vector D of the target parity-check matrix HDE is 64. The following can be obtained according to Formula (3):










g

(
i
)

=

[




s

0
,
i







s

1
,
i












s

5
,
i







s

6
,
i






1



]





(
17
)







Herein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and elements in a seventh row of the target parity-check matrix HDE are all 1. A target function h(s0,i,s1,i,s2,i) of the Hamming code (DE-Hamming) determines an element s6,i of a column vector corresponding to a not-all-zero row vector D as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, and s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to the row vector of the target parity-check matrix.


According to Formula (5) and Table 1 to Table 4, the following candidate parity-check matrix Hj with a size of 8×64 may be determined, where 0<j≤162.






H
j
=[g(0),g(1),g(2), . . . ,g(63)]  (18)


A non-singular matrix is selected from a plurality of candidate parity-check matrices Hj, to obtain a first candidate parity-check matrix set. Further, the first candidate parity-check matrix set is transformed to a second candidate parity-check matrix set in a systematic form according to Formula (7). Specifically, in this embodiment, eight linearly independent column vectors are selected from the candidate parity-check matrices Hj from right to left, and are moved to the rightmost of the matrix. Herein HR is an 8×8 matrix formed by the eight linearly independent column vectors, and HL is an 8×56 matrix obtained after HR is removed from the candidate parity-check matrix Hj.


Further, according to Formula (7), a system check matrix Hsys,j may be obtained through elementary row transformation. Herein I is an 8×8 identity matrix, and a matrix P=(HR)−1HL has a size of 8×56.


A generator matrix Gj with a size of 56×64 may be determined according to Formula (9).


For the 162 functions hj shown in Table 1 to Table 4, corresponding candidate parity-check matrices Hj are respectively obtained according to Formula (4) and Formula (5). It may be determined that 14 matrices in the 162 candidate parity-check matrices Hj are not non-singular matrices. For 148 non-singular matrices Hj, eight linearly independent column vectors are selected from right to left and moved to the rightmost of the matrix through transformation according to Formula (7), to obtain a first group of candidate parity-check matrices HDE,j.


For the first group of candidate parity-check matrices HDE,j, based on a third parameter custom-character indicating encoding complexity and a fourth parameter Aj indicating a quantity of minimum code weights 4, a target parity-check matrix HDE may be selected, and a target function h(s0,i,s1,i,s2,i) may be selected. Table 7 shows a logical expression of a candidate function hj for this embodiment and an operation quantity custom-character corresponding to the candidate function.









TABLE 7







Predetermined function set of the Hamming code


(64, 56) according to this disclosure

















i %8
0
1
2
3
4
5
6
7
Logical expression
custom-characterj





h9
1
1
0
0
0
0
0
0
s6,i = s1,i ∧ s2,i
3


h10
1
0
1
0
0
0
0
0
s6,i = s0,i ∧ s2,i
3


h13
0
1
0
1
0
0
0
0
s6,i = s0,i ∧ s2,i
2


h14
0
0
1
1
0
0
0
0
s6,i = s1,i ∧ s2,i
2


h15
1
0
0
0
1
0
0
0
s6,i = s0,i ∧ s1,i
3


h20
0
1
0
0
0
1
0
0
s6,i = s0,i ∧ s1,i
2


h23
0
0
0
0
1
1
0
0
s6,i = s1,i ∧ s2,i
2


h26
0
0
1
0
0
0
1
0
s6,i = s0,i ∧ s1,i
2


h28
0
0
0
0
1
0
1
0
s6,i = s0,i ∧ s2,i
2


h33
0
0
0
1
0
0
0
1
s6,i = s0,i ∧ s1,i
1


h35
0
0
0
0
0
1
0
1
s6,i = s0,i ∧ s2,i
1


h36
0
0
0
0
0
0
1
1
6,i = s1,i ∧ s2,i
1


h97
0
1
1
1
1
0
0
0
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h100
1
0
1
1
0
1
0
0
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h104
0
1
1
0
1
1
0
0
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h105
1
0
0
1
1
1
0
0
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h109
1
1
0
1
0
0
1
0
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h114
0
1
1
0
1
0
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h115
1
0
0
1
1
0
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h118
1
1
0
0
0
1
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h119
1
0
1
0
0
1
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h122
0
1
0
1
0
1
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h123
0
0
1
1
0
1
1
0
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











v (s0,i ∧ s1,i ∧ s2,i)



h127
0
0
0
1
1
1
1
0
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h128
1
1
1
0
0
0
0
1
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h132
1
1
0
0
1
0
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h133
1
0
1
0
1
0
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h136
0
1
0
1
1
0
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h137
0
0
1
1
1
0
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h140
0
1
1
0
0
1
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h141
1
0
0
1
0
1
0
1
s6,i = (s0,i ∧ s1,i) ∨ (s0,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h146
0
0
1
0
1
1
0
1
s6,i = (s0,i ∧ Sz,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h150
0
1
1
0
0
0
1
1
s6,i = (s0,i ∧ s1,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h151
1
0
0
1
0
0
1
1
s6,i = (s0,i ∧ s1,i) v (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h155
0
1
0
0
1
0
1
1
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)



h158
1
0
0
0
0
1
1
1
s6,i = (s0,i ∧ s2,i) ∨ (s1,i ∧ s2,i)
9











∨ (s0,i ∧ s1,i ∧ s2,i)









It may be determined from Table 7 that, according to the third embodiment, the encoding complexity of the Hamming code is that custom-character=200, and the quantity of minimum code weights 4 is that Aj=6320.


Further, a function with lower complexity may be selected from the 36 candidate functions h based on the operation quantities custom-character shown in Table 7. In this embodiment, function complexity of s6,i=h33=s0,i∧=s1,i, s6,i=h35=s0,i∧s2,i, and s6,i=h36=s1,i∧s2,i is 1. The three functions have the lowest complexity in the 36 candidate functions h, and complexity of shortened double-extended Hamming codes corresponding to the three functions is lower.


Fourth Embodiment

In a fourth embodiment of this disclosure, a shortened double-extended Hamming code (DE-Hamming) (2m−q, 2m−2−m−q) is provided, where m is given. As shown in Formula (19), a length q of shortened bits is selected, to implement different code redundancy OH. Herein 0≤q<(2m−1)/2.









OH


=


n
k

-
1






(
19
)







A code length is n=2m−q, and an information length is k=2m−2−m−q.


In Table 8 and Table 9, target functions hj for the shortened double-extended Hamming code provided in this disclosure are listed for a case of m=8 and different qs and a case of m=7 and different qs.









TABLE 8







Target functions hj of the Hamming code according to this


disclosure, where m = 8, and q = 0-113













OH
q
n
k
Target function hj

















4.07%
0
256
246
h33, h35, h36







h33 = s0, i ∧ s1, i,







h35 = s0, i ∧ s2, i,







h36 = s1, i ∧ s2, i



4.08%
1
255
245
h33, h35, h36



4.10%
2
254
244
h7



4.12%
3
253
243
h143, h152



4.13%
4
252
242
h33



4.15%
5
251
241
h4



4.17%
6
250
240
h33, h35



4.18%
7
249
239
h33, h35, h36



4.20%
8
248
238
h33, h35, h36



4.22%
9
247
237
h33, h35, h36



4.24%
10
246
236
h7



4.26%
11
245
235
h6, h7



4.27%
12
244
234
h33



4.29%
13
243
233
h4



4.31%
14
242
232
h40, h54, h65



4.33%
15
241
231
h33, h35, h36



4.35%
16
240
230
h33, h35, h36



4.37%
17
239
229
h33, h35, h36



4.39%
18
238
228
h7



4.41%
19
237
227
h143, h152



4.42%
20
236
226
h33



4.44%
21
235
225
h4



4.46%
22
234
224
h33, h35



4.48%
23
233
223
h33, h35, h36



4.50%
24
232
222
h33, h35, h36



4.52%
25
231
221
h33, h35, h36



4.55%
26
230
220
h7



4.57%
27
229
219
h6, h7



4.59%
28
228
218
h33



4.61%
29
227
217
h4



4.63%
30
226
216
h40, h54, h65



4.65%
31
225
215
h33, h35, h36



4.67%
32
224
214
h33, h35, h36



4.69%
33
223
213
h33, h35, h36



4.72%
34
222
212
h7



4.74%
35
221
211
h143, h152



4.76%
36
220
210
h33



4.78%
37
219
209
h4



4.81%
38
218
208
h33, h35



4.83%
39
217
207
h33, h35, h36



4.85%
40
216
206
h33, h35, h36



4.88%
41
215
205
h33, h35, h36



4.90%
42
214
204
h7



4.93%
43
213
203
h6, h7



4.95%
44
212
202
h33



4.98%
45
211
201
h4



5.00%
46
210
200
h40, h54, h65



5.03%
47
209
199
h33, h35, h36



5.05%
48
208
198
h33, h35, h36



5.08%
49
207
197
h33, h35, h36



5.10%
50
206
196
h7



5.13%
51
205
195
h143, h152



5.15%
52
204
194
h33



5.18%
53
203
193
h4



5.21%
54
202
192
h33, h35



5.24%
55
201
191
h33, h35, h36



5.26%
56
200
190
h33, h35, h36



5.29%
57
199
189
h33, h35, h36



5.32%
58
198
188
h7



5.35%
59
197
187
h6, h7



5.38%
60
196
186
h33



5.41%
61
195
185
h4



5.43%
62
194
184
h40, h54, h65



5.46%
63
193
183
h33, h35, h36



5.49%
64
192
182
h33, h35, h36



5.52%
65
191
181
h33, h35, h36



5.56%
66
190
180
h7



5.59%
67
189
179
h143, h152



5.62%
68
188
178
h33



5.65%
69
187
177
h4



5.68%
70
186
176
h33, h35



5.71%
71
185
175
h33, h35, h36



5.75%
72
184
174
h33, h35, h36



5.78%
73
183
173
h33, h35, h36



5.81%
74
182
172
h7



5.85%
75
181
171
h6, h7



5.88%
76
180
170
h33



5.92%
77
179
169
h4



5.95%
78
178
168
h40, h54, h65



5.99%
79
177
167
h33, h35, h36



6.02%
80
176
166
h33, h35, h36



6.06%
81
175
165
h33, h35, h36



6.10%
82
174
164
h7



6.13%
83
173
163
h143, h152



6.17%
84
172
162
h33



6.21%
85
171
161
h4



6.25%
86
170
160
h33, h35



6.29%
87
169
159
h33, h35, h36



6.33%
88
168
158
h33, h35, h36



6.37%
89
167
157
h33, h35, h36



6.41%
90
166
156
h7



6.45%
91
165
155
h6, h7



6.49%
92
164
154
h33



6.54%
93
163
153
h4



6.58%
94
162
152
h40, h54, h65



6.62%
95
161
151
h33, h35, h36



6.67%
96
160
150
h33, h35, h36



6.71%
97
159
149
h33, h35, h36



6.76%
98
158
148
h7



6.80%
99
157
147
h143, h152



6.85%
100
156
146
h33



6.90%
101
155
145
h4



6.94%
102
154
144
h33, h35



6.99%
103
153
143
h33, h35, h36



7.04%
104
152
142
h33, h35, h36



7.09%
105
151
141
h33, h35, h36



7.14%
106
150
140
h7



7.19%
107
149
139
h6, h7



7.25%
108
148
138
h33



7.30%
109
147
137
h4



7.35%
110
146
136
h40, h54, h65



7.41%
111
145
135
h33, h35, h36



7.46%
112
144
134
h33, h35, h36



7.52%
113
143
133
h33, h35, h36

















TABLE 9







Target functions hj of the Hamming code according to this


disclosure, where m = 7, and q = 0-57













OH
q
n
k
Target function hj

















7.56%
0
128
119
h33, h35, h36



7.63%
1
127
118
h33, h35, h36



7.69%
2
126
117
h7



7.76%
3
125
116
h143, h152



7.83%
4
124
115
h33



7.89%
5
123
114
h4



7.96%
6
122
113
h33, h35



8.04%
7
121
112
h33, h35, h36



8.11%
8
120
111
h33, h35, h36



8.18%
9
119
110
h33, h35, h36



8.26%
10
118
109
h7



8.33%
11
117
108
h6, h7



8.41%
12
116
107
h33



8.49%
13
115
106
h4



8.57%
14
114
105
h40, h54, h65



8.65%
15
113
104
h33, h35, h36



8.74%
16
112
103
h33, h35, h36



8.82%
17
111
102
h33, h35, h36



8.91%
18
110
101
h7



9.00%
19
109
100
h143, h152



9.09%
20
108
99
h33



9.18%
21
107
98
h4



9.28%
22
106
97
h33, h35



9.38%
23
105
96
h33, h35, h36



9.47%
24
104
95
h33, h35, h36



9.57%
25
103
94
h33, h35, h36



9.68%
26
102
93
h7



9.78%
27
101
92
h6, h7



9.89%
28
100
91
h33



10.00%
29
99
90
h4



10.11%
30
98
89
h40, h54, h65



10.23%
31
97
88
h33, h35, h36



10.34%
32
96
87
h33, h35, h36



10.47%
33
95
86
h33, h35, h36



10.59%
34
94
85
h7



10.71%
35
93
84
h143, h152



10.84%
36
92
83
h33



10.98%
37
91
82
h4



11.11%
38
90
81
h33, h35



11.25%
39
89
80
h33, h35, h36



11.39%
40
88
79
h33, h35, h36



11.54%
41
87
78
h33, h35, h36



11.69%
42
86
77
h7



11.84%
43
85
76
h6, h7



12.00%
44
84
75
h33



12.16%
45
83
74
h4



12.33%
46
82
73
h40, h54, h65



12.50%
47
81
72
h33, h35, h36



12.68%
48
80
71
h33, h35, h36



12.86%
49
79
70
h33, h35, h36



13.04%
50
78
69
h7



13.24%
51
77
68
h143, h152



13.43%
52
76
67
h33



13.64%
53
75
66
h4



13.85%
54
74
65
h33, h35



14.06%
55
73
64
h33, h35, h36



14.29%
56
72
63
h33, h35, h36



14.52%
57
71
62
h33, h35, h36










According to the fourth embodiment of this disclosure, the improved double-extended Hamming code is provided. A target parity-check matrix of the improved double-extended Hamming code is obtained based on a target function with a smaller operation quantity that is selected from a predetermined function set, so that such an extended Hamming code can adapt to configurations of various code lengths and information bit lengths. The double-extended Hamming code according to this disclosure can provide low encoding and decoding complexity in specified code space, reduce a bit error rate of a communication system, and maintain redundancy within an appropriate range, thereby providing optimized Hamming code performance.



FIG. 5 is a block diagram of a device 500 that can implement some embodiments of this disclosure. The device 500 can be used to implement the encoding device 110 and the decoding device 120 shown in FIG. 1. It should be understood that the device 500 is merely used as an example and does not imply any limitation on the scope of this disclosure. Embodiments of this disclosure may be further embodied in different devices. It should be further understood that the device 500 may further include other elements or entities that are not shown for ease of description, but it does not mean that embodiments of this disclosure do not have these elements or entities.


As shown in FIG. 5, the device 500 includes a processor 510. The processor 510 controls an operation and a function of the device 500. For example, in some example embodiments, the processor 510 may perform various operations by using instructions 530 stored in a memory 520 coupled to the processor 510. The memory 520 may be of any appropriate type applicable to a local technical environment, and may be implemented by using any appropriate data storage technology, including but not limited to a semiconductor-based storage device, a magnetic storage device and system, and an optical storage device and system. Although only one memory unit is shown in FIG. 5, there may be a plurality of physically different memory units in the device 500.


The processor 510 may be of any appropriate type applicable to a local technical environment, and may include but is not limited to one or more of a general-purpose computer, a dedicated computer, a microcontroller, a digital signal processor (DSP), and a controller-based multi-core controller architecture. The device 500 may also include a plurality of processors 510. The processor 510 is coupled to a communication unit 540. The communication unit 540 may receive and send information by using a radio signal or through an optical fiber, a cable, and/or another component.


When the device 500 serves as the encoding device 110 or the decoding device 120, the processor 510 may implement the operations and the actions described above with reference to FIG. 2 and FIG. 3 by executing instructions. All features described above with reference to FIG. 2 and FIG. 3 are applicable to the device 500. Details are not described herein again.


In general, various example embodiments of this disclosure may be implemented in hardware or a dedicated circuit, software, logic, or any combination thereof. Some aspects may be implemented in hardware. Other aspects may be implemented in firmware or software that may be executed by a controller, a microprocessor, or another computing device. When aspects of the example embodiments of this disclosure are illustrated or described as block diagrams, flowcharts, or represented using some other graphs, it may be understood that the blocks, apparatuses, systems, techniques, or methods described herein may be implemented as non-limiting examples in hardware, software, firmware, a dedicated circuit or logic, general-purpose hardware or a controller, another computing device, or some combinations thereof.


For example, the example embodiments of this disclosure may be described in a context of machine-executable or computer-executable instructions. The machine-executable instructions are included, for example, in a program module executed in a device in a target real or virtual processor. Generally, the program module includes a routine, a program, a library, an object, a type, a component, a data structure, and the like, and executes a specific task or implements a specific abstract data structure. In various example embodiments, functions of the program module may be combined or divided between the described program modules. The machine-executable instructions used for the program module may be executed locally or in a distributed device. In the distributed device, the program module may be located in both a local storage medium and a remote storage medium.


Computer program code used to implement the methods disclosed in this disclosure may be written in one or more programming languages. The computer program code may be provided for a processor of a general-purpose computer, a dedicated computer, or another programmable data processing apparatus. In this way, when the program code is executed by the computer or the another programmable data processing apparatus, functions/operations specified in the flowcharts and/or the block diagrams are implemented. The program code may be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer, or all on a remote computer or server.


In the context of this disclosure, a machine-readable medium or a computer-readable medium may be any tangible medium that includes or stores a program used for or related to an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include but is not limited to an electronic, a magnetic, an optical, an electromagnetic, an infrared, or a semiconductor system, apparatus, or device, or any appropriate combination thereof. More detailed examples of the machine-readable storage medium include an electrical connection with one or more conducting wires, a portable computer disk, a hard disk, a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any appropriate combination thereof.


In addition, although operations are described in a particular order, this should not be understood as requiring such operations to be completed in the shown particular order or in the successive order, or performing all the illustrated operations to obtain the desired results. In some cases, multitasking or parallel processing is advantageous. Similarly, although the foregoing description includes some specific implementation details, this should not be construed as limiting the scope of the present disclosure or claims, but rather as description of specific example embodiments that may be specific to a particular embodiment. Some features described in this specification in the context of separate example embodiments may be alternatively integrated into a single example embodiment. Alternatively, various features that are described in the context of a single example embodiment may be separately implemented in a plurality of example embodiments or in any appropriate sub-combination.


Although the subject matter has been described in a language specific to structural features and/or methodological actions, it should be understood that the subject matter defined in the appended claims is not limited to the specific features or actions described above. On the contrary, the specific features and actions described above are disclosed as example forms of implementing the claims.

Claims
  • 1. A method comprising: obtaining a generator matrix for encoding, wherein the generator matrix is based on a target parity-check matrix of a Hamming code for encoding, wherein the target parity-check matrix is based on a target function for decoding, and wherein the target function is one of a predetermined function set;encoding information bits using the generator matrix to obtain an encoded data stream; andsending the encoded data stream.
  • 2. The method of claim 1, wherein a target function h(s0,i,s1,i,s2,i) determines a not-all-zero row vector based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector, wherein the predetermined function set comprises one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,i∧s2,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s1,i), or h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s2,i).
  • 3. The method of claim 2, wherein a code length of the Hamming code is 180, wherein a length of the information bits is 170, wherein all elements in a ninth row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, wherein i is an integer greater than or equal to 0 and less than 180, wherein i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and, s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 4. The method of claim 2, wherein a code length of the Hamming code is 128, wherein a length of the information bits is 119, wherein all elements s8,i in an eighth row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector as one of s7,i=h(s0,i,s1,i,s2,i)=s0,1∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, or s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, and wherein i is an integer greater than or equal to 0 and less than 128, wherein i=266s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 5. The method of claim 2, wherein a code length of the Hamming code is 64, wherein a length of the information bits is 56, wherein all elements s7,i in a seventh row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, and s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, wherein i is an integer greater than or equal to 0 and less than 64, wherein i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s6,i, s5,i, s4,i, s2,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 6. The method of claim 1, wherein the generator matrix is based on a system check matrix, and wherein the system check matrix is obtained by transforming the target parity-check matrix.
  • 7. The method of claim 1, wherein the predetermined function set comprises a plurality of candidate functions for determining a not-all-zero row vector extended based on the target parity-check matrix.
  • 8. The method of claim 7, further comprising: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions;selecting a non-singular matrix from the plurality of candidate parity-check matrices to obtain a first candidate parity-check matrix set;transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form;determining a third parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, wherein the third parameter indicates encoding complexity of the Hamming code;selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the third parameter; anddetermining the target parity-check matrix from the first group of candidate parity-check matrices.
  • 9. The method of claim 8, further comprising: determining a fourth parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, wherein the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices;selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices based on the fourth parameter; anddetermining the target parity-check matrix from the second group of candidate parity-check matrices.
  • 10. The method of claim 7, further comprising: determining a plurality of candidate parity-check matrices based on the plurality of candidate functions;selecting a non-singular matrix from the plurality of candidate parity-check matrices to obtain a first candidate parity-check matrix set;transforming the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form;determining a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, wherein the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set;selecting a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the fourth parameter; anddetermining the target parity-check matrix from the first group of candidate parity-check matrices.
  • 11. The method of claim 10, further comprising: determining a third parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, wherein the third parameter indicates encoding complexity of the Hamming code;selecting a second group of candidate parity-check matrices from the first group of candidate parity-check matrices, wherein the second group of candidate parity-check matrices has the third parameter below a predetermined threshold; anddetermining the target parity-check matrix from the second group of candidate parity-check matrices.
  • 12. The method of claim 8, further comprising for each candidate parity-check matrix in the first candidate parity-check matrix set: moving at least some linearly independent column vectors from right to left to a rightmost of a corresponding candidate parity-check matrix; andperforming elementary row transformation, so that a right part of the corresponding candidate parity-check matrix is an identity matrix.
  • 13. The method of claim 9, further comprising: determining an operation quantity of a function corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set; anddetermining the target parity-check matrix based on the operation quantity.
  • 14. A method comprising: receiving a data stream;obtaining a target parity-check matrix of a Hamming code for decoding, wherein the target parity-check matrix is based on a target function for decoding, and wherein the target function is one of a predetermined function set; anddecoding the data stream by using the target parity-check matrix.
  • 15. The method of claim 14, wherein a target function h(s0,i,s1,i,s2,i) determines a not-all-zero row vector based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector, wherein the predetermined function set comprises one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,i∧s2,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s1,i) or h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s2,i).
  • 16. The method of claim 15, wherein a code length of the Hamming code is 180, wherein a length of information bits is 170, wherein all elements in a ninth row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, wherein i is an integer greater than or equal to 0 and less than 180, and wherein s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 17. A device comprising: at least one memory configured to store data; andat least one processor configured to: obtain a generator matrix for encoding, wherein the generator matrix is based on a target parity-check matrix of a Hamming code for encoding, wherein the target parity-check matrix is based on a target function for decoding, and wherein the target function is one of a predetermined function set;encode information bits by using the generator matrix to obtain an encoded data stream; andsend the encoded data stream.
  • 18. The device of claim 17, wherein a target function h(s0,i,s1,i,s2,i) determines a not-all-zero row vector based on at least some elements of first three elements s0,i, s1,i, and s2,i of column vectors corresponding to the not-all-zero row vector, and the predetermined function set comprises one or more of the following: h(s0,i,s1,i,s2,i)=s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i, h(s0,i,s1,i,s2,i)=s0,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=s0,i∧s1,i∧s2,i, h(s0,i,s1,i,s2,i)=(s0,i∧s2,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s1,i∧s2,i), h(s0,i,s1,i,s2,i)=(s0,i∧s1,i)∨(s0,i∧s2,i), h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s1,i), and h(s0,i,s1,i,s2,i)=(s1,i∧s2,i)∨(s0,i∧s2,i).
  • 19. The device of claim 18, wherein a code length of the Hamming code is 180, wherein a length of the information bits is 170, wherein all elements in a ninth row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s8,i of a column vector corresponding to the not-all-zero row vector as s8,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, wherein i is an integer greater than or equal to 0 and less than 180, wherein i=27s7,i+26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s8,i, s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 20. The device of claim 18, wherein a code length of the Hamming code is 128, wherein a length of the information bits is 119, wherein all elements s8,i in an eighth row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s7,i of a column vector corresponding to the not-all-zero row vector as one of s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s7,i=h(s0,i,s1,i,s2,i)=s0,i∧s2,i, or s7,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, wherein i is an integer greater than or equal to 0 and less than 128, wherein i=26s6,i+25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s7,i, s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 21. The device of claim 18, wherein a code length of the Hamming code is 64, wherein a length of the information bits is 56, wherein all elements s7,i in a seventh row of the target parity-check matrix are 1, wherein the target function h(s0,i,s1,i,s2,i) determines an element s6,i of a column vector corresponding to the not-all-zero row vector as one of s6,i=h(s0,i,s1,i,s2,i)=s0,i∧s1,i, s6,i=h(s0,i,s1,i,s2,i)=s0,1∧s2,i, or s6,i=h(s0,i,s1,i,s2,i)=s1,i∧s2,i, wherein i is an integer greater than or equal to 0 and less than 64, i=25s5,i+24s4,i+23s3,i+22s2,i+2s1,i+s0,i, and wherein s6,i, s5,i, s4,i, s3,i, s2,i, s1,i, and s0,i are respectively elements of column vectors corresponding to a row vector of the target parity-check matrix.
  • 22. The device of claim 17, wherein the at least one processor is further configured to: transform the target parity-check matrix to obtain a system check matrix; anddetermine the generator matrix based on a system check matrix.
  • 23. The device of claim 17, wherein the at least one processor is further configured to extend a not-all-zero row vector based on the target parity-check matrix and using a plurality of candidate functions in the predetermined function set.
  • 24. The device of claim 23, wherein the at least one processor is further configured to: determine a plurality of candidate parity-check matrices based on the plurality of candidate functions;select a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set;transform the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form;determine a third parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, wherein the third parameter indicates encoding complexity of the Hamming code;select a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the third parameter; anddetermine the target parity-check matrix from the first group of candidate parity-check matrices.
  • 25. The device of claim 24, wherein the at least one processor is further configured to: determine a fourth parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, wherein the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the first group of candidate parity-check matrices;select a second group of candidate parity-check matrices from the first group of candidate parity-check matrices based on the fourth parameter; anddetermine the target parity-check matrix from the second group of candidate parity-check matrices.
  • 26. The device of claim 23, wherein the at least one processor is further configured to: determine a plurality of candidate parity-check matrices based on the plurality of candidate functions;select a non-singular matrix from the plurality of candidate parity-check matrices, to obtain a first candidate parity-check matrix set;transform the first candidate parity-check matrix set into a second candidate parity-check matrix set in a systematic form;determine a fourth parameter associated with each candidate parity-check matrix in the second candidate parity-check matrix set, wherein the fourth parameter indicates a quantity of minimum code weights of the Hamming code corresponding to each candidate parity-check matrix in the second candidate parity-check matrix set;select a first group of candidate parity-check matrices from the first candidate parity-check matrix set based on the fourth parameter; anddetermine the target parity-check matrix from the first group of candidate parity-check matrices.
  • 27. The device of claim 26, wherein the at least one processor is further configured to: determine a third parameter associated with each candidate parity-check matrix in the first group of candidate parity-check matrices, wherein the third parameter indicates encoding complexity of the Hamming code;select a second group of candidate parity-check matrices from the first group of candidate parity-check matrices, wherein the second group of candidate parity-check matrices has the third parameter below a predetermined threshold; anddetermine the target parity-check matrix from the second group of candidate parity-check matrices.
  • 28. The device of claim 24, wherein the at least one processor is further configured to: for each candidate parity-check matrix in the first candidate parity-check matrix set, move at least some linearly independent column vectors from right to left to a rightmost of a corresponding candidate parity-check matrix, and perform elementary row transformation, so that a right part of the corresponding candidate parity-check matrix is an identity matrix.
  • 29. The device of claim 25, wherein the at least one processor is further configured to: determine an operation quantity of a function corresponding to each candidate parity-check matrix in the second group of candidate parity-check matrices in the function set; anddetermine the target parity-check matrix based on the operation quantity.
  • 30. A decoding device comprising: at least one memory configured to store data; andat least one processor configured to: receive a data stream;obtain a target parity-check matrix of a Hamming code for decoding, wherein the target parity-check matrix is based on a target function for decoding, and wherein the target function is one of a predetermined function set; anddecode the data stream by using the target parity-check matrix.
Priority Claims (1)
Number Date Country Kind
202110293130.9 Mar 2021 CN national
CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Patent Application No. PCT/CN2022/081021 filed on Mar. 15, 2022, which claims priority to Chinese Patent Application No. 202110293130.9 filed on Mar. 18, 2021. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.

Continuations (1)
Number Date Country
Parent PCT/CN2022/081021 Mar 2022 US
Child 18469087 US