This action might not be possible to undo. Are you sure you want to continue?

# Improved Hamming Code for Error Detection and Correction

作者：U. K. Kumar, Member, IEEE, and B. S. Umashankar 出處：2007 2nd International Symposium on Wireless Pervasive Computing

**授課教授：馮玄明 陳鍾誠 報 告 人：黃志昂
**

1

Outline

Introduction Proposed Improved Hamming Code Conclusion

Improved Hamming Code for Error Detection and Correction

2

Hamming code

well known for its single-bit error detection & correction capability. based on the of adding ‘r’ redundancy bits to ‘n’ data bits such that 2r ≧ n + r + 1. 2r -1 bits：Hamming Code r： redundancy bits (2r -1) -r：data bits redundancy bits ：be interspersed at bit positions 2n (n = 0, 1, 2, 3) with the original data bits. Data bits：All other bit positions are for the data to be encoded. (positions 3, 5, 6, 7, 9..etc.)

Introduction

3

Hamming code

Rule & How to Remember Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11,13,15,...) Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,10,11,14,15,...) Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...) Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc. (8,9,10,11,12,13,14,15,24,25,26,27,...) total number of ones in the positions is odd -> set check bit 1. total number of ones in the positions is even -> set check bit 0.

Introduction

4

Hamming code

An example for 7-bit Hamming code is given below( for comparison with the proposed improvement.) the 7-bit data to be transmitted is 0110010. the 11-bit data actually transmitted is 011P001P0PP the P’s refer to the Hamming bits that are to be calculated and interspersed at bit positions 1, 2, 4, & 8.

Introduction

5

Hamming code

An example for 7-bit Hamming code 0110010. the 11-bit data actually transmitted is 011P001P0PP bit position 1 ：is even parity at bit positions 1, 3, 5, 7, 9, & 11. Thus the Hamming bit at position 1 will be 0. bit position 2 ：is even parity at bit positions 2, 3, 6, 7, 10, & 11. Thus the Hamming bit at position 2 will be 1. bit position 4 ：is even parity at bit positions 4, 5, 6, & 7. Thus the Hamming bit at position 4 will be 1. bit position 8 ：is even parity at bit positions 8, 9, 10, & 11. Thus the Hamming bit at position 8 will be 0.

Introduction

6

Hamming code

Thus the 11-bit data actually transmitted is 01100011010. For the calculation of Hamming bits at positions 1, 2, 4, & 8, even-parity checks were performed on 6, 6, 4, & 4 bits respectively. Thus a total of 20 bits are involved in the process of Hamming bits calculations.

Introduction

7

Hamming code

The error-detection and correction process in Hamming code is as illustrated in Table I.

※11-bit data actually transmitted is 01100011010 TABLE I error-detection and correction using hamming code

**S0-bit position 1 : 1、3、5、7、9、11 S1-bit Position 2 : 2、3、6、7、10、11 S2-bit position 4 : 4、5、6、7 S3-bit position 8 : 8、9、10、11
**

Introduction

8

Hamming code

After error detection & correction, if any, the data bits have to be reassembled by removing the redundancy bits. Hamming code is normally used for transmission of 7-bit data item. Scaling it for larger data lengths results in a lot of overhead due to interspersing the redundancy bits and their removal later.

Introduction

9

**IMPROVED HAMMING CODE
**

The number of redundancy bits, ‘r’ to be appended to nbit data is obtained such that the relation (2r-1–1) ≥ n is satisfied. The number of redundancy bits in this method is same as that for Hamming code for some values of n. But in some cases, it will be just one more redundancy bit than needed in the Hamming code.

PROPOSED IMPROVED HAMMING CODE

10

**IMPROVED HAMMING CODE
**

consider the same example. The 7-bit data to be transmitted is 0110010. For 7-bit data, the number of redundancy bits required will be 4. the 11-bit data actually transmitted is PPPP0110010. the P’s refer to the redundancy bits that are to be calculated and appended at bit positions 8, 9, 10, & 11.

PROPOSED IMPROVED HAMMING CODE

11

**IMPROVED HAMMING CODE
**

the 11-bit data actually transmitted is PPPP0110010. bit position 8：is even parity at bit positions 1, 3, 5, 7 and bit position 8. Thus the bit at position 8 will be 1. bit position 9 ：is even parity at bit positions 2, 3, 6, 7 and bit position 9. Thus the bit at position 9 will be 0. bit position 10 ：is even parity at bit positions 4, 5, 6, 7 and bit position 10. Thus the bit at position 10 will be 0. bit position 11： is even parity considering only the redundancy bits（8,9,10,11）. Thus the bit at position 11 will be 1.

PROPOSED IMPROVED HAMMING CODE

12

IMPROVED HAMMING CODE

Thus the 11-bit data actually transmitted is 10010110010. For the calculation of bits at positions 8, 9, 10, & 11, even parity checks were performed on 5, 5, 5, & 4 bits respectively. Thus a total of 19 bits are involved in the process of calculation of redundancy bits.

PROPOSED IMPROVED HAMMING CODE

13

**IMPROVED HAMMING CODE
**

The error-detection and correction process in the improved method is as illustrated in Table II.

※the 11-bit data actually transmitted is 10010110010. TABLE II error-detection and correction using improved hamming code

S0-bit position 8 : 1、3、5、7、8 S1-bit Position 9 : 2、3、6、7、9 S2-bit position 10: 4、5、6、7、10 S3-bit position 11: 8、9、10、11

PROPOSED IMPROVED HAMMING CODE

14

**IMPROVED HAMMING CODE
**

Suppose the received information is 10010100010, with an error at bit position 5. the status of parity check S0 is shown as F：even parity error at bit positions 1, 3, 5, 7 & 8. the status of parity check S1 is shown as T： no even parity error at bit positions 2, 3, 6, 7 & 9. the status of parity check S2 is shown as F： even parity error at bit positions 4, 5, 6, 7& 10 the status of parity check S3 is shown as T ： even parity occurs at bit positions 8, 9, 10 & 11. Interpreting F as 1 and T as 0 in the status of parity check, we find that the error is at bit position 0101 i.e. 5. Bit 5,which was received as 0, is corrected as 1.

PROPOSED IMPROVED HAMMING CODE

15

**IMPROVED HAMMING CODE
**

Suppose the received information is 10000110010, with an error at redundancy bit position 8. Then the status of parity check will turn out to be FTTF. If status of parity check is FXXX, it implies that there is an error only in a redundancy bit. The actual redundancy bit in error can easily be identified by the position of the of F. However, this is not a data bit there is no need for any correction. Suppose the received information is 10010110010, with no error. Then the status of parity check will turn out to be TTTT, implying error at bit position 0000 i.e. 0. This is treated as no error.

PROPOSED IMPROVED HAMMING CODE

16

IMPROVED HAMMING CODE

After error detection & correction, if any, the redundancy bits can be removed easily and there is no need to reassemble the data bits. This improved method can be scaled easily for larger data lengths. The redundancy bits just get appended to the data.

PROPOSED IMPROVED HAMMING CODE

17

**IMPROVED HAMMING CODE
**

As an example, let us consider a 56-bit data stream, which can contain eight 7-bit ASCII characters or seven bytes. This needs 7 redundancy bits, which are selected as in the previous example. In spite of an extra redundancy bit when compared to the Hamming code, the number of bits involved in the process of calculation of redundancy bits is much less than in the Hamming code. It can be shown that it involves a total of 172 bits in the process of calculation of these 7 redundancy bits. In comparison, in the Hamming code it involves a total of 182 bits in the process of calculation of 6 redundancy bits.

PROPOSED IMPROVED HAMMING CODE

18

**Proposed Improvement vs. Hamming Code
**

In the proposed improvement ：the redundancy bits are appended at the end of data bits. This eliminates the overhead of interspersing the redundancy bits at the sender end and their removal at the receiver end after checking for single-bit error and consequent correction, if any. Further the effort needed in identifying the values of the redundancy bits is lower in the proposed novel method.

Conclusion

19

**Proposed Improvement vs. Hamming Code
**

Hamming code is normally used for transmission of 7-bit data item. Scaling it for larger data lengths results in a lot of overhead due to interspersing the redundancy bits and their removal later. In contrast, the proposed method is highly scalable without such overhead. there is only 7 bit overhead for a 56-bit data stream, which is much less compared to 4 bit overhead for a 7-bit data. Because of this feature this new method is suitable for transmission of large size data bit-streams as long as there is likelihood of at the most single-bit error during transmission.

Conclusion

20