Presentation is loading. Please wait.

Presentation is loading. Please wait.

Faculty of Computer Science © 2006 CMPUT 229 Special-Purpose Codes Binary, BCD, Hamming, Gray, EDC, ECC.

Similar presentations


Presentation on theme: "Faculty of Computer Science © 2006 CMPUT 229 Special-Purpose Codes Binary, BCD, Hamming, Gray, EDC, ECC."— Presentation transcript:

1 Faculty of Computer Science © 2006 CMPUT 229 Special-Purpose Codes Binary, BCD, Hamming, Gray, EDC, ECC

2 © 2006 Department of Computing Science CMPUT 229 Binary-Coded Decimal (BCD) Code How do we represent 379 10 in BCD code? 3 10 = 0011 BCD 7 10 = 0111 BCD 9 10 = 1001 BCD 379 10 = 0011 0111 1001 BCD Inefficient storage. Complex arithmetic (for hardware). Clements, pp. 154

3 © 2006 Department of Computing Science CMPUT 229 Binary Code 01010101 0101 Clements, pp. 154

4 © 2006 Department of Computing Science CMPUT 229 Binary Code 00 01 10 11 0101 Clements, pp. 154

5 © 2006 Department of Computing Science CMPUT 229 Binary Code 00 01 10 11 0101 00 01 10 11 00 01 10 11 Clements, pp. 154

6 © 2006 Department of Computing Science CMPUT 229 Binary Code 00 01 10 11 0101 000 001 010 011 100 101 110 111 Clements, pp. 154

7 © 2006 Department of Computing Science CMPUT 229 Binary Code 00 01 10 11 0101 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 Clements, pp. 154

8 © 2006 Department of Computing Science CMPUT 229 Binary Code 00 01 10 11 0101 000 001 010 011 100 101 110 111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Clements, pp. 154

9 © 2006 Department of Computing Science CMPUT 229 Binary Code 0 00011011000110111 0101 000 001 010 011 100 101 110 111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Clements, pp. 154

10 © 2006 Department of Computing Science CMPUT 229 Gray Code 0101 Clements, pp. 154

11 © 2006 Department of Computing Science CMPUT 229 Gray Code 01100110 0101 Clements, pp. 154

12 © 2006 Department of Computing Science CMPUT 229 Gray Code 00 01 11 10 0101 Clements, pp. 154

13 © 2006 Department of Computing Science CMPUT 229 Gray Code 00 01 11 10 0101 00 01 11 10 11 01 00 Clements, pp. 154

14 © 2006 Department of Computing Science CMPUT 229 Gray Code 00 01 11 10 0101 000 001 011 010 110 111 101 100 Clements, pp. 154

15 © 2006 Department of Computing Science CMPUT 229 Gray Code 00 01 11 10 0101 000 001 011 010 110 111 101 100 000 001 011 010 110 111 101 100 101 111 110 010 011 001 000 Clements, pp. 154

16 © 2006 Department of Computing Science CMPUT 229 Gray Code 00 01 11 10 0101 000 001 011 010 110 111 101 100 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 Clements, pp. 154

17 © 2006 Department of Computing Science CMPUT 229 Gray Code 0 00011110000111101 0101 000 001 011 010 110 111 101 100 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 Hamming distance between two consecutive words is 1. Clements, pp. 154

18 © 2006 Department of Computing Science CMPUT 229 Binary X Gray Code Clements, pp. 155 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

19 © 2006 Department of Computing Science CMPUT 229 Error Detecting Codes  Can detect that a word has been corrupted –An error always leave a noticeable trace in the encoded word Parity codes Source Word Encoder Source Code Word Received Code Word Decoder Received Word Clements, pp. 157

20 © 2006 Department of Computing Science CMPUT 229 Parity Error Detecting Codes Clements, pp. 158 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

21 © 2006 Department of Computing Science CMPUT 229 Principle of Error-Detecting Code Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

22 © 2006 Department of Computing Science CMPUT 229 3-Bit Error Correcting Code Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

23 © 2006 Department of Computing Science CMPUT 229 Minimum Hamming Distance in ECC Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

24 © 2006 Department of Computing Science CMPUT 229 Block Parity Error-Correcting Code Clements, pp. 160 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED

25 © 2006 Department of Computing Science CMPUT 229 Hamming Codes I4I4 I3I3 I2I2 C3C3 I1I1 C2C2 C1C1 1352476 C j : Check bit j I j : Source bit j 000Unused 001C 1 010C 2 011I 1 100C 3 101I 2 110I 3 111I 4 0 Clements, pp. 160

26 © 2006 Department of Computing Science CMPUT 229 Hamming Codes I4I4 I3I3 I2I2 C3C3 I1I1 C2C2 C1C1 1352476 C j : Check bit j I j : Source bit j 000Unused 001C 1 010C 2 011I 1 100C 3 101I 2 110I 3 111I 4 0 C 1 = I 1  I 2  I 4 C 2 = I 1  I 3  I 4 C 3 = I 2  I 3  I 4 Clements, pp. 160

27 © 2006 Department of Computing Science CMPUT 229 Hadamard Matrices +1 +1 -1 [H] 2 = Clements, pp. 160 +[H] n +[H] n -[H] n [H]2 n = +1 +1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1 [H] 4 = In a Hadamard matrix of order n each row has a Hamming distance of n/2 to every other row.

28 © 2006 Department of Computing Science CMPUT 229 Hadamard Matrices Clements, pp. 160 +1 +1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1 [H] 8 = +1 +1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1 +1 +1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1 -1 -1 -1 +1 -1 -1 +1 +1 -1 +1 +1 -1

29 © 2006 Department of Computing Science CMPUT 229 ECC with Hadamard Matrices Source Code RowCode Word 000011111111 001110101010 010211001100 011310011001 100411110000 101510100101 110611000011 111710010110 Clements, pp. 162

30 © 2006 Department of Computing Science CMPUT 229 Code Words in a 4-unit Code COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED Clements, pp. 162


Download ppt "Faculty of Computer Science © 2006 CMPUT 229 Special-Purpose Codes Binary, BCD, Hamming, Gray, EDC, ECC."

Similar presentations


Ads by Google