0% found this document useful (0 votes)
42 views21 pages

WK13a Coding Theory

The received message has more than one bit error. Using repetition code, we repeat the original message 5 times. Since the received message does not match any of the 5 repetitions, we can deduce that an error has occurred during transmission. The receiver then requests for retransmission.

Uploaded by

Karylle Tabor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views21 pages

WK13a Coding Theory

The received message has more than one bit error. Using repetition code, we repeat the original message 5 times. Since the received message does not match any of the 5 repetitions, we can deduce that an error has occurred during transmission. The receiver then requests for retransmission.

Uploaded by

Karylle Tabor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

C5 -Mathematics as a Tool

Lesson 1 -Coding Theory


Communication Systems
▪ is an integrated system of communication hardware
▪ This can include telecommunication networks, transmission systems, relay station,
computers, internet and more.
Communication Channel
▪ is the physical medium through which information is transmitted.
▪ This includes computer networking, fiber-optic lines, wi-fi (wireless fidelity), telephone lines,
internet cables and many more.

Communication Channel

Receiver Sender
Storage Devices

▪ magnetic disks (hard drives)


▪ magnetic tapes (cartridges)
▪ DVD (digital versatile disc)
▪ USB (universal serial bus) and many more.
Coding Theory
▪ is the study of the properties of codes and their respective fitness for
specific applications.
▪ is used to detect, or even correct those errors that occurred during the
transmission of messages over the communication lines.

Codes are used for:


▪ data compression (zip)
▪ extracting the contents of the file (unzip)
▪ cryptography
▪ error detection and correction
▪ data transmission and data storage
Coding Techniques

1. Source Coding (data compression)


2. Channel Coding (error control)
3. Cryptographic Coding
4. Line Coding
ASCII Code
(American Standard Code for Information Interchange)
binary digit (bit) –the smallest unit of measurement used to quantify computer data.
It contains a single binary value of 0 or 1.
byte -is a unit of data that is eight binary digits long. It is the unit most computers use to
represent a character such as letter, number, color and many more.

ASCII Code
Character
Binary Value (8-bit) Decimal Value

A 0100 0001 65
B 0100 0010 66
a 0110 0001 97
b 0110 0010 98
Two Processes in Coding

1. Encoding -transforming messages into bits of message that is


suitable to the communication channel.
ABBA ≡ 0100 0001 0100 0010 0100 0010 0100 0001

2.Decoding -translating the coded message into original language


or form.
0110 0001 0110 0010 0110 0010 0110 0001 ≡ abba
1. Source Coding (data compression)

▪ is defined as converting the messages from the sender


into bits suitable to the communication channel.
• ASCII Code converts each character in the message
to a byte of 8 bits.
• the commonly used alphabet is the binary system
where it uses the numbers zero (0) and one (1).
ABBA ≡ 0100 0001 0100 0010 0100 0010 0100 0001
Source Coding north = 00
south = 01
east = 10
west = 11

Sender 00
Receiver
Noise 01

Source Communication Source


Encoder 00 00 Channel 01 Decoder 01

▪ The sender sends a message.


▪ The message pass through the source encoder and communication channel.
▪ When it encounters several “noises” the message is altered.
▪ That causes disruption and error in the message.
telephone, analog
▪ The receiver receives the wrong message. modem, digital
Noise

▪ is any disturbance that interferes with data transmission and


corrupts the quality of the signal.

Noises are caused by:


▪ Audio or video signal noise (loose connection, crosstalk)
▪ Electrical signal noise (power surges/spikes)
▪ Wireless signal noise (out of range, receiver blocked)
▪ Sunspots (strong magnetic fields), lightning, meteor
showers, or even human errors like poor typing and poor
hearing.
Parity Check (vertical redundancy check)
▪ is a method of detecting errors in data communications or
within a computer system by counting the number of ones (1) or
zeroes (0) per byte or per word, including a special check bit
(parity bit), to see if the value is even or odd.
▪ is the most basic form of error detection in communication.
▪ Parity bit (check bit) - is a single bit added to a string of binary
code.
Parity Bits
There are two types of parity bits in error detection:
1. Even parity - the number of one (1) bit is even.
100 1101 100 0111 100 0001

2. Odd parity -the number of one (1) bit is odd.


100 0101 100 0011 100 1111
2. Channel Coding (error control)
▪ is defined as adding some form of redundancy to the
source encoded message so that the errors can be
detected or even corrected, or
▪ adds some extra bits in the form of parity bits in order to
protect the data from being becoming corrupt.
a. If the number of set bits is even, add 0 parity bit.
Example: 10111 101110

b. If the number of set bits is odd, adds 1 parity bit.


Example: 10110 101101

Note: In Channel Encoding, make the parity even.


Exercise 1 – Source Encoding
Suppose the following messages are source encoded given by the table:
North South East West
10 11 00 01

1. Encode the set of directions given below:


Set of Directions Source Encoding
North-West-South-East 10011100
East-West-South-North 00011110

2. Decode the set of directions given by the message received:


Message Received Decoded Message
10010010 North-West-East-North
01001111 West-East-South-South
Exercise 2 –Channel Coding
Complete the table by writing the channel encoded message using parity
check by adding one bit in the message.

Message Source Encoding Channel Encoding*


Beauty 1000 10001
Serene 1010 10100
Calm 0100 01001
Quiet 1111 11110
Peaceful 0110 01100
*make the bit parity even
Channel Coding
Transmitting Side Receiving Side
Sender 10111 Receiver

Source Encoder ERROR Source Decoder


10111 Noise

Channel Encoder Communication Channel Channel Decoder


101110 100110
▪ On the transmitting side, the device counts the number of set bits in each group.
For example, the sender send the message 10111.
▪ The Source Encoder reads it as 10111.
▪ Then, the Channel Encoder protects the data by adding 0 bit.
▪ On the receiving side, the device checks each byte to make sure that it has an even
number of set bits.
▪ The receiving side computes the parity (100110): 1+0+0+1+1+0 = 3.
▪ It then performs 3 modulo 2 = 1 (the remainder of 3 divided by 2 is 1), indicating odd
parity which means an error occurred during transmission.
▪ Since error occurred, it asks/instructs the sending device to send the data again.
▪ Otherwise, if no error occurred correct data is received.
Channel Coding
Transmitting Side Receiving Side
Sender 10111 10111 Receiver

Source Encoder 10111 10111 Source Decoder


Noise

Channel Encoder Communication Channel Channel Decoder


101110 101110
▪ On the transmitting side, the device counts the number of set bits in each group.
For example, the sender send the message 10111.
▪ The Source Encoder reads it as 10111.
▪ Then, the Channel Encoder protects the data by adding 0 bit.
▪ On the receiving side, the device checks each byte to make sure that it has
an even number of set bits.
▪ The receiving computer calculates 1+0+1+1+1+0 = 4.
▪ It then performs 4 modulo 2 = 0, indicating even parity.
▪ The parity bit 0 from the end of the sequence is stripped off.
▪ Then, the data 10111 is accepted.
Repetition Code

▪ is the most basic error-correcting codes.


▪ sometimes called as Hamming Code after the name
of its inventor, Richard Hamming.

NR = 2r + 1
where: NR = number of repetitions
r = fixed integer, r ≥ 1
k = length of the message (001, k=3)
Repetition Code
Example 1: Suppose that the source code encoded message is 101
where k = 3 and choosing r = 2, then:

NR = 2r + 1
= 2(2) + 1 = 5

So, we must repeat 101 (k=3, length of the message) five


times. That is,

101 | 101 |101 | 101 | 101


1 2 3 4 5
Repetition Code
Example 2: Encoded Message: 101 k=3 r = 2 NR = 5

Assume that the message is transmitted through a noisy channel


and distorted. The message received is:
111 | 101 | 100 | 011 | 100 Most
1 2 3 4 5 Frequent
bits

▪ Take the 1st bit from each group: 1 1 1 0 1 1


▪ Take the 2nd bits from each group: 1 0 0 1 0 0
▪ Take the 3rd bits from each group: 1 1 0 1 0 1
✓ The decoded message (original message sent): 101

You might also like