Ashok_Pacha
Newbie level 1
- Joined
- Jul 9, 2014
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 12
Hi sir, Im having problem in writting verilog code for LZ78 algorithm. Plz help me. here with im attaching algorithm of lz78 data compression.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Dictionary = empty ; Prefix = empty ; DictionaryIndex = 1; while(characterStream is not empty) { Char = next character in characterStream; if(Prefix + Char exists in the Dictionary) Prefix = Prefix + Char ; else { if(Prefix is empty) CodeWordForPrefix = 0 ; else CodeWordForPrefix = DictionaryIndex for Prefix ; Output: (CodeWordForPrefix, Char) ; insertInDictionary( ( DictionaryIndex , Prefix + Char) ); DictionaryIndex++ ; Prefix = empty ; } } if(Prefix is not empty) { CodeWordForPrefix = DictionaryIndex for Prefix; Output: (CodeWordForPrefix , ) ; }
Last edited by a moderator: