Take the 2-minute tour ×

I need to develop an error correcting code.

My alphabet is {0,1,2,3} (4 elements)
Codeword size n will be 8 or 12
expected error correction capability = 1 digit
expected error detection capability = 2 digit

I reviewed many ecc techniques (rs,ldpc,etc), yet still dont know where to start, and how to do.

Can anybody plz help me to construct it?


share|improve this question
add comment

2 Answers

Have you considered a checksum?

share|improve this answer
thx for your fast response. –  tSirmen Feb 24 '11 at 1:22
i think, w checksum we cannot correct errors. my code is expected to detect upto 2 error and correct upto 1 errors within the 8 or 12 bits. –  tSirmen Feb 24 '11 at 1:24
correction: i meant "digits", not "bits". –  tSirmen Feb 24 '11 at 1:28
Keep two extra pieces of information. First is the sum. Second is the xor. Now, it is possible to find a case that beats both of these, but the this will handle most cases. There's no 100% way to check all cases. –  corsiKa Feb 24 '11 at 1:31
My symbols are {0/1/2/3}. As far as I know, XOR works on binary. Is it possible to apply XOR on non-binary? –  tSirmen Feb 24 '11 at 14:21
add comment

There are tons of ways to implement this, but a common approach would be to use a Reed-Solomon code.

Since you need to detect all two-symbol errors and correct all one-symbol errors, that means you will need two check symbols.

You say you have 2-bit (4-element) symbols, which limits your code length to 3 symbols.

Add that up and you have 1 data symbol and 2 check symbols for each 12-bit code word.

Not very efficient, eh? For that efficiency, you might as well just triplicate your symbol thrice, with the same codewords size and detective and corrective power.

To use Reed-Solomon more effectively, you'll need to use large symbols. This is true for most other types of codes as well.


You may want to consider generalized BCH codes which don't have quite as many limitations as Reed-Solomon codes (which are a subset of BCH codes), at the expense of more complex decoding:


share|improve this answer
Thx for your comment. I probably could not make it clear, let me express it better. My alphabet is 4 elements, and codewords, 8 or 12 digits. So a codeword would be something like "30112320", or "301123202131" I need to correct upto 1, and detect upto 2 digit errors (just like Hamm[7,4]). Then Hamm.distance should be at least 5. Could u plz comment again? –  tSirmen Feb 24 '11 at 14:13
When you say your codewords are 8 or 12 digits, I'm assuming what you mean is that the data words (actual information content) are 8 digits and the codewords (information plus error correcting information) is 12 digits. Is this correct? That is what my answer assumed. –  wjl Feb 25 '11 at 4:08
No, it is the codeword size (either 8 or 12 digits), ie including both data and overhead. Sure one of the aims is to get the best k/n ratio. But the number of data digits can vary. Limitation is on the codeword size, and detection+correction should be (2+1). Although I presume it is possible to meet 2+1 w 8or12 sizes, I'm afraid it may end up w a poor k/n ratio, as u previously mentioned. In such a case, I can still discuss increasing the cw size, yet i prefer to keep it shorter. Thx for your interest. –  tSirmen Feb 25 '11 at 15:26
add comment

Your Answer


