Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

INTRODUCTION TO

COMMUNICATIONS

COURSE no. 6

Assoc. Prof. Luminiţa SCRIPCARIU

11/7/2018 Luminita Scripcariu 1


FROM THE PREVIOUS COURSE

• OPERATING IN GALOIS FIELDS

• DFT, IDFT

• AES

• Error-Correcting Techniques

11/7/2018 Luminita Scripcariu 2


QUESTION 1
Which of the following algorithms use public
encryption key?
 AES
 DES
 EL-GAMAL
 RSA

11/7/2018 Luminita Scripcariu 3


QUESTION 1
Which of the following algorithms use public
encryption key?
 AES
 DES
 EL-GAMAL
 RSA

11/7/2018 Luminita Scripcariu 4


QUESTION 2
Which of the following statements about AES
are true?
 AES is a private-key algorithm
 AES is a public-key algorithm
 AES is a symmetrical encryption algorithm
 AES is a compression algorithm

11/7/2018 Luminita Scripcariu 5


QUESTION 2
Which of the following statements about AES
are true?
 AES is a private-key algorithm
 AES is a public-key algorithm
 AES is a symmetrical encryption algorithm
 AES is a compression algorithm

11/7/2018 Luminita Scripcariu 6


QUESTION 3
Fill in the blanks with the steps of AES
algorithm:
1. .....................
2. .....................
3. .....................
4. .....................

11/7/2018 Luminita Scripcariu 7


QUESTION 3
Fill in the blanks with the steps of AES
algorithm:
1. SubBytes
2. Shift Rows
3. MixColumns
4. AddRoundKey

11/7/2018 Luminita Scripcariu 8


QUESTION 4
How many iterations does AES run?
 10
 12
 14
 16

11/7/2018 Luminita Scripcariu 9


QUESTION 4
How many iterations does AES run?
 10
 12
 14
 16

11/7/2018 Luminita Scripcariu 10


QUESTION 5
In GF(16), the length of the vectors on
which DFT can be applied is:
 3
 5
 7
 15

11/7/2018 Luminita Scripcariu 11


QUESTION 5
In GF(16), the length of the vectors on
which DFT can be applied is:
 3
 5
 7
 15

11/7/2018 Luminita Scripcariu 12


PROPOSED EXERCISE

Calculate the value of the following


expression in GF(16): E = (11+6*14)/4

Tip: For calculation in GF(16), use the powers of 2:


[ 1 2 4 8 3 6 12 11
5 10 7 14 15 13 9 1]

11/7/2018 Luminita Scripcariu 13


ERROR-CORRECTION
TECHNIQUES

11/7/2018 Luminita Scripcariu 14


Hamming distance
• The Hamming distance between two
binary sequences is equal to the number
of positions corresponding to different bit
values in the two sequences.

• The Hamming distance between


codewords is increased in order to correct
the transmission errors produced by the
channel.
11/7/2018 Luminita Scripcariu 15
Example

11/7/2018 Luminita Scripcariu 16


Another example

11/7/2018 Luminita Scripcariu 17


BINARY BLOCK CODES FOR
ERROR CORRECTION

• Hamming
• Turbo-ASCII
• Turbo-Hamming

11/7/2018 Luminita Scripcariu 18


Hamming Codes H(n;k)
• Hamming codes introduce parity bits in order
to increase the minimum Hamming distance
between code words and to allow error
detection and correction.
• Hamming codes are linear binary codes
because the algorithm uses only modulo-2
operations.
• For these codes, coding tables can be used.
11/7/2018 Luminita Scripcariu 19
H(n,k)
• n-k=m is the minimum Hamming distance
between any two code words.

• If m is odd (2t+1) then the code can detect


and correct t errors.

• If m is even (2t) then the code can detect t


errors and it can correct t-1 errors.
11/7/2018 Luminita Scripcariu 20
Remarks
• A Hamming code is called systematic if
the input sequence is part of the code
word and the generating matrix contains
an identity matrix.

• Systematic codes do not use a decoding


circuit but only the error-correction block.

11/7/2018 Luminita Scripcariu 21


H(n,k) Code Size
• For any natural number, m, greater than 2,
a Hamming code H(2m-1, 2m-1-m) can be
designed.
• m is the minimum Hamming distance
between any two code words.
• Examples: H(7,4), H(15,11), H(31,26)

11/7/2018 Luminita Scripcariu 22


Control Matrix H
• All m-bit combination are written on the
columns of H.

• If H contains the identity matrix H=[P,I],


then the code is systematic and the
generator matrix can be written as

G=[I, PT].
11/7/2018 Luminita Scripcariu 23
Error detection
• The received sequence is divided into n-bit
blocks
• For each block, the syndrome vector is
calculated:
s  Hr T  H (cT  eT )  HGT aT  HeT  HeT

r – the received block.


e – the error vector.

11/7/2018 Luminita Scripcariu 24


H(7,4) Decoding Algorithm
1. Calculate the syndrome vector: s
2. Testing s = [0 0 … 0]? Yes/No
3. Yes =>No errors! Go to step no. 5.
4. No => Find the position of the error and
correct the value.
5. Extract the data.

11/7/2018 Luminita Scripcariu 25


Systematic H(7,4) Code
• What is the coding rate equal to?

• Write the control matrix H = ?

• Write the generating matrix G = ?

• Calculate the coding rate, the redundancy and


the error-correction capacity of the code.

11/7/2018 Luminita Scripcariu 26


PROPOSED EXERCISE
Let us consider the systematic H(7,4) code
and the input data vector a = [ 0 1 0 1].
• Calculate the coded word: c.
• Create an error on the second bit of the
code word and calculate the syndrome
vector: s.
• Compare the syndrome with the columns
of the control matrix H and specify the
error location.
11/7/2018 Luminita Scripcariu 27
Example
Code the following binary
sequence using the H(7,4)
code table:
0100100001100010
Solution:
01001011000011
01100110010110

11/7/2018 Luminita Scripcariu 28


Turbo Coding Principle
Data is written in a 2D structure (matrix).
Data matrix is encoded row-by-row and then
column-by-column by the basic code.
Turbo decoding is done iteratively until no
changes occur.

11/7/2018 Luminita Scripcariu 29


TURBO Coding Principles
• Write the data matrix (interleavers can be
used to mix or permute the symbols).
• Encode each row by the basic code.
• Encode each column by the basic code.
• The encoding rate of the Turbo code is the
ratio between the input symbols number
and the output symbols number (k2:n2).

11/7/2018 Luminita Scripcariu 30


EXAMPLE: Encode the word siemens by
Turbo-ASCII code with odd parity.
[1 1 1 0 0 1 1 0
1 1 0 1 0 0 1 1
1 1 0 0 1 0 1 1
1 1 0 1 1 0 1 0
1 1 0 0 1 0 1 1
1 1 0 1 1 1 0 0
1 1 1 0 0 1 1 0
0 0 1 0 1 0 1 0]

11/7/2018 Luminita Scripcariu 31


Hexadecimal
ASCII

Read the MSB on


columns and LSB
on rows!

11/7/2018 Luminita Scripcariu 32


EXAMPLE 2: Find the error in the Turbo-ASCII
code word written below, if odd parity is used.
[1 1 1 0 0 1 1 0
1 1 0 1 0 0 1 1
1 1 0 1 1 0 1 1
1 1 0 1 1 0 1 0
1 1 0 0 1 0 1 1
1 1 0 1 1 1 0 0
1 1 1 0 0 1 1 0
0 0 1 0 1 0 1 0]

11/7/2018 Luminita Scripcariu 33


Conclusions
• In this case, Turbo-ASCII code has a
coding rate of 49:64.
• The code can locate and correct one bit
error.
• In this case, the correction rate of the code
is 1:64, approximately 1.5 %.

11/7/2018 Luminita Scripcariu 34


PROPOSED EXERCISE

1. Encode your first name by Turbo-ASCII


code with even parity.
2. What is the value of the encoding rate in
this case?
3. What is the correction rate of the code?

11/7/2018 Luminita Scripcariu 35


TURBO-HAMMING(7;4)

• Write the 4x4 data matrix.


• Encode each row by H(7,4) code.
• Encode each column by H(7,4) code.
• A 7x7 matrix results.
• The encoding rate of TH(7,4) code is
16:49~1:3. TH(7,4) code triples the number
of transmitted bits.

11/7/2018 Luminita Scripcariu 36


EXAMPLE
1. Encode the following
sequence by TH74 :
1100 1010 1011 0101
2. Make 7 errors on the first
7 bits of the code matrix and
then decode it iteratively.

11/7/2018 Luminita Scripcariu 37


PERFORMANCES OF TH(7;4) CODE

The code can correct an error-burst of


consecutive 7 bits at maximum, caused by
fading phenomenon on the
communication channel.

11/7/2018 Luminita Scripcariu 38


PROPOSED EXERCISE
Encode the following bit
sequence by TH74 code:

1110 0110 0001 0011.

11/7/2018 Luminita Scripcariu 39


Conclusions
Hamming and Turbo-Hamming codes are:
• block-codes
• binary codes
• memoryless codes.
Each block of bits has a unique
corresponding code word.
The same code table is used for data
encoding and decoding.
11/7/2018 Luminita Scripcariu 40
Reed-Solomon Codes
• Powerful error-correction codes
• Block-codes defined on GF(2m)
• RS(n,n-2t) code can correct t errors, at
maximum.
• DEFINITION: n-DFTof any RS code word
has 2t zeroes.
• Remember: n-DFT exists if and only if n
divides N = 2m-1.
11/7/2018 Luminita Scripcariu 41
RS(n, n-2t) Code:
Time method
• Multiply the data polynomial a(x) by the
generating polynomial g(x):
c(x)=a(x)*g(x).
• Read the coefficients of the resulting
polynomial.

11/7/2018 Luminita Scripcariu 42


The generating polynomial
of RS(n, n-2t) code
g(x) = (x+wn-2t)…(x+wn-1)

• w is the nth order root of the unit, in


GF(2m).
• n divids N=2m-1.
• The generating polynomial has 2t factors
(x+wk, k = (n-2t) up to (n-1)).
• The degree of the polynomial is 2t.
11/7/2018 Luminita Scripcariu 43
Example
• Calculate the generating polynomial of RS(5,3)
code, in GF(16).

• Encode the sequence [1 3 5] by RS(5,3) code


and the time method.
Tips: Use the powers of 2 in GF(16):
[1 2 4 8 3 6 12 11
5 10 7 14 15 13 9 1].

11/7/2018 Luminita Scripcariu 44


RS(n, n-2t) Code:
Frequency method
• The input sequence a is padded with 2t
zerroes:
d = [a1 … an-2t 0 …0].
• Then n-IDFT is applied on it in order to get
the code word:
c = n-IDFT(d).

11/7/2018 Luminita Scripcariu 45


Example
Encode the sequence [1, 2, 3] by RS(5,3) code
and the frequency method (use 8 as the 5th order
root of the unit).

Tips: Use the powers of 2 in GF(16):


[1 2 4 8 3 6 12 11
5 10 7 14 15 13 9 1].

11/7/2018 Luminita Scripcariu 46


>> a=[1 2 3]

a=

1 2 3

>> ap=[1 2 3 0 0]

ap =

1 2 3 0 0

>> w=8;

11/7/2018 Luminita Scripcariu 47


>> w2=powergf(8,2,4)

w2 =

12

>> w3=powergf(8,3,4)

w3 =

10

>> w4=powergf(8,4,4)

w4 =

15

11/7/2018 Luminita Scripcariu 48


>> omega_5=[1 1 1 1 1; 1 w4 w3 w2 w; 1 w3 w w4 w2; 1
w2 w4 w w3; 1 w w2 w3 w4]

omega_5 =

1 1 1 1 1
1 15 10 12 8
1 10 8 15 12
1 12 15 8 10
1 8 12 10 15
>> c=prodm4(omega_5,ap'); c’
ans =

0 1 13 8 5
11/7/2018 Luminita Scripcariu 49
RS(n, n-2t) Code: Systematic
method
• The polynomial d(x)=x2ta(x) is divided by
g(x), on GF(2m).
• The coefficients of the reminder polynomial
are the parity symbols.
• The code word is made up of the input
symbols completed with the parity symbols.

11/7/2018 Luminita Scripcariu 50


Example
• Calculate the generating polynomial of RS(5,3)
code, defined in GF(16).

• Encode the sequence [1 3 5] by RS(5,3) code


using all the encoding methods.
Tip: Use the powers of 2 in GF(16):
[1 2 4 8 3 6 12 11
5 10 7 14 15 13 9 1].

11/7/2018 Luminita Scripcariu 51


PROPOSED EXERCISE
• Calculate the generating polynomial of
RS(7,5) code, defined in GF(8).

• Encode the sequence [1 0 2 0 3] by RS(7,5)


code using the time method.

Tip: Use the powers of 2 in GF(8):

[1 2 4 3 6 7 5].

11/7/2018 Luminita Scripcariu 52

You might also like