First, we must assign a "code word" to the data that we wish to transmit. We will demonstrate a simple case where we wish to transmit one bit at a time. While this is not a very efficient way to transmit data in reality, it does make a simple and easily understandable demonstration.
Since we are working with binary communications, we have two different things to transmit: low and high, or zero and one. Instead of transmitting the actual data, well transmit the code word instead.

| Data | Code Word |
0 |
00 |
1 |
11 |
We will represent all the code words possible with this graphic. The valid code words are at the right top and the left bottom. The other two possible code words, 01 and 10 are error code words.
If we receive the code word 11, we know this is a valid piece of data. This can be translated back into the original data, "1." If we receive the code word 01, however, we know that something happened in the middle of transmission. We can then ask for this bit to be retransmitted.
As the size of the code word increases, we can detect larger errors. Note, if there are two errors in a transmission in this code, it will be misinterpreted as a good word!
Introduction to Error Correction
Error correction and error detection are very closely related to each other. For error correction, we will also be transmitting code words but this time with more bits.
| Data | Code Word |
0 |
000 |
1 |
111 |
Once again, the code words without any errors are located on the far left bottom and the far right top of the cube. All the other code words listed are errors.
If a code word comes in that is an error, we can correct it back to the original data by looking for the real word closest to the error word. If 001 comes in, we look for the closest real code word. We can correct this error data to the real data, 000.
There is a problem with this approach, however, as the number of bits with errors increases. We can only correct for minimum distance of the code minus 2. The minimum distance of the code is defined as the number of different bits between two valid code words. For example, our valid code words are 000 and 111. In this case, we have three bits that are different in each code word.
To see how this can be a problem, say we are transmitting the code word 000. If two bits are in error, we will get a code word like 110. If we assume we are trying to correct the data, well go to the closest valid code word. The closest word is 111, and this gets corrected wrong! Because our distance is three and the number of bit errors is two, we will still produce an error.
In the case of error detection, the number of bit errors that can be detected are the minimum distance minus 1. If we implemented error detection only, we could find the two bit error 110 and ask for a retransmission. In the case of Ethernet, we only implement error detection and not correction. Since we will never know the maximum number of bit errors, it is safer just to ask for a retransmission of the data instead of correcting the data and possibly being wrong.