DISCRETE Coding Chapter 2

Encoding and Decoding :

m n An Encoding function is an one-to-one function E: Z 2 → Z 2 which provides a means to detect OR correct Errors occurred during transmission of signals(0’s and 1’s)

The above process is known as Encoding process.

n m A Decoding function is an onto function E: Z 2 → Z 2 which provides a means to recapture the transmitted word The process is known as Decoding process.

The word after encoding is – word.

The rule given by encoding function(E) is known as CODE

EXAMPLES

( Coding function of ex. 1 & 2 are known as (m,m+1) parity-check code)

8 9 8 1. An Encoding function E: Z 2 → Z 2 is defined as each w1 w2 w3w4 w5 w6 w7 w8 ∈ Z 2

,E(w) = w1 w2 w3w4 w5 w6 w7 w8 w9 where w9 = Σ wi i =1 to 8.(Sum wrt modulo 2)

Discuss the significance of E(w).

FURTHER if p = 0.002 is the probability of incorrect transformation of signals find the probability that a code word (say 110010010 ) is received with at most one error

Solution 1:the significance of E(w).

E(w) = w1 w2 w3w4 w5 w6 w7 w8 w9 where w9 = Σ wi i =1 to 8.(Sum wrt modulo 2)

if w = w 1 w2 w3w4 w5 w6 w7 w8

(1) has even number of 1’s then w9 is 0

(2) has odd number of 1’s then w9 is 1

In both the cases coded word contains even number of 1’s

Next we find probability.

As

p = 0.002 probability of receiving word with at the most one error

= p0(1-p) 9 +p 1(1-p) 8 = 0.002 0(1-0.002) 10 + 0.002 1(1-0.002) 8

m m+1 8 Q2. An Encoding function E: Z 2 → Z 2 is defined as each w1 w2 w3w4 w5 w6 w7 w8 ∈ Z 2

,E(w) = E(w1 w2 w3…w m) = w1 w2 w3…w mwm+1

wm+1 = 0, if w contains even number of 1’s

=1, if w contains odd number of 1’s

m+1 m and Decoding function D: Z 2 → Z 2 with D(w) = D(r1 r2 r3…r mrm+1 ) = r1 r2 r3…r m

1. encode (find codeword) of

3 000,001,011,100,110,101,010 ∈ Z 2

2. Dcode

0000,0001,0101,1111,1010,1100,1101,1001

Ans(2)

By the definition of E

E(000)=0000 E(100)=1000 E(110)=1101 E(001)=0011

E(101)=1011 E(011)=0111 E(010)=0100

2. Dcoding

D(0000)=000 D(0001)=000

D(0101)= 010 D(1010)=101

D(1111)=111 D(1100)=110

D(1101)=110 D(1001)=100

(3m,m) Triple Repetition code

m 3m Q3. An Encoding function E: Z 2 → Z 2 is defined as

8 each w1 w2 w3w4 w5 w6 w7 w8 ∈ Z 2

,E(w) = E(w1 w2 w3…w m) = w1 w2 w3…w mw1 w2 w3…w mw1 w2 w3…w m and Decoding function

3m m D: Z 2 → Z 2

D(w) = D(r1 r2 r3…r mrm+1 r2 r3…r 2m r2m+1 r2 r3…r m3m ) = s1 s2 s3…s m

Where s i = 1 if majority of r i+m ri +2m ri+3m

=0 if majority of r i+m ri +2m ri+3m (a) Encode ( Or find Code words) of

3 6 E: Z 2 → Z 2 000,011,010,100,001,101,110,111

6 2 (b) Decode E: Z 2 → Z 2 111111,101010, 010101,100100,0100011,110110,010111,000111

Ans 3 a) Encoding( Or find Code words)

E(000) = 000 000 000; E( 011 ) =011 011 011

E(010) = 010 010 010; E(100)= 100 100 100

E (001) = 001 001 001; E(110) = 110 110 110

E(101) = 101 101 101; E( 111) = 111 111 111 b) Decoding

D( 111111)=11; D (101010) = 10; D(010101)=01; D (100100) = 00;

D(010011)=01; D (110110) = 11;D(010111)= 01; D (000111) = 01;

3 9 Q4. An Encoding function is E: Z 2 → Z 2 Use triple repetition(9,3) code to Decode

(a)111101100,000100011,010011111, 001 110011

(b)find THREE different received words r for which D( r ) = 000

9 3 Ans4.D : Z 2 → Z 2

triple repetition(9,3) code to Decode are

si = 1 if majority of r i+m ri +2m ri+3m

=0 if majority of r i+m ri +2m ri+3m a) D(111101100)=1010 D(000100011) =000

D(010011111)= 011 D(001 110011) = 011

(b) D(000) = 000000000 D(000) = 010000100 D(000) = 100010001