Documentos de Académico
Documentos de Profesional
Documentos de Cultura
cs313
huffman and hamming
encryption
2/24
0 1
1/24 1/24
example
z o
24/24
0 1
8/24
16/24
0 1
1
4/2 0
4/24
4 8/2 8/24
1 4
0 1 1
0 1 0
2/24 0
2/24 2/24 2/24 5/24 3/24
4/24 4/24
1 1 1 0
0 0 0 1 0 1 0 1 1
0
1/24 1/24 1/24 1/24 1/24 1/24 2/24 2/24 2/24 2/24 2/24 3/24
1/24 1/24
z o d c p n e a
k g t h s
encode the letters by moving down the tree.
t= 1000
h= 1001
i= 1101
s= 1100
e= 1010
z= 0000
o= 0001
d= 0010
a= 1011
c= 0011
p= 0100
k= 0101
n= 0110
g= 0111
space = 111
decryption:
to decrypt the message we just use the key to find the patterns inside the code
1000100111011100
to find the pattern we break it apart.
1000 1001 1101 1100
t h i s
hamming error handling
first we take our encoded phase
0 0 0 0 0 0 0
0 0 0 1 1 1 1
0 1 1 0 0 1 1
1 0 1 0 1 0 1
C1 C2 D1 C3 D2 D3 D4
next we need to add the data
1 0 0 0
once data is in we need to find the check bits.
looking at the table we see above C1 is a one and looking across from that one
we see that D1, D2, D4 also have ones,
this tells us that the value of C1 is equal to the xor of the other values.
0 0 0 0 0 0 0 C1= D1 xor D2 xor D4
0 0 0 1 1 1 1 C1 = 1 xor 0 xor 0
0 1 1 0 0 1 1 C1 = 1
1 0 1 0 1 0 1
C1 C2 D1 C3 D2 D3 D4 we continue for all check bits and perform this for all sections of four
the hamming for sections 1-6 is 1110000 0011001 1010101 1111100 1111111 0110011
1 1 1 0 0 0 0
decoding a hamming transmission is the reverse except that hamming provides error correction.
for example let assume we received 1010000 0001001