UNB ECE4253 Digital Communications
Department of Electrical and Computer Engineering - University of New Brunswick, Fredericton, NB, Canada

Codeword Generation Tool

Error control codes can be constructed from fixed-length codewords having a minimum Hamming distance between each codeword and every other codeword in the set.

This online tool generates sets of codewords having certain properties. Given a received codeword, the word can be submitted for error detection or correction in comparison to the generated set of valid codewords.

A brute force search is used here to demonstrate codeword sets having minimum distance properties. For a more structured approach to codeword generation, the Online BCH Code Generator may be appropriate.


Select values for the codeword length (L) and the minimum Hamming distance (D) between codewords. Press 'Generate' to see a list of codewords with these properties. Enter a codeword having L-bits and press 'Receive' to see how this codeword would be received.

  L =     D =   

Generated 7-bit codewords are listed below in boldface where each is labelled for easy reference. The distance between each codeword and the other codewords is shown at right. The distance between any two codewords must be at least 3 in every case.

7-bit CODEWORDS [D=3]
============================================================
             A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P 
 A 0000000 : 0  3  3  4  3  4  4  3  4  3  3  4  3  4  4  7  A 
 B 0000111 : 3  0  4  3  4  3  3  4  3  4  4  3  4  3  7  4  B 
 C 0011001 : 3  4  0  3  4  3  3  4  3  4  4  3  4  7  3  4  C 
 D 0011110 : 4  3  3  0  3  4  4  3  4  3  3  4  7  4  4  3  D 
 E 0101010 : 3  4  4  3  0  3  3  4  3  4  4  7  4  3  3  4  E 
 F 0101101 : 4  3  3  4  3  0  4  3  4  3  7  4  3  4  4  3  F 
 G 0110011 : 4  3  3  4  3  4  0  3  4  7  3  4  3  4  4  3  G 
 H 0110100 : 3  4  4  3  4  3  3  0  7  4  4  3  4  3  3  4  H 
 I 1001011 : 4  3  3  4  3  4  4  7  0  3  3  4  3  4  4  3  I 
 J 1001100 : 3  4  4  3  4  3  7  4  3  0  4  3  4  3  3  4  J 
 K 1010010 : 3  4  4  3  4  7  3  4  3  4  0  3  4  3  3  4  K 
 L 1010101 : 4  3  3  4  7  4  4  3  4  3  3  0  3  4  4  3  L 
 M 1100001 : 3  4  4  7  4  3  3  4  3  4  4  3  0  3  3  4  M 
 N 1100110 : 4  3  7  4  3  4  4  3  4  3  3  4  3  0  4  3  N 
 O 1111000 : 4  7  3  4  3  4  4  3  4  3  3  4  3  4  0  3  O 
 P 1111111 : 7  4  4  3  4  3  3  4  3  4  4  3  4  3  3  0  P 
             A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P 
============================================================
TOTAL 16 CODEWORDS
The above result is not unique for the supplied parameters (L=7,D=3). In particular, the bits in an entire column could be complemented or any two columns of bits could be swapped without affecting the distance calculation.

2024-12-09 02:21:28 AST
Last Updated: 09-09-12
Richard Tervo [ tervo@unb.ca ] Back to the course homepage...