## Golay Error Correction Coding

**How to use this Java script: **

- Enter a sequence of 12 bits in the first text field. This is
the sequence of 12 information bits you want to transmit from one
party to another party. Make sure your input is a sequence of 12 bits
Otherwise you will get an error message when you try to encode it.

- Click the "Encode" button. The Golay encoding algorithm codes
the input sequence of 12 bits to a sequence of 24 bits. Notice
that the first 12 bits of these 24 bits are exactly the 12 information
bits. The coded sequence of 24 bits is transmitted over
a channel to a receiver at the other end of the communication system.
When you click the "Encode" button, the coded sequence of 24 bits
appears in both the second and the third text fields.

- Introduce bit errors in the 24 bits received. You do
this by flipping bits in the third text field. The Golay
coding can detect up to 4 bit errors in 24 bits, and can correct
up to 3 bit errors in 24 bits.

- Click the "Decode" button. The Golay decoding algorithm
tries to detect the bit errors occurred in the 24 bits received.
- If the 24 bits received have <= 3 bit errors, the Golay decoding
algorithm detects the actual bit errors occurred and recovers
the 24 bits that were meant to be transmitted. The error pattern
detected is shown in the fourth text field. The 12 information bits
recovered are shown in the fifth text field.
- If the 24 bits received have 4 bit errors, the Golay decoding
algorithm is capable of detecting that 4 bit errors occurred
but cannot determine the error pattern occurred. It issues
an error message.
- If the 24 bits received have > 4 bit errors, the error pattern
detected by the Golay decoding algorithm is not the actual
error pattern occurred, and consequently the 12 bits recovered
are not the same as the 12 information bits.

Please send your suggestions and comments to
Hongyun Wang.