L09 Slides
L09 Slides
Basic idea:
– Use multiple parity bits, each covering a subset of the
data bits.
– No two message bits belong to exactly the same subsets,
so a single error will generate a unique set of parity check
errors.
• Receive: After receiving the (possibly corrupted) message, E 2E 1E 0 Single Error Correction
compute a syndrome bit (Ei) for each parity bit. For the code
000 No errors
on previous slide: What happens if
001 P0 has an error, flip to correct
there is more than
E0 = B0 ! B1 ! B3 ! P0 010 P1 has an error, flip to correct one error?
E1 = B0 ! B2 ! B3 ! P1 011 B0 has an error, flip to correct
E2 = B1 ! B2 ! B3 ! P2 100 P2 has an error, flip to correct
101 B1 has an error, flip to correct
• If all the Ei are zero: no errors!
110 B2 has an error, flip to correct
111 B3 has an error, flip to correct
• Otherwise the particular combination of the Ei can be used to
figure out which bit to correct.
The 8 encodings indicate the 8 possible correction actions: no
errors, error in one of 4 data bits, error in one of 3 parity bits
6.02 Spring 2011 Lecture 9, Slide #3 6.02 Spring 2011 Lecture 9, Slide #4
(n,k,d) Systematic Block Codes A simple (8,4,3) code P0 is parity bit
for row #1
Idea: start with rectangular
• Split message into k-bit blocks
array of data bits, add parity
• Add (n-k) parity bits to each block, making each block n bits B0 B1 P0
checks for each row and
long. column. Single-bit error in
k n-k
data will show up as parity B2 B3 P1
errors in a particular row
Message bits Parity bits and column, pinpointing the P2 P3 P3 is parity bit
The entire block is called bit that has the error. for column #2
a code word and this
n
is an (n,k) code.
011 011 011
110 100 111
10 10 10
• Often we’ll use the notation (n,k,d) where d is the minimum
Hamming distance between code words. Parity for each row Parity check fails for Parity check only fails
• The ratio k/n is called the code rate and is a measure of the and column is row #2 and column #2 for row #2
correct " no errors " bit B3 is incorrect " bit P1 is incorrect
code’s overhead (always ! 1, larger is better).
Can you verify this code has a Hamming distance of 3?
6.02 Spring 2011 Lecture 9, Slide #5 6.02 Spring 2011 Lecture 9, Slide #6
• Impulse noise
– Infrequent bursts of high-amplitude noise, e.g., on a wireless
Row-by-row Col-by-col
channel
B transmission B transmission
– Some number of consecutive bits lost, bounded by some burst order order
length B
(parity bits are
– Single-bit error correction seems like it s useless for dealing with shown shaded)
impulse noise…
or is it???
Problem: Bits from a particular Solution: interleave bits from B
code word are transmitted different code words. Now a B-bit
sequentially, so a B-bit burst burst produces 1-bit errors in B
produces multi-bit errors. different code words.
6.02 Spring 2011 Lecture 9, Slide #9 6.02 Spring 2011 Lecture 9, Slide #10
Interleaving Framing
• The receiver needs to know
– the beginning of the B-way interleaved block in order to do
message errors deinterleaving
Receive
Compute CRC – the beginning of each ECC block in order to do error correction.
B-way interleaved block – Since the interleaved block is made up of B ECC blocks, knowing
message crc
Deinterleave where the interleaved block begins automatically supplies the
Partition necessary start info for the ECC blocks
k+p k+p k+p k+p
k k k k • 8b10b encoding provides what we need! Here’s what gets
Correct errors
Apply ECC transmitted
k k k k
k+p k+p k+p k+p – Prefix to help train clock recovery (alternating 0s/1s, …)
Check CRC – 8b10b sync symbol
Interleave
message crc – Packet data: B ECC blocks recoded as 8b10b symbols
B-way interleaved block
Deliver or discard (after 8b10b decoding and error correction we get {#,data,chk})
Transmit – Suffix to ensure transmitter doesn’t cutoff prematurely, receiver
has time to process last packet before starting search for
beginning of next packet
– On some channels: idle time (no transmission)
6.02 Spring 2011 Lecture 9, Slide #11 6.02 Spring 2011 Lecture 9, Slide #12
Our Recipe (so far) Remaining agenda items
• With B ECC blocks per message, we can correct somewhere
• Transmit • Receive between 1 and B errors depending on where in the message
– Packetize: split message into – Perform clock recovery using they occur.
fixed-size blocks, add sequence transitions, derive bit stream
– Can we make an ECC that corrects up to B errors without any
numbers, checksum from voltage samples constraints where errors occur?
– SECC: split {#,data,chk} into k- – 8b10b decoding: locate sync, – Yes! Reed-Solomon codes
bit blocks, add parity bits to decode
create n-bit code words with – SECC: deinterleave to spread
min Hamming distance of 3, B- • Framing is necessary, but the sync itself can’t be protected by
out burst errors, perform error
way interleaving correction on n-bit blocks
an ECC scheme that requires framing.
– 8b10b encoding: provide producing k-bit blocks – This makes life hard for channels with higher BERs
synchronization info to locate – Packetize: verify checksum and – Is there an error correction scheme that works on un-framed bit
start of packet and sufficient discard faulty packets. Keep streams?
transitions for clock recovery track of received sequence – Yes! Convolutional codes: encoding and the clever decoding
– Convert each bit into numbers, ask for retransmit of scheme will be discussed next week.
samples_per_bit voltage missing packets. Reassemble
samples packets into original message.
6.02 Spring 2011 Lecture 9, Slide #13 6.02 Spring 2011 Lecture 9, Slide #14
6.02 Spring 2011 Lecture 9, Slide #15 6.02 Spring 2011 Lecture 9, Slide #16
Example Spreading the wealth…
• Suppose you received four values from the transmitter y = 73, • Generalize this idea: oversampled polynomials. Let
249, 321, 393, corresponding to x = 1, 2, 3 and 4
– 4 Eqns: A·1+B=73, A·2+B=249, A·3+B=321, A·4+B=393
P(x) = m0 + m1x + m2x2 + … + mk-1xk-1
• We need two of these equations to solve for A and B; there are where m0, m1, ..., mk-1 are the k message units to be encoded.
six possible choices for which two to use Transmit value of polynomial at n different predetermined
• Take each pair and solve for A and B points v0, v1, ..., vn-1 :
A "1+ B = 73 A "1+ B = 73 A "1+ B = 73
P(v0), P(v1), P(v2), ..., P(vn-1)
A " 2 + B = 249 A " 3 + B = 321 A " 4 + B = 393
A=175, B=-102 A=124, B=-51 A=106.6, B=-33.6 Use any k of the received values to construct a linear system
of k equations which can then be solved for k unknowns m0,
A " 2 + B = 249 A " 2 + B = 249 A " 3 + B = 321
m1, ..., mk-1. Each transmitted value contains info about all
! A " 3 + B = 321 ! A " 4 + B = 393 ! A " 4 + B = 393 mi.
A=72, B=105 A=72, B=105 A=72, B=105 • Note that using integer arithmetic, the P(v) values are
• Majority rules: A=72, B=105 numerically greater than the mi and so require more bits to
! represent than the mi. In general the encoded message
– The received!value 73 had an error !
would require a lot more bits to send than the original
– If no errors: all six solutions for A and B would have matched message!
6.02 Spring 2011 Lecture 9, Slide #17 6.02 Spring 2011 Lecture 9, Slide #18
6.02 Spring 2011 Lecture 9, Slide #21 6.02 Spring 2011 Lecture 9, Slide #22
• (n,k) R-S code can correct n-k erasures since we only need k 32-byte block 32-byte block ! 32-byte block (32,28) code
equations to solve for the k unknowns. Uncorrectable error Handles up to
28-byte block 28 erasures 28-byte block 2 byte errors
erasures
• Any combination of E errors and S erasures can be corrected De-interleave
28-byte block 28-byte block 28-byte block
so long as 2E + S ! n-k. (28,24) code
Handles up to
24-byte block 24-byte block 24-byte block 4 byte erasures
De-interleave
24-byte block 24-byte block 24-byte block