Rubberbands andBAILING WIRE
11001 1010 1011 0000
transmitted to the receiver,
which can do one of two
things. The first is to strip off
the CRC result and perform
the same calculation to see if
it arrives at the same result. If
so, then the data is good.
The other thing that it can do
is to just do the CRC division
with the CRC value still
attached and see if it arrives
at an answer of 0. If so, then
the data is good.
Sometimes, it is important
for a system to be able to
correct data that it receives
all by itself. This might be the
case if the data can only be
transmitted once due to time
constraints or memory limitations. Another situation might
be if the lag time between transmission and reception is
large and a request for a repeat of the data would take quite
a long time. The Mars Rovers are likely employing some sort
of error correction because the delay between a request for
a repeat of data and the reception of that data is around
Figure 6. An example of
a CRC calculation.
One simple way to correct for errors is to just have a best
two of three situation, where each byte is sent three times.
If two of the bytes match, then it is likely that they have not
been corrupted. That is pretty simplistic and also requires
that the amount of data sent be tripled.
receiver and one bit is inverted, then the parity values will not
match and we will be able to figure out which bit changed.
In Figure 9, we can calculate the parity for each row and
column to find that the parity values that are shaded blue do
not match the value we are expecting. Since we have exactly one bad column parity and one bad row parity, we can
deduce that the bit shaded red was the bit that inverted and
we can then correct it.
The Block Sum strategy has one Achilles heel. If there
happen to be four bit errors arranged in the pattern shown
in Figure 10, then this strategy will not detect it. As you can
see, the four bit errors are arranged in a square. Since parity
cannot detect even numbers of bit errors and each row and
column containing errors has two errors, Block Sum
Checking will miss these errors.
So which method of error detection or correction is right
for you? Things to think about are how important it is that
the data is received flawlessly, how much processing power
you have available, and how much RAM you can devote to
If you need to ensure that data gets to its destination
flawlessly, then you might choose CRC error detection. This
can detect any single error and multiple errors that are within the number of bits in the divisor, –1 of each other. If multiple errors are spaced farther than the number of bits in the
divisor, –1 it is still over 99.9% effective at detecting errors.
The Adler- 32 strategy of error detection is almost as
effective, but can be calculated even faster. If you just want
some simple protection for your data and don’t want to do
much calculation or send a lot of bits, then using parity will
catch errors 50% of the time. Sending duplicate data in two
bytes reduces your chance of an error getting through to less
than .4%, but does require double the bandwidth.
Block Sum Checking
Another strategy that requires sending less extra data is
Block Sum Checking. This is essentially a two-dimensional
parity check where an array is made out of the data bytes
and parity is calculated for each row and column. This
method allows you to correct for any single-bit error and to
detect most other errors.
Figure 8 shows eight bytes aligned in rows. Parity is
calculated for each row and column. If this data is sent to the
In the film industry, a common thing that you’ll hear on
a set is, “we’ll fix it in post-production.” This seems like such
a strange thing to hear when doing it right in the first place
is often easier. This article wouldn’t be complete without talking about error prevention. Why deal with a lot of errors if
you can prevent them from happening in the first place?
Here are a few strategies that you can take into consideration
when designing something that might send or receive data
that could be corrupted.
If you are sending your data through wires, opting
for a wire that has shielding around the conductors may
reduce the amount of errors that you receive. If you are
transmitting your data through a long length of cable,
you might consider using a differential transmission
mode instead of a single-ended one.
An example of a single-ended protocol is what
comes out of the RS232 port on the back of your
1100000001111 CRC- 12
11000000000000101 CRC- 16
10001000000100001 X25 standard or CCRC-CCITT
100000100110000010001110110110111 CRC- 32
Figure 7. Common CRC divisors.
42 SERVO 07.2004