SlideShare a Scribd company logo
1 of 30
CSN08704
Data, Audio, Video and Images
http://asecuritysite.com/comms
Telecommunications
Prof Bill Buchanan
5: Error Coding
CSN08704
Data, Audio, Video and Images
http://asecuritysite.com/comms
Telecommunications
Prof Bill Buchanan
5: Error Coding: Modulo-2
Modulo-2
Digital coding uses modulo-2 arithmetic where addition becomes the following
operations:
• 0+0=0 1+1=0
• 0+1=1 1+0=1
It performs the equivalent operation to an exclusive-OR (XOR) function. For
modulo-2 arithmetic, subtraction is the same operation as addition:
• 0–0=0 1–1=0
• 0–1=1 1–0=1
Multiplication is performed with the following:
• 00=0 01=0
• 10=0 11=1
which is an equivalent operation to a logical AND operation.
Binary Manipulation
• Link.
10111 x4
+x2
+x+1
1000 0001 x7
+ 1
1111 1111 1111 1111 x11
+x10
+x9
+x8
+x7
+x6
+x5
+x4
+x3
+x2
+x+1
10101010 x6
+x4
+x2
+x
For example: 101110
is represented as: (x2
+1)(x2
+x)
which equates to: x4
+x3
+x2
+x
which is thus: 11110
Binary Manipulation
• x4+x4+x2+1+1 becomes x2
as x4+x4 =0
Binary Manipulation
• Link.
Thus: 1010101110
is represented as: (x4
+x2
+1)(x3
+x2
+x)
which equates to: x7
+x6
+x5
+x5
+x4
+x3
+x3
+x2
+x
which equates to: x7
+x6
+x4
+x2
+x
which is thus: 11010110
Modulo-2 Division
• Link.
1011
100 101101
100
110
100
101
100
1
Hamming distance
• Hamming difference between 101101010 and 011101100? Link.
• The Hamming distance can be used to determine how well the code
will cope with errors. The minimum Hamming distance min{d(C1,C2)}
defines by how many bits the code must change so that one code can
become another code.
• A code C can detect up to N errors for any code word if d(C) is greater
than or equal to N+1 (that is, d(C)N+1).
• A code C can correct up to M errors in any code word if d(C) is greater
than or equal to 2M+1 (that is, d(C)2M+1).
Error detection
• For example: {00000, 01101, 10110, 11011} has a Hamming distance
of 3. Link.
• d(C)N+1
• d(C) is 3, thus N must be 2. So we can detect one or two bits in error
in the code.
• Eg 00000 could become 01010 ... and this will be detected as an error,
as the code does not exist.
Error correction
• For example: {00000, 01101, 10110, 11011} has a Hamming distance
of 3. Link.
• d(C)2M+1
• d(C) is 3, thus M must be 1. So we can correct one bit in error in the
code.
• Eg 00000 could become 00010 ... and as the nearest code will be
“00000”.
Examples
• What is the Hamming distance of {00000000, 11111111, 11110000,
01010101} Link? How many errors can be detected? How many errors
can be corrected?
• What is the Hamming distance of {10111101011, 10011111011,
11110101011, 10100101011, 10111101000} Link?
CSN08704
Data, Audio, Video and Images
http://asecuritysite.com/comms
Telecommunications
Prof Bill Buchanan
5: Error Coding: Error Correction
Linear and cyclic codes
• Linear Code: sum of any two codes equals another code - {00, 01, 10,
11} and {00000, 01101, 10110, 11011}.
• Cyclic Codes: Linear Code + When a cyclic shift also gives a code word
- {0000, 0110, 0011, 1001, 1100, 0001, 0010, 0100, 1000}
• Is {000, 010, 011, 100, 001} cyclic?
Block parity
• Odd parity (make number of 1s
odd) or Even parity (make
number of 1s even).
• Detects single bit errors.
• Cannot detect when two bits in
error in the same position.
• Example (binary). Link.
• Example (int). Link.
1 0000 0001
4 0000 0100
12 0000 1100
–1 1111 1111
–6 1111 1010
17 0001 0001
0 0000 0000
–10 1111 0110
1110 1011
CSN08704
Data, Audio, Video and Images
Telecommunications
Cyclic Redundancy Check
Cyclic redundancy checking (CRC)
Example: We have 32, and make it divisible by 9, we add a ‘0’ to make
‘320’, and now divide by 9, to give 35 remainder 4. So lets add ‘4’ to
make 324. Now when it is received we divide by 9, and if the answer is
zero, there are no errors, and we can ignore the last digit.
CRC-CCITT: x16+x12+x5+1
• The error correction code is 16 bits long and is the remainder
of the data message polynomial G(x) divided by the
generator polynomial P(x) (x16+x12+x5+1, i.e.
10001000000100001).
• The quotient is discarded and the remainder is truncated to
16 bits. This is then appended to the message as the coded
word.
x16+x12+x5+1 G(x)
CRC Example
• Example. Link.
For a 7-bit data code 1001100 determine the encoded bit pattern using a CRC generating
polynomial of P(x)=x3
+x2
+x0
. Show that the receiver will not detect an error if there are no
bits in error.
P(x)=x3
+x2
+x0
(1101)
G(x)=x6
+x3
+x2
(1001100)
Multiply by the number of bits in the CRC polynomial.
x3
(x6
+x3
+x2
)
x9
+x6
+x5
(1001100000)
Figure 5.3 shows the operations at the transmitter. The transmitted message is thus:
1001100001
Figure 5.3
CRC (Receiving)
• Example. Link.
For a 7-bit data code 1001100 determine the encoded bit pattern using a CRC generating
polynomial of P(x)=x3
+x2
+x0
. Show that the receiver will not detect an error if there are no
bits in error.
P(x)=x3
+x2
+x0
(1101)
G(x)=x6
+x3
+x2
(1001100)
Multiply by the number of bits in the CRC polynomial.
x3
(x6
+x3
+x2
)
x9
+x6
+x5
(1001100000)
Figure 5.3 shows the operations at the transmitter. The transmitted message is thus:
1001100001
No error!
LRC/VRC
• Link.
F r e d d y LRC
b0 0 0 1 0 0 1 0
b1 1 1 0 0 0 0 0
b2 1 0 1 1 1 0 0
b3 0 0 0 0 0 1 1
b4 0 1 0 0 0 1 0
b5 0 1 1 1 1 1 1
b6 1 1 1 1 1 1 0
VRC 0 1 1 0 0 0 1
CSN08704
Data, Audio, Video and Images
http://asecuritysite.com/comms
Telecommunications
Prof Bill Buchanan
Hamming Code
Hamming Codes
Error correction: m is number of bits in the data symbol
n is number of Hamming bits
Eg if we have 4 bits (m=4). Then to correct we need n=3 (as 8 is greater
than or equal to 4+3+1).
How many error correcting bits would be need for 5 bits?
12  nmn
Hamming Codes
The character is 011001
The Hamming bits are HHHH
The message format will be 01H100H1HH
Position Code
9 1001
7 0111
3 0011
XOR 1101
10 9 8 7 6 5 4 3 2 1
0 1 1 1 0 0 1 1 0 1
Hamming Codes
Position Code
Hamming 1101
9 1001
7 0111
3 0011
XOR 0000
Position Code
Hamming 1101
9 1001
7 0111
5 0101
3 0011
XOR 0101
No error Error in bit 5
10 9 8 7 6 5 4 3 2 1
0 1 1 1 0 0 1 1 0 1
Hamming Code
Sending:
Receiving:
P1 =D1  D2  D4
P2 =D1  D3  D4
P3 =D2  D3  D4
D4 D3 D2 P3 D1 P2 P1
111 110 101 100 011 010 001
S1 =P1  D1  D2  D4
S2 =P2  D1  D3  D4
S3 =P3  D2  D3  D4
Hamming Code











1111000
1100110
1010101
H
Check of P1
Check of P2
Check of P3
Hamming Code (receiving)
• At the receiver we calculate the Syndrome matrix S ... if all zeros ... no
error!












































3
2
1
4
3
2
3
1
2
1
1111000
1100110
1010101
S
S
S
D
D
D
P
D
P
P
T
HRS
Hamming Code (Example)
• Link.











1111000
1100110
1010101
H and























0
1
0
1
1
0
1
T
T
D1
D2
D3
D4
 4323121 DDDPDPPT
and D1=1, D2=0, D3=1, D4=0
for even parity:
P1 checks the 1st, 3rd, 5th and 7th, so P1  D1  D2  D4 = 0; thus P1 =1
P2 checks the 2nd, 3rd, 6th and 7th, so P2  D1  D3  D4 = 0; thus P2 =0
P3 checks the 4th, 5th, 6th and 7th, so P3  D2  D3  D4 = 0; thus P3 =1
Hamming Code
• Let’s check the Syndrome matrix:


























































0
0
0
0.11.10.11.11.00.01.0
0.11.10.01.01.10.11.0
0.11.00.11.01.10.01.1
0
1
0
1
1
0
1
1111000
1100110
1010101
T
HT
No error!
Hamming Code
Error:
 0111101R
Error in bit 5


























































1
0
1
0.11.11.11.11.00.01.0
0.11.11.01.01.10.11.0
0.11.01.11.01.10.01.1
0
1
1
1
1
0
1
1111000
1100110
1010101
T
HR
CSN08704
Data, Audio, Video and Images
http://asecuritysite.com/comms
Telecommunications
Prof Bill Buchanan
5: Error Coding

More Related Content

What's hot

Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemISMT College
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMRishabh Kanth
 
Binary Mathematics Classwork and Hw
Binary Mathematics Classwork and HwBinary Mathematics Classwork and Hw
Binary Mathematics Classwork and HwJoji Thompson
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
 
01.number systems
01.number systems01.number systems
01.number systemsrasha3
 
digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointdigital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointRai University
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...Arti Parab Academics
 
Chapter 6 base_number
Chapter 6 base_numberChapter 6 base_number
Chapter 6 base_numberNazrul Shah
 
Decimal to Binary Conversion
Decimal to Binary ConversionDecimal to Binary Conversion
Decimal to Binary Conversionadil raja
 
Numbersystemcont
NumbersystemcontNumbersystemcont
NumbersystemcontSajib
 
ALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMSALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMSvinaygoel18
 

What's hot (20)

Binary Arithmetic Operations
Binary Arithmetic OperationsBinary Arithmetic Operations
Binary Arithmetic Operations
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEM
 
06 floating point
06 floating point06 floating point
06 floating point
 
Binary Mathematics Classwork and Hw
Binary Mathematics Classwork and HwBinary Mathematics Classwork and Hw
Binary Mathematics Classwork and Hw
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
01.number systems
01.number systems01.number systems
01.number systems
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
 
digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointdigital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed point
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
Chapter 6 base_number
Chapter 6 base_numberChapter 6 base_number
Chapter 6 base_number
 
Binary number systems
Binary number systemsBinary number systems
Binary number systems
 
Class03
Class03Class03
Class03
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Decimal to Binary Conversion
Decimal to Binary ConversionDecimal to Binary Conversion
Decimal to Binary Conversion
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 
01.number systems
01.number systems01.number systems
01.number systems
 
ALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMSALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMS
 

Similar to 5. Error Coding

Oth1
Oth1Oth1
Oth1b137
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Studentsshaival
 
CRC implementation
CRC implementation CRC implementation
CRC implementation ajay singh
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksNt Arvind
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptxsulekhasaxena2
 
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPT
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPTGROUP03_AMAK:ERROR DETECTION AND CORRECTION PPT
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPTKrishbathija
 
05 directnets errors
05 directnets errors05 directnets errors
05 directnets errorsjyang1983
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionJeoffnaRuth
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
Lecture4 binary-numbers-logic-operations
Lecture4  binary-numbers-logic-operationsLecture4  binary-numbers-logic-operations
Lecture4 binary-numbers-logic-operationsmarkme18
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptxAminaZahid16
 
New error-detection
New error-detectionNew error-detection
New error-detectionNitesh Singh
 

Similar to 5. Error Coding (20)

Oth1
Oth1Oth1
Oth1
 
Data linklayer
Data linklayerData linklayer
Data linklayer
 
Lecture set 3
Lecture set 3Lecture set 3
Lecture set 3
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Students
 
CRC implementation
CRC implementation CRC implementation
CRC implementation
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networks
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptx
 
Dpsd lecture-notes
Dpsd lecture-notesDpsd lecture-notes
Dpsd lecture-notes
 
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPT
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPTGROUP03_AMAK:ERROR DETECTION AND CORRECTION PPT
GROUP03_AMAK:ERROR DETECTION AND CORRECTION PPT
 
05 directnets errors
05 directnets errors05 directnets errors
05 directnets errors
 
Chapter 10: Error Correction and Detection
Chapter 10: Error Correction and DetectionChapter 10: Error Correction and Detection
Chapter 10: Error Correction and Detection
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codes
 
Digital Logic & Design
Digital Logic & DesignDigital Logic & Design
Digital Logic & Design
 
Ch3 datalink
Ch3 datalinkCh3 datalink
Ch3 datalink
 
Lecture4 binary-numbers-logic-operations
Lecture4  binary-numbers-logic-operationsLecture4  binary-numbers-logic-operations
Lecture4 binary-numbers-logic-operations
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 
New error-detection
New error-detectionNew error-detection
New error-detection
 

More from Napier University

10. Data to Information: NumPy and Pandas
10. Data to Information: NumPy and Pandas10. Data to Information: NumPy and Pandas
10. Data to Information: NumPy and PandasNapier University
 
The Road Ahead for Ripple, Marjan Delatinne
The Road Ahead for Ripple, Marjan DelatinneThe Road Ahead for Ripple, Marjan Delatinne
The Road Ahead for Ripple, Marjan DelatinneNapier University
 
Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt
 Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt
Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-WattNapier University
 
RMIT Blockchain Innovation Hub, Chris Berg
RMIT Blockchain Innovation Hub, Chris BergRMIT Blockchain Innovation Hub, Chris Berg
RMIT Blockchain Innovation Hub, Chris BergNapier University
 
Browser-based Crypto M, C. F Mondschein
Browser-based Crypto M, C. F MondscheinBrowser-based Crypto M, C. F Mondschein
Browser-based Crypto M, C. F MondscheinNapier University
 
Should we transform or adapt to blockchain - a public sector perspective?, Al...
Should we transform or adapt to blockchain - a public sector perspective?, Al...Should we transform or adapt to blockchain - a public sector perspective?, Al...
Should we transform or adapt to blockchain - a public sector perspective?, Al...Napier University
 
IoT device attestation system using blockchain, Alistair Duke
IoT device attestation system using blockchain, Alistair DukeIoT device attestation system using blockchain, Alistair Duke
IoT device attestation system using blockchain, Alistair DukeNapier University
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarNapier University
 
Using Blockchain for Evidence Purpose, Rafael Prabucki
Using Blockchain for Evidence Purpose, Rafael PrabuckiUsing Blockchain for Evidence Purpose, Rafael Prabucki
Using Blockchain for Evidence Purpose, Rafael PrabuckiNapier University
 
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...Napier University
 
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata Fereirra
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata FereirraEmerging Regulatory Approaches to Blockchain-based Token Economy, Agata Fereirra
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata FereirraNapier University
 

More from Napier University (20)

Intrusion Detection Systems
Intrusion Detection SystemsIntrusion Detection Systems
Intrusion Detection Systems
 
Networks
NetworksNetworks
Networks
 
Memory, Big Data and SIEM
Memory, Big Data and SIEMMemory, Big Data and SIEM
Memory, Big Data and SIEM
 
What is Cyber Data?
What is Cyber Data?What is Cyber Data?
What is Cyber Data?
 
Open Source Intelligence
Open Source IntelligenceOpen Source Intelligence
Open Source Intelligence
 
10. Data to Information: NumPy and Pandas
10. Data to Information: NumPy and Pandas10. Data to Information: NumPy and Pandas
10. Data to Information: NumPy and Pandas
 
2. Defence Systems
2. Defence Systems2. Defence Systems
2. Defence Systems
 
1. Cyber and Intelligence
1. Cyber and Intelligence1. Cyber and Intelligence
1. Cyber and Intelligence
 
The Road Ahead for Ripple, Marjan Delatinne
The Road Ahead for Ripple, Marjan DelatinneThe Road Ahead for Ripple, Marjan Delatinne
The Road Ahead for Ripple, Marjan Delatinne
 
Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt
 Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt
Delivering The Tel Aviv Stock Exchange Securities, Duncan Johnston-Watt
 
ARTiFACTS, Emma Boswood
ARTiFACTS, Emma BoswoodARTiFACTS, Emma Boswood
ARTiFACTS, Emma Boswood
 
RMIT Blockchain Innovation Hub, Chris Berg
RMIT Blockchain Innovation Hub, Chris BergRMIT Blockchain Innovation Hub, Chris Berg
RMIT Blockchain Innovation Hub, Chris Berg
 
Keynote, Naseem Naqvi
Keynote, Naseem Naqvi Keynote, Naseem Naqvi
Keynote, Naseem Naqvi
 
Browser-based Crypto M, C. F Mondschein
Browser-based Crypto M, C. F MondscheinBrowser-based Crypto M, C. F Mondschein
Browser-based Crypto M, C. F Mondschein
 
Should we transform or adapt to blockchain - a public sector perspective?, Al...
Should we transform or adapt to blockchain - a public sector perspective?, Al...Should we transform or adapt to blockchain - a public sector perspective?, Al...
Should we transform or adapt to blockchain - a public sector perspective?, Al...
 
IoT device attestation system using blockchain, Alistair Duke
IoT device attestation system using blockchain, Alistair DukeIoT device attestation system using blockchain, Alistair Duke
IoT device attestation system using blockchain, Alistair Duke
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
 
Using Blockchain for Evidence Purpose, Rafael Prabucki
Using Blockchain for Evidence Purpose, Rafael PrabuckiUsing Blockchain for Evidence Purpose, Rafael Prabucki
Using Blockchain for Evidence Purpose, Rafael Prabucki
 
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...
Cryptocurrencies and cyberlaundering- the need for regulation, Gian Marco Bov...
 
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata Fereirra
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata FereirraEmerging Regulatory Approaches to Blockchain-based Token Economy, Agata Fereirra
Emerging Regulatory Approaches to Blockchain-based Token Economy, Agata Fereirra
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

5. Error Coding

  • 1. CSN08704 Data, Audio, Video and Images http://asecuritysite.com/comms Telecommunications Prof Bill Buchanan 5: Error Coding
  • 2. CSN08704 Data, Audio, Video and Images http://asecuritysite.com/comms Telecommunications Prof Bill Buchanan 5: Error Coding: Modulo-2
  • 3. Modulo-2 Digital coding uses modulo-2 arithmetic where addition becomes the following operations: • 0+0=0 1+1=0 • 0+1=1 1+0=1 It performs the equivalent operation to an exclusive-OR (XOR) function. For modulo-2 arithmetic, subtraction is the same operation as addition: • 0–0=0 1–1=0 • 0–1=1 1–0=1 Multiplication is performed with the following: • 00=0 01=0 • 10=0 11=1 which is an equivalent operation to a logical AND operation.
  • 4. Binary Manipulation • Link. 10111 x4 +x2 +x+1 1000 0001 x7 + 1 1111 1111 1111 1111 x11 +x10 +x9 +x8 +x7 +x6 +x5 +x4 +x3 +x2 +x+1 10101010 x6 +x4 +x2 +x For example: 101110 is represented as: (x2 +1)(x2 +x) which equates to: x4 +x3 +x2 +x which is thus: 11110
  • 5. Binary Manipulation • x4+x4+x2+1+1 becomes x2 as x4+x4 =0
  • 6. Binary Manipulation • Link. Thus: 1010101110 is represented as: (x4 +x2 +1)(x3 +x2 +x) which equates to: x7 +x6 +x5 +x5 +x4 +x3 +x3 +x2 +x which equates to: x7 +x6 +x4 +x2 +x which is thus: 11010110
  • 7. Modulo-2 Division • Link. 1011 100 101101 100 110 100 101 100 1
  • 8. Hamming distance • Hamming difference between 101101010 and 011101100? Link. • The Hamming distance can be used to determine how well the code will cope with errors. The minimum Hamming distance min{d(C1,C2)} defines by how many bits the code must change so that one code can become another code. • A code C can detect up to N errors for any code word if d(C) is greater than or equal to N+1 (that is, d(C)N+1). • A code C can correct up to M errors in any code word if d(C) is greater than or equal to 2M+1 (that is, d(C)2M+1).
  • 9. Error detection • For example: {00000, 01101, 10110, 11011} has a Hamming distance of 3. Link. • d(C)N+1 • d(C) is 3, thus N must be 2. So we can detect one or two bits in error in the code. • Eg 00000 could become 01010 ... and this will be detected as an error, as the code does not exist.
  • 10. Error correction • For example: {00000, 01101, 10110, 11011} has a Hamming distance of 3. Link. • d(C)2M+1 • d(C) is 3, thus M must be 1. So we can correct one bit in error in the code. • Eg 00000 could become 00010 ... and as the nearest code will be “00000”.
  • 11. Examples • What is the Hamming distance of {00000000, 11111111, 11110000, 01010101} Link? How many errors can be detected? How many errors can be corrected? • What is the Hamming distance of {10111101011, 10011111011, 11110101011, 10100101011, 10111101000} Link?
  • 12. CSN08704 Data, Audio, Video and Images http://asecuritysite.com/comms Telecommunications Prof Bill Buchanan 5: Error Coding: Error Correction
  • 13. Linear and cyclic codes • Linear Code: sum of any two codes equals another code - {00, 01, 10, 11} and {00000, 01101, 10110, 11011}. • Cyclic Codes: Linear Code + When a cyclic shift also gives a code word - {0000, 0110, 0011, 1001, 1100, 0001, 0010, 0100, 1000} • Is {000, 010, 011, 100, 001} cyclic?
  • 14. Block parity • Odd parity (make number of 1s odd) or Even parity (make number of 1s even). • Detects single bit errors. • Cannot detect when two bits in error in the same position. • Example (binary). Link. • Example (int). Link. 1 0000 0001 4 0000 0100 12 0000 1100 –1 1111 1111 –6 1111 1010 17 0001 0001 0 0000 0000 –10 1111 0110 1110 1011
  • 15. CSN08704 Data, Audio, Video and Images Telecommunications Cyclic Redundancy Check
  • 16. Cyclic redundancy checking (CRC) Example: We have 32, and make it divisible by 9, we add a ‘0’ to make ‘320’, and now divide by 9, to give 35 remainder 4. So lets add ‘4’ to make 324. Now when it is received we divide by 9, and if the answer is zero, there are no errors, and we can ignore the last digit. CRC-CCITT: x16+x12+x5+1 • The error correction code is 16 bits long and is the remainder of the data message polynomial G(x) divided by the generator polynomial P(x) (x16+x12+x5+1, i.e. 10001000000100001). • The quotient is discarded and the remainder is truncated to 16 bits. This is then appended to the message as the coded word. x16+x12+x5+1 G(x)
  • 17. CRC Example • Example. Link. For a 7-bit data code 1001100 determine the encoded bit pattern using a CRC generating polynomial of P(x)=x3 +x2 +x0 . Show that the receiver will not detect an error if there are no bits in error. P(x)=x3 +x2 +x0 (1101) G(x)=x6 +x3 +x2 (1001100) Multiply by the number of bits in the CRC polynomial. x3 (x6 +x3 +x2 ) x9 +x6 +x5 (1001100000) Figure 5.3 shows the operations at the transmitter. The transmitted message is thus: 1001100001 Figure 5.3
  • 18. CRC (Receiving) • Example. Link. For a 7-bit data code 1001100 determine the encoded bit pattern using a CRC generating polynomial of P(x)=x3 +x2 +x0 . Show that the receiver will not detect an error if there are no bits in error. P(x)=x3 +x2 +x0 (1101) G(x)=x6 +x3 +x2 (1001100) Multiply by the number of bits in the CRC polynomial. x3 (x6 +x3 +x2 ) x9 +x6 +x5 (1001100000) Figure 5.3 shows the operations at the transmitter. The transmitted message is thus: 1001100001 No error!
  • 19. LRC/VRC • Link. F r e d d y LRC b0 0 0 1 0 0 1 0 b1 1 1 0 0 0 0 0 b2 1 0 1 1 1 0 0 b3 0 0 0 0 0 1 1 b4 0 1 0 0 0 1 0 b5 0 1 1 1 1 1 1 b6 1 1 1 1 1 1 0 VRC 0 1 1 0 0 0 1
  • 20. CSN08704 Data, Audio, Video and Images http://asecuritysite.com/comms Telecommunications Prof Bill Buchanan Hamming Code
  • 21. Hamming Codes Error correction: m is number of bits in the data symbol n is number of Hamming bits Eg if we have 4 bits (m=4). Then to correct we need n=3 (as 8 is greater than or equal to 4+3+1). How many error correcting bits would be need for 5 bits? 12  nmn
  • 22. Hamming Codes The character is 011001 The Hamming bits are HHHH The message format will be 01H100H1HH Position Code 9 1001 7 0111 3 0011 XOR 1101 10 9 8 7 6 5 4 3 2 1 0 1 1 1 0 0 1 1 0 1
  • 23. Hamming Codes Position Code Hamming 1101 9 1001 7 0111 3 0011 XOR 0000 Position Code Hamming 1101 9 1001 7 0111 5 0101 3 0011 XOR 0101 No error Error in bit 5 10 9 8 7 6 5 4 3 2 1 0 1 1 1 0 0 1 1 0 1
  • 24. Hamming Code Sending: Receiving: P1 =D1  D2  D4 P2 =D1  D3  D4 P3 =D2  D3  D4 D4 D3 D2 P3 D1 P2 P1 111 110 101 100 011 010 001 S1 =P1  D1  D2  D4 S2 =P2  D1  D3  D4 S3 =P3  D2  D3  D4
  • 26. Hamming Code (receiving) • At the receiver we calculate the Syndrome matrix S ... if all zeros ... no error!                                             3 2 1 4 3 2 3 1 2 1 1111000 1100110 1010101 S S S D D D P D P P T HRS
  • 27. Hamming Code (Example) • Link.            1111000 1100110 1010101 H and                        0 1 0 1 1 0 1 T T D1 D2 D3 D4  4323121 DDDPDPPT and D1=1, D2=0, D3=1, D4=0 for even parity: P1 checks the 1st, 3rd, 5th and 7th, so P1  D1  D2  D4 = 0; thus P1 =1 P2 checks the 2nd, 3rd, 6th and 7th, so P2  D1  D3  D4 = 0; thus P2 =0 P3 checks the 4th, 5th, 6th and 7th, so P3  D2  D3  D4 = 0; thus P3 =1
  • 28. Hamming Code • Let’s check the Syndrome matrix:                                                           0 0 0 0.11.10.11.11.00.01.0 0.11.10.01.01.10.11.0 0.11.00.11.01.10.01.1 0 1 0 1 1 0 1 1111000 1100110 1010101 T HT No error!
  • 29. Hamming Code Error:  0111101R Error in bit 5                                                           1 0 1 0.11.11.11.11.00.01.0 0.11.11.01.01.10.11.0 0.11.01.11.01.10.01.1 0 1 1 1 1 0 1 1111000 1100110 1010101 T HR
  • 30. CSN08704 Data, Audio, Video and Images http://asecuritysite.com/comms Telecommunications Prof Bill Buchanan 5: Error Coding