Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved] verilog code for LZ78 algorithm

Status
Not open for further replies.

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:

What languge is this written in? It looks more like pseudo code.

Besides that if you want to code this algorithm in Verilog first understand the hardware you want i.e. number of pipeline stages, and architecture of the design. If you have that anyone who can write synthesizable Verilog could code it.
 

That's indeed pseude code copy/pasted from one of many possible locations.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top