Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.

Similar presentations


Presentation on theme: "Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi."— Presentation transcript:

1 Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章 (Chapter 58) 伏 者潛藏也 道紀章 (Chapter 14) 道無形象, 視之不可見者曰 夷

2 Fuw-Yi Yang2 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code One of the most common error-correcting codes used in RAMs was devised by R. W. Hamming. In the Hamming code, k parity bits are added to an n-bit data word, forming a new word of n + k bits. Richard Wesley Hamming (Chicago, February 11, 1915 – Monterey,ChicagoMonterey California, January 7, 1998) was an American mathematician whose work had many implications for computer science and telecommunications. His contributions include the Hamming code (which makes use of a Hamming matrix), the Hamming window (described in Section 5.8 of his book Digital Filters), Hamming numbers, Sphere-packing (or hamming bound) and the Hamming distance.Americanmathematician computer sciencetelecommunicationsHamming codeHamming matrix Hamming windowHamming numbersSphere-packinghamming boundHamming distance

3 Fuw-Yi Yang3 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 Notation : P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 Data : 1 1 0 0 0 1 0 0 Transmitted data P 1 = Xor of bits (3, 5, 7, 9, 11) P 2 = Xor of bits (3, 6, 7, 10, 11) P 4 = Xor of bits (5, 6, 7, 12) P 8 = Xor of bits (9, 10, 11, 12)

4 Fuw-Yi Yang4 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 Notation : P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 Data : 1 1 0 0 0 1 0 0 Received data C 1 = Xor of bits (1, 3, 5, 7, 9, 11) C 2 = Xor of bits (2, 3, 6, 7, 10, 11) C 4 = Xor of bits (4, 5, 6, 7, 12) C 8 = Xor of bits (8, 9, 10, 11, 12)

5 Fuw-Yi Yang5 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 Notation : P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 P Data : 1 1 0 0 0 1 0 0 Transmitted data P 1 = Xor of bits (3, 5, 7, 9, 11) P 2 = Xor of bits (3, 6, 7, 10, 11) P 4 = Xor of bits (5, 6, 7, 12) P 8 = Xor of bits (9, 10, 11, 12) P = Even or Odd parity on bit 1~12

6 Fuw-Yi Yang6 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 Notation : P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 P Data : 1 1 0 0 0 1 0 0 Received data C 1 = Xor of bits (1, 3, 5, 7, 9, 11) C 2 = Xor of bits (2, 3, 6, 7, 10, 11) C 4 = Xor of bits (4, 5, 6, 7, 12) C 8 = Xor of bits (8, 9, 10, 11, 12) P = Even or Odd parity on bit 1~12 C = 0, P = 0 no error occurred C != 0, P = 1 single error occurred, can be corrected C != 0, P = 0 double error occurred, cannot be corrected C = 0, P = 1 error occurred in the 13th bit

7 Fuw-Yi Yang7 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code 7-10 Given the 8-bit data word 0101 1011, generate the 13-bit composite word for the Hamming code that corrects single errors and detect double errors. Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 Notation : P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 P E Data : 0 1 0 1 1 0 1 1 Parity : 0 0 1 1 1 Parity data P 1 = Xor of bits (3, 5, 7, 9, 11) 0 P 2 = Xor of bits (3, 6, 7, 10, 11) 0 P 4 = Xor of bits (5, 6, 7, 12) 1 P 8 = Xor of bits (9, 10, 11, 12) 1 P E = Even or Odd parity on bit 1~12 1

8 Fuw-Yi Yang8 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code 7-11 Obtain the 15-bit Hamming code word for the 11-bit data word 1100 1001 010. Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Notation: P 1 P 2 B 3 P 4 B 5 B 6 B 7 P 8 B 9 B 10 B 11 B 12 B 13 B 14 B 15 Data : 1 1 0 0 1 0 0 1 0 1 0 Parity : Parity data P 1 = Xor of bits (3, 5, 7, 9, 11, 13, 15) 1 P 2 = Xor of bits (3, 6, 7, 10, 11, 14, 15) 0 P 4 = Xor of bits (5, 6, 7, 12, 13, 14, 15) 1 P 8 = Xor of bits (9, 10, 11, 12, 13, 14, 15) 1

9 Fuw-Yi Yang9 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code 7-12 A 12-bit Hamming code word containing 8 bits of data and 4 parity bits is read from memory. What was the original 8-bit data word that was written into memory if the 12-bit word read out is as follows: (a) 0000 1110 1010 (b) 1011 1000 0110 (c) 1011 1111 0100

10 Fuw-Yi Yang10 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code 7-13 How many parity check bits must be included with the data word to achieve single-error correction and double-error detection when the data word contains (a) 16 bits (b) 32 bits (c) 48 bits

11 Fuw-Yi Yang11 Text Book: Digital Design 4th Ed. Chapter 7 Hamming Code 7-14 It is necessary to formulate the Hamming code for four data bits D 3, D 5, D 6, and D 7, together with three parity bits, P 1, P 2, and P 4. (a) Evaluate the 7-bit composite code word for the data word 0010. (b) Evaluate the three check bits, C 1, C 2, and C 4, assuming no error. (c) Assume an error in bit D 5 during writing into memory. Show how the error in the bit is detected and corrected. (d) Add parity bit P8 to include double-error detection in the code. Assume that errors occurred in bits P 2 and D 5. Show how the double error is detected.


Download ppt "Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi."

Similar presentations


Ads by Google