Because of the bad error correcting performance coupled with the low code rate (ratio between useful information symbols and actual transmitted symbols), other error correction codes are preferred in most cases.
The chief attraction of the repetition code is the ease of implementation.
Therefore, the minimum Hamming distance of the code equals its length
Then the encoding maps each bit either to the all ones or all zeros code word, so we get the 111 000 111, which will be transmitted.
Let's say three errors corrupt the transmitted bits and the received sequence is 111 010 100.
Decoding is usually done by a simple majority decision for each code word.
Some UARTs, such as the ones used in the FlexRay protocol, use a majority filter to ignore brief noise spikes.