Faculty of Computer Science © 2006 CMPUT 229 Special-Purpose Codes Binary, BCD, Hamming, Gray, EDC, ECC
© 2006 Department of Computing Science CMPUT 229 Binary-Coded Decimal (BCD) Code How do we represent in BCD code? 3 10 = 0011 BCD 7 10 = 0111 BCD 9 10 = 1001 BCD = BCD Inefficient storage. Complex arithmetic (for hardware). Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code 0101 Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Gray Code Hamming distance between two consecutive words is 1. Clements, pp. 154
© 2006 Department of Computing Science CMPUT 229 Binary X Gray Code Clements, pp. 155 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 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
© 2006 Department of Computing Science CMPUT 229 Parity Error Detecting Codes Clements, pp. 158 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 2006 Department of Computing Science CMPUT 229 Principle of Error-Detecting Code Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 2006 Department of Computing Science CMPUT Bit Error Correcting Code Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 2006 Department of Computing Science CMPUT 229 Minimum Hamming Distance in ECC Clements, pp. 159 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 2006 Department of Computing Science CMPUT 229 Block Parity Error-Correcting Code Clements, pp. 160 COPYRIGHT 2006 OXFORD UNIVERSITY PRESS ALL RIGHTS RESERVED
© 2006 Department of Computing Science CMPUT 229 Hamming Codes I4I4 I3I3 I2I2 C3C3 I1I1 C2C2 C1C 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
© 2006 Department of Computing Science CMPUT 229 Hamming Codes I4I4 I3I3 I2I2 C3C3 I1I1 C2C2 C1C 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
© 2006 Department of Computing Science CMPUT 229 Hadamard Matrices [H] 2 = Clements, pp [H] n +[H] n -[H] n [H]2 n = [H] 4 = In a Hadamard matrix of order n each row has a Hamming distance of n/2 to every other row.
© 2006 Department of Computing Science CMPUT 229 Hadamard Matrices Clements, pp [H] 8 =
© 2006 Department of Computing Science CMPUT 229 ECC with Hadamard Matrices Source Code RowCode Word Clements, pp. 162
© 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