70.1k views
4 votes
Given is the initial codebook.

Symbol
Code
(space)
_
110
B
1110
H
11110
I
10
L
0
The length of both the search and the lookahead buffer is 8 (3 bits for coding the distance and the match length ). The coding window is positioned as follows: ILL_B is in the search buffer, and ILLI is in the lookahead buffer:
... I L L _B I L L I . . . .
Provide the binary code for this coding step. Fill in the blank.

1 Answer

3 votes

Answer:

The symbol to be coded is B. The search buffer contains ILL_B and the lookahead buffer contains ILLI. We need to find the longest match in the search buffer for the string ILLI.

The longest match for ILLI is LL_I, which has a match length of 2 and a distance of 6. We can encode the match as follows:

Distance code: 011 (6 in binary)

Match length code: 10 (2-2 in binary)

Therefore, the encoded bits for the match are: 01110

Now, we need to encode the symbol B using the given code. The code for B is 1110.

Therefore, the final binary code for this step is:

01110 1110

User Zen Hacker
by
7.8k points

Related questions