Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hamming (4,7) Code Binary Linear Codes Hamming Distance Weight of BLC

Similar presentations


Presentation on theme: "Hamming (4,7) Code Binary Linear Codes Hamming Distance Weight of BLC"— Presentation transcript:

1 Hamming (4,7) Code Binary Linear Codes Hamming Distance Weight of BLC
Parity-Check Sums Hamming (4,7) Code Binary Linear Codes Hamming Distance Weight of BLC Mathematics in Management Science Spring 2015

2 Parity A bit string has odd parity if the number of 1s in the string is odd. A bit string has even parity if the number of 1s in the string is even , 000, – even parity , 1, – odd parity.

3 Partity & Modular Arithmetic
For two numbers n and p (p ≠ 0), n mod p is the remainder when we divide n by p . So, n mod 2 = 0 if n is even and n mod 2 = 1 if n is odd.

4 Partity & Modular Arithmetic
Let n be the sum of the binary digits in some word (bit string) w. Then w has even parity if n mod 2 = 0 and w has odd parity if n mod 2 = 1 .

5 Error Correcting Code A method of encoding data with sufficient redundancy to allow the recovery of data in the face of (a limited number of) errors. Messages encoded by appending extra digits, determined by parity (even or odd sums) of certain portions of the messages.

6 Example To encode 4 bits, we use 7 bits with parity-check sums. Want to send a1a2a3a4. Will append parity check-sum digits c1c2c3 . These determined as follows. Write digits a1a2a3a4 inside circles as pictured.

7 a1 c1 a4 a2 a3 c3 c2

8 Example Sending a1a2a3a4. Write a1a2a3a4 inside circles as pictured. The parity check-sum digits c1c2c3 are chosen so that inside each circle the sum has even parity; so, want an even number of ones inside each circle 

9 To send 1010 Append ??? 1 ? ? 1 ?

10 To send 1010 Append 001 Transmit 1 1 1

11 To send 1011 Append 001 Transmit 1 1 1 1

12 Error Correction Suppose code received is Transmission error? How to correct?

13 The black circle is ok—it has even parity sum.
But, the two blue circles have incorrect parity. We assume at worst one bit error. 1 The error lies inside both the blue circles. But outside the black circle. So, the digit a4 is incorrect—it should be a 1.

14 Error Correction Code word received was Should have been

15 Reliable Data Transmission
How to decode?

16 Hamming (7,4) Code Above code one of many invented by Richard Hamming at Bell labs. Each code word consists of 4 data bits (the message) plus 3 parity bits. Recovering message from code word is easy—just drop the parity bits. 

17 Hamming (7,4) Code East to write formulas for parity bits. Given message a1a2a3a4 calculate parity check-sum digits c1c2c3 via: c1= (a1+a2+a3 ) mod 2 c2= (a1 +a3+a4 ) mod 2 c3= ( a2+a3+a4 ) mod 2 These give same as using circles! RHS equations are parity check-sums.

18 Binary Linear Code Strings (words) of 0’s and 1’s with extra digits for error correction used to send full-text messages. Words composed of all possible messages of a given length plus parity-check sum digits appended to messages; resulting strings are the code words. A binary linear code is set of binary strings where each string has two parts—the message part and the check-digits part.

19 Hamming (7,4) binary code , , , , , , , , , , , , , , ,

20 Detecting & Correcting Errors
Valid code words must satisfy parity check-sums; if not, have an error. But, if bunch of errors, a code word could get transformed to some other code word.  How many 1-bit errors does it take to change a legal code word into a different legal code word?

21 Hamming Distance The Hamming distance between two binary strings is the number of bits in which the two strings differ. dist btwn 10 and 01 is 2 dist btwn and is 1 dist btwn and is 3 dist btwn pixd words is 3

22 Hamming Distance Here are the Hamming distances between the string v= and all the Hamming (7,4) code words.

23 Weight of a Binary Code The distance between two code words is exactly the number of 1-bit changes needed to change the one code word into the other code word. The weight of a binary code is the minimum distance btwn any 2 code words; this is the minimum number of 1’s in any non-zero word.

24 Example What is the weight of the Hamming (7,4) code? What is the
min number of ones? Wt is t=3.

25 Weight of a Binary Code Suppose the weight of some binary code is t; so, it takes t 1-bit changes to convert any code word into another. Therefore, we can detect up to t-1 single bit errors. The Hamming (7,4) code has weight t=3. Thus using it we can detect 1 or 2 single bit errors.

26 We assume at worst one bit error.
Code word received is Two blue circles have incorrect parity. We assume at worst one bit error. 1 The error lies inside both blue circles and outside black circle. a1 should be 0, or c1 ,c2 should be 0,0, or a2 ,a4 should be 0,0.

27 Weight of a Binary Code Suppose the weight of some binary code is t. Then, can detect up to t-1 single bit errors, or, we can correct up to (t-1)/2 errors (if t is odd), (t-2)/2 errors (if t is odd). Cannot do both.

28 Hamming (3,1) Code Simplest Hamming code encodes 1 bit by using 3 bits: a is coded as abc where the 2 parity bits bc are chosen so that the 2 overlapping circles each have an even number of 1’s. What are possible code words? a b c

29 a b c

30 a1 c1 a4 a2 a3 c3 c2


Download ppt "Hamming (4,7) Code Binary Linear Codes Hamming Distance Weight of BLC"

Similar presentations


Ads by Google