Question: Write a verilog code to generate a prefix code given a sequence of codeword lengths. The code is to be generated according to the canonical
Write a verilog code to generate a prefix code given a sequence of codeword lengths. The code is to be generated according to the canonical tree construction algorithm. The produced codewords are to be written into registers to allow the look-up for a codeword assignment per received symbol. Since the Alphabet is known, the symbols can be indexed (1,2,3...) according to the lexicographical order of symbols in the Alphabet. Make an assumption for the maximum height of the tree (maximum length among in the codewords). A sample sequence of lengths for the testing: (4, 5, 2, 3, 6, 3) for the alphabet (a, b, c, d, e, Test with a testbench simulation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
