Coding Theory
Coding Theory
Efficiently
Coding Theory
The Problem
Sending data from one place to another
(through a channel) may yield errors.
● http://www.livescience.co
m/18392-reading-jumbled-
words.html
Sending and Receiving
● Error Detection
● Error Correction
YES → 00 NO → 11
YES ???
00 10
COMMUNICATION
FAILURE
What is coding theory?
EXAMPLE:
Stop → 000
Go → 101
●
Wait → 110
“message“ becomes a
“codeword“
STOP 000
SOURCE
ENCODER
000
Terminologies
Decode 000
“received word“ is
reverted back to a SOURCE
DECODER
“message“
000 STOP
STOP
ASCII CODE
Abbreviated from American Standard Code for
Information Interchange, is a character
encoding standard for electronic communication.
Examples:
Encode the message “SAT“ using the 7-bit ASCII code table
shown above.
Received Message: 10
YES ???
00 10
COMMUNICATION
FAILURE
Parity Check Digit
INCLUDE A PARITY CHECK DIGIT 0 or 1
Messages:
YES → 000
NO → 111
YES ???
000 100
Parity Check
An error is detected because 100 does not mean
anything.
Compare the received word 100 and the code
word 000.
Compare the received word 100 and the code
word 111.
Go → 111 111 0
PPPPPRRRRROOOOOCCCCCEEEEEEEEEEDDDDD.
Example
1. Encode the bit string 011001 by repeating each
bit twice.
Solution:
00 11 11 00 00 11
Solution:
000 111 111
Repetition Codes (Majority decoding)
Consider a code where each bit is repeated 3 times.
Suppose we want to transmit the following bit string:
0110100. If no error is made during transmission, the
receiver gets
000 111 111 000 111 000 000.
y = 1111 1010.
d=6 2 5
1111 1111
Minimum Distance of a Code
The minimum distance of a code is the smallest
distance between any two distinct codewords in the
code.
Example: