Information Theory and Coding Variable Length Code
Information Theory and Coding Variable Length Code
فؤاد حمادي.م
9191 - 9102
2- Variable length code
The codes we have looked above have all fixed lengths and they are
called block code from the fact that the message, are of fixed block
lengths in the stream of symbols being sent.
2. Divide the list of symbols into two parts : upper and lower, so that the
summation of the probabilities of the upper part is equal as possible to the
summation of the lower part symbols.
3. Assign "0" code to each of the upper part symbols, and "1" code to
each of the lower part symbols.
4. Divide each of the upper and lower part into upper and lower
subdivision as in step (2) above, and assign the code "0" and "1" as in
step (3) above.
Ex1: A source produce 5 independent symbols ( x1, x2, x3, x4, x5 ) with its
corresponding probabilities 0.1, 0.3, 0.15, 0.25, 0.2 . design a binary code
for the above source symbol using Shannon – fanon method.