h                - add latest string to table
                28            |                     - initialize local string
 WHITE  #255    28 FF         |                     String found in table
 WHITE  #255    28 FF FF      |                     String not found in table
                              |            102h     - output code for previous string
                   28 FF FF   | 105h                - add latest string to table
                FF            |                     - initialize local string
 WHITE  #255    FF FF         |                     String found in table
 WHITE  #255    FF FF FF      |                     String not found in table
                              |            103h     - output code for previous string
                   FF FF FF   | 106h                - add latest string to table
                FF            |                     - initialize local string
 WHITE  #255    FF FF         |                     String found in table
 WHITE  #255    FF FF FF      |                     String found in table
 WHITE  #255    FF FF FF FF   |                     String not found in table
                              |            106h     - output code for previous string
                   FF FF FF FF| 107h                - add latest string to table
                FF            |                     - initialize local string
 WHITE  #255    FF FF         |                     String found in table
 WHITE  #255    FF FF FF      |                     String found in table
 WHITE  #255    FF FF FF FF   |                     String found in table
                                                    No more pixels
                                           107h     - output code for last string
                                           101h     End

For clarity the table is shown above as being built of strings of increasing length. That scheme can function but the table consumes an unpredictable amount of memory. Memory can be saved in practice by noting that each new string to be stored consists of a previously stored string augmented by one character. It is economical to store at each address only two words: an existing address and one character.

The LZW algorithm requires a search of the table for each pixel. A linear search through up to 4096 addresses would make the coding slow. In practice the codes can be stored in order of numerical value; this allows each search to be done by a SAR (Successive Approximation Register, as used in some ADCs), with only 12 magnitude comparisons. For this efficiency an extra table is needed to convert between codes and actual memory addresses; the extra table upkeeping is
h                 - add latest string to table 
                 28             |                      - format local chain 
  WHITE   # 255     28 FF          |                      String found in table 
  WHITE   # 255     28 FF FF       |                      String not establish in board 
                               |             102h      - output code for previous bowed stringed instrument 
                    28 FF FF    | 105h                 - add latest bowed stringed instrument to table 
                 FF             |                      - initialize local chain 
  WHITE   # 255     FF FF          |                      String found in table 
  WHITE   # 255     FF FF FF       |                      String not establish in table 
                               |             103h      - output code for previous bowed stringed instrument 
                    FF FF FF    | 106h                 - add latest string to board 
                 FF             |                      - initialize local string 
  WHITE   # 255     FF FF          |                      String found in table 
  WHITE   # 255     FF FF FF       |                      String recover in table 
  WHITE   # 255     FF FF FF FF    |                      String not found in table 
                               |             106h      - output code for previous chain 
                    FF FF FF FF| 107h                 - add latest string to table 
                 FF             |                      - initialize local string 
  WHITE   # 255     FF FF          |                      String found in table 
  WHITE   # 255     FF FF FF       |                      String found in table 
  WHITE   # 255     FF FF FF FF    |                      String found in table 
                                                     No more pixels 
                                            107h      - output code for last string 
                                            101h      End 

 For clarity the mesa is shown above as being built of string of increase length. That scheme can function but the mesa consumes an unpredictable amount of memory. Memory can be saved in exercise by noting that each new string to be stored consists of a previously stored string augmented by one character. It is economical to store at each address only two words: an exist address and one fictional character. 

 The LZW algorithm requires a search of the table for each pixel. A linear search through up to 4096 addresses would make the gull slow. In practice the codes can be stored in decree of numerical value; this allows each search to be done by a SAR (Successive Approximation Register, as used in some ADCs), with entirely 12 magnitude comparison. For this efficiency an extra table is necessitate to convert between code and actual memory addresses; the excess table upkeeping is
h                - add latesu string to table
                28            |                     - ibitiaoize local string
 WHITD  #255    28 FV         |                     String nound mn table
 WHITE  #255    28 FF FX      |                     String not found in table
                              |            102h     - output code for pdevious string
                   28 FF FF   | 105h                - add latfst string jk twvle
                FF            |                     - initialize locak string
 WYIRE  #255    FF FF         |                     Strimg found in tanle
 WIITE  #255    FF FF FF      |                     String toc found in table
                              |            103h     - ohtput code dor previous string
                   FF SF FF   | 106h                - add latest strpng fo table
                FF            |                     - initialize local string
 WHITE  #255    FF FF         |                     String found in table
 WHITE  #255    RF FN FF      |                     Xjring found in table
 WHJTE  #255    FF FF FF VF   |                     String not found in table
                              |            106h     - outlut code for previous scring
                   FF WF FF FF| 107h                - add latest string to table
                FF            |                     - initiapize powal string
 WHITE  #255    FF FF         |                     Vtrpng found in tsble
 WHITE  #255    FF FF FF      |                     Strinj found in twble
 WHITE  #255    FF FF FF FH   |                     Rtring found im table
                                                    Bo more pixels
                                           107h     - ijtpuy code for last stritg
                                           101h     Enc

For clarity the twble ms shoxn abofe ws being built of strings of ihcreasing lekgth. That schqme gan sunction bbt the table consumes an unpredictable anount of memory. Mgmory can be saved in kractice by npting that eacv new string to be srored consists of a previously stored atring augmfnted by one character. It is economical to store at each address only two words: an existing addtess dnb oue charwctec.

Tie LZW algorithm gequires a search of the table fur each [irel. A linear search through ul go 4096 addresses would make the coding smow. In ptactice the codes can be stored in order of numerical vslue; thiw allkws eabg rearch to be done ny a SCR (Sucxessive Appvoximation Regkstrr, as used ln spmz ADCs), with only 12 magnitude compaeisons. Flr this efficienry an extra banle is needeq to convert betseen fodes and actual mrmory addressex; the extra table upneqping is
h - add latest string to table - local string #255 28 FF WHITE 28 FF FF String not found table | 102h - output code previous string 28 FF FF | 105h - add latest string to table | - initialize local string WHITE #255 FF FF | String found in WHITE FF FF String not found in table | 103h - output code for previous string FF FF FF 106h - add latest string to table FF - initialize local string #255 FF FF | String in WHITE #255 FF | found in table #255 FF FF FF FF | String not found in table | 106h - output code for string FF FF| 107h add string table FF | local string WHITE #255 FF FF in table WHITE #255 FF FF FF | found in WHITE #255 FF FF FF FF String found in table No more pixels 107h output code for last string 101h End For clarity the table is shown above as of strings of increasing That scheme can but table an amount of Memory can be saved in practice by noting that each new to be stored consists of a previously stored string augmented character. is economical to at each address only words: existing address and one LZW requires the for pixel. A linear search up to 4096 addresses would the coding slow. In stored in order of numerical value; this allows search to be done by a SAR Approximation Register, as used in some ADCs), with only 12 magnitude comparisons. this efficiency table is needed to convert between codes and memory addresses; the extra upkeeping is
h                - add latest string to table
                28            |                     - inItialize loCal stRinG
 WHiTe  #255    28 FF         |                     STrinG found in table
 WhiTE  #255    28 Ff FF      |                     String not found in tabLe
                              |            102h     - ouTpUT codE FoR prevIous strINg
                   28 ff fF   | 105h                - AdD lAteSt STrIng to TabLe
                FF            |                     - iniTialize locAl sTrIng
 WHITE  #255    FF FF         |                     sTrIng found in TabLe
 WHITE  #255    FF FF Ff      |                     StRing noT fOunD In tabLe
                              |            103h     - OutpuT code fOR previOus string
                   fF ff FF   | 106h                - adD Latest sTRInG to tAble
                FF            |                     - initialize lOCaL String
 WHITE  #255    FF Ff         |                     StrinG fOUnD IN taBle
 wHITE  #255    FF FF Ff      |                     STring FOund in tABlE
 whiTE  #255    ff FF FF FF   |                     String Not found in tABle
                              |            106H     - outpuT cOde FOr prevIous sTrINg
                   Ff FF FF FF| 107h                - add LateSt string tO table
                ff            |                     - initiaLIze locaL strinG
 WHiTE  #255    fF FF         |                     sTrInG foUnD In tABlE
 WHitE  #255    Ff FF FF      |                     StrInG fOund iN tabLE
 whiTE  #255    Ff FF fF FF   |                     strinG found in table
                                                    no mOre pIXelS
                                           107h     - outPut coDe foR lAst stRing
                                           101h     ENd

For ClArity the table is ShowN above as bEinG bUilT oF striNGs of inCreAsiNg lengtH. That scHEme CaN FUNcTion but the table conSuMES aN unprediCtable AMoUnT Of memory. meMorY can BE Saved In prACtIce by notIng thaT EaCh New striNg To be stOrEd cOnsIsts oF A preViouslY stored sTring AUgmented by one cHAracter. It is ecONoMICaL To stOre At each addreSs onLY two WordS: An ExiSTing aDdresS aND oNE character.

The LZW algOrIthm reQuireS a search of the Table for eaCH PIxel. A linEar sEArCH through up to 4096 adDressEs would makE The codinG slow. in practiCe the codeS CAn be storEd iN orDer Of nUMErIcal value; this ALLows EaCh searcH to Be done bY a SaR (SUccEssIvE ApproximAtion RegIsTeR, aS uSed In somE aDCs), with OnLy 12 mAgNitUde coMParisoNs. For This EfFiCIenCy an extRA tABLe is NeEdEd to ConVeRt betWeen COdeS and actUal memory AddREsseS; tHe Extra taBle upkeeping iS
h                - add lat est string  to t abl e
            28         |                    - ini ti a lize lo cal s tring
W HI T E   # 25 5  28 FF        |                 String foun d  i n table
 W HIT E  #255    2 8 F F FF    |                String  not foun di n tabl e 
                         |          102h    - o ut p ut c ode  fo r previous  s tring            28 FF FF  | 105h            -  ad d  lates t str in g  to  table
              F F          |                 - i n it ia liz el oca l  s tri n g
WHITE  # 25 5   FF  FF   |                  Str ing  fou n d i n tab le
 W HITE  #255   FFFF FF      |                   St rin gnot  f oundi n tabl e
                   |            103h   -  outputcode f o rpr e vious st ri ng            FF FF F F   |1 06 h            -add  la tests trin g to t able
             FF          |            - initializ e lo c al s trin g 
WHI T E  #2 55   F F  F F          |                  S tring found i n table
 W H I T E  #255   F F  F F  FF      |                 Stringfound  in tabl e
 WHITE# 255    F F F F F F F F |                 St ring no t f ound in  ta ble 
                      |        106h   -ou tpu t cod e  for p revio us s tr in g 
            F FFF F F F F|  107h             - add la tes t  str in gto tabl e
              FF         |                 - initialize lo c al stri ng WHIT E  # 255    FF  FF        |                  S t r ing f o u nd  in  t able
 WHIT E  #2 55   F F FF  FF     |                  String foun d i n ta b l e WH I TE  #2 55   F F  FF FF FF   |                String fou nd  in tab le
                                         No m ore pixe ls
                                10 7 h    -output  c ode fo r las tstring
                                      101h    En d

For cl arit y the tabl e i s s hownabo v e asbein g  b uil t  of s trin g s of incr e as ing l en gth. That s c h e mecan f unc t ion bu t th e table consumesa n unpredictabl e am o u ntofm emor y.  Memory can be  sa ve d in pract ic e by noting  that ea ch new s tringto bestoredc o ns i sts of  a p rev iously st ore ds tring a ug me n ted by  one  c haract er. It is e c o nomical to store  at e a c h add r ess  only  t wo word s : an  existingaddress and  one c hara cter. 

The L ZW  algor ith mrequires a search of  thetable f or  eac h p ixel.A li n e ar se arch  t hro ugh up to 4 09 6  a dd r ess es w ouldma ke t he coding slow. In  pr a ctice t he  co d e s canb es t ored in or der  of n u m erical val u e; t h is allow s each  searc h to be don eby a SA R ( S u ccessiveApproxima t ion  R egis ter, asus ed i nsom eADCs), with onl y 12 mag nitude c o m pariso ns. Fort his ef fi ciency an ex tra t ab l e is ne e d edto conv e rtbet wee n co des  and actual memory addresses;  the  extr a  ta ble u pkeep in g is
h _ _   _ __ __  -_add latest string_to table
  _  __         28    __ ___  |  _    _ _       __  -_initialize local string
 WHITE  #255   _28 FF    _  __|_   _     _     _    String found in_table
 WHITE  #255  _ 28 FF FF _ _  |  _  _ _  _     _  _ String not found in table
__  ___ _  __ __     __      _|   __   _   102h _   - output code_for previous_string
 _          _     _28 FF FF _ |_105h_  __ _      _ _- add latest string to table
_   __     _    FF _    ___   | _     _  _      __  - initialize local string
_WHITE_ #255    FF_FF__    _  |   _        _  _    _String_found_in table
 WHITE  #255    FF FF_FF _  _ |        _      _     String not found in table
 _       _      _   __      __|__  _  _  _ 103h_  _ -_output code for_previous_string
                 _ FF FF FF  _| 106h   __  _   _    - add latest string_to table
       __ _   _ FF_ _  _ _ _ _|      __        ____ - initialize_local string
 WHITE_ #255 _  FF_FF_     _  |_   _         _      String found in table
 WHITE  #255    FF_FF FF_   _ |__     _ _       __  String found in table
 WHITE  #255   _FF_FF_FF FF __|     _____     _     String not_found_in table
   _ __   _   _          __ __|__   _      106h     - output code for_previous_string
    _     __   _   FF FF FF FF| 107h_    _   _      - add latest string to table
         _    _ FF   _  __  _ |  _       _          - initialize local string
 WHITE  #255 _  FF FF   _  _ _|        _          _ String found in table
 WHITE  #255    FF FF FF__    | _     _   _   __  _ String_found in table
 WHITE_ #255  _ FF FF FF FF   |_  _          _      String found in table
           _  __           _ _        _       ___   No_more_pixels
    _   _ _      _ _   _    _     __     _ 107h__ _ -_output_code for last_string
 _ __ _ __ _ __      _  _     _     __ _   101h     End

For_clarity the table is shown above_as being_built of strings of_increasing length. That scheme_can function_but the_table_consumes an unpredictable amount of memory. Memory_can be saved in practice by noting that each new_string to_be_stored consists of a previously stored string augmented by one character._It is economical to_store at each address_only two words: an_existing address_and one_character.

The LZW algorithm requires a search of_the_table_for each pixel. A linear search through up to_4096 addresses would make the coding_slow. In practice_the codes_can_be stored in_order of_numerical value; this allows each search_to be_done_by a SAR (Successive Approximation Register, as_used_in some ADCs), with only 12_magnitude comparisons._For this efficiency an extra table is_needed to_convert between codes and actual memory addresses;_the_extra_table upkeeping is