Abstract:
A linear feedback shift register (LFSR) of interest is modelled in software by replicating the LFSR in at least two identically configured model LFSRs. One model LFSR contains only the higher order initial bits of the LFSR of interest, with zeroes in the lower order bit positions, and the other model LFSR has only the lower order bits, with zeroes in the higher order bit positions. The model LFSRs are represented by respective tables of model LFSR output values that would be produced after a predetermined number of register shifts. The tables are accessed based on the initial value of the LFSR of interest, and the results of one table are combined with the results of the other table using an exclusive OR operator to thereby determine the output of the LFSR of interest. The table lookup method results in increased speed vis-a-vis the performance of single-bit-per-cycle LFSRs, while the use of two logical model LFSRs with corresponding tables permits duplicative entries to be ignored when indexing the tables, thus greatly reducing the space required to store the tables.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates generally to linear feedback shift registers (LFSRs), and more particularly to an efficient implementation of an LFSR using split-table lookup. 
     2. Description of the Related Art 
     A shift register is a device used in digital logic systems to store and shift multi-bit units of information in synchronization with the pulses of a clock signal. It is an m-cell device whose cells are linked serially, output-to-input. An m-bit digital word may be shifted left or right by one bit position with each clock pulse. Following each shift, an end bit (the &#34;output&#34; bit) of the word is lost, having been shifted out of the register&#39;s last cell, while a new bit (the &#34;input&#34; bit) has been added to the appropriate end of the word through the first cell of the register. Following each shift, the entire word in the register may be obtained by parallel access to the outputs of the cells. 
     Linear feedback shift registers (LFSRs) are shift registers through which binary data moves serially. As is the case with shift registers in general, during each cycle of data transfer, an input bit is fed into the first cell of the LFSR, and each bit in the LFSR shifts down one cell. The bit in the last cell is shifted out of the LFSR as an output bit. In practice, when referring to the number of cells in an LFSR, the term &#34;number of bits&#34; is often used to convey the same meaning. 
     In contrast to other types of shift registers, however, the input to an LFSR generally is a combination of its output bit and one or more of the bits in predetermined cells (referred to as &#34;taps&#34;) of the register, with the combination being fed back as the next input bit. For example, the bits to be combined may be compared using what is referred to as an &#34;exclusive OR&#34; operation, in which a binary zero results from the combination when the bits are of equal value, and a binary one results when the bits are unequal. It happens that with this structure, LFSRs are useful for many applications, such as cyclic redundancy check (CRC) circuits that are used to detect errors in digital transmissions, and pseudorandom number generators used in cryptology, digital video disks, and digital wireless telephones. 
     In certain of the above-mentioned applications, and particularly for digital video disk (DVD) applications, it is often desirable to undertake the LFSR functions quickly by using a software implementation of the LFSR for enhanced system flexibility and to facilitate the high rates at which data must be transferred in DVDs. 
     SUMMARY OF THE INVENTION 
     Accordingly, this invention is based upon implementation of an LFSR in a computer program that uses a table look-up to determine what the output of an LFSR would be after a predetermined number of shift cycles, starting with a known register content of the LFSR, that would render a result in one cycle what a counterpart LFSR implemented in hardware might take many cycles to render. 
     However, while such a table look up scheme provides much greater speed than can a single-bit-per-cycle LFSR, it would require an excessively large data storage space. For example, an LFSR of twenty or more bits, could require a lookup table of a size in excess of a megabyte. Nevertheless, this invention provides a software implementation of an LFSR that reduces table size, thereby reducing the data storage space required to store an LFSR result table. 
     Accordingly, it is an object of the present invention to provide an LFSR implemented in a computer program that reduces table size. Another object of the present invention is to provide a software implementation of an LFSR that can be used to quickly determine the results of a predetermined number of shifts in the LFSR. Yet another object of the present invention is to provide a software implementation of an LFSR that does not require excessively large lookup tables. Still another object of the present invention is to provide a software implementation of an LFSR that is easy to use and cost-effective. 
     The invention includes a general purpose digital computer programmed according to the inventive steps herein to implement the operations of a linear feedback shift register (LFSR). The invention can also be embodied as an article of manufacture--a machine component--used by a digital processing apparatus, and tangibly embodying a program of instructions that are executable by the digital processing apparatus to implement the operations of an LFSR. This invention is also realized in a critical machine component that causes a digital processing apparatus to perform the inventive method steps herein. 
     In accordance with the present invention, an LFSR, designated &#34;A&#34;, has a predetermined logical configuration. According to this invention, the method steps include generating data representations of at least two model LFSRs denominated the &#34;B LFSR&#34; and the &#34;C LFSR&#34;, respectively, with each model LFSR having the same logical configuration as the A LFSR. As disclosed in detail below, the B LFSR contains a subset B of bits of the A LFSR, and the C LFSR contains a subset C of bits of the A LFSR. Using the model LFSRs, B and C tables are generated. The B table represents at least the output of the B model LFSR after a predetermined number n of register shifts, and the C table represents at least the output of the C model LFSR after the predetermined number n of register shifts. The B table and the C table are accessed to retrieve a B output value and a C output value. These output values are combined to render a modelled output of the A LFSR. 
     Preferably, the B and C tables are accessed based on an initial value representing an initial state of the A LFSR. Additionally, the B output value is combined with the C output value using a bit-wise exclusive OR operation. In one preferred embodiment, the subset B includes higher order bits of the A LFSR, while the subset C includes lower order bits of the A LFSR. Also preferably, the number of bits in the B LFSR is equal to the number of bits in the C LFSR, which minimizes the sizes of the tables. When the number of bits in the A LFSR is odd, the number of bits in the B LFSR preferably is no more than one (1) more or less than the number of bits in the C LFSR. 
     In one preferred embodiment a computer includes a main storage, a cache and a main memory, and a sufficient number of model LFSRs are generated such that tables corresponding to the model LFSRs can all be stored in the data cache and accessed without requiring the accessing of the main storage. The computer is disclosed in combination with a digital video disk device. 
     In another aspect, a method is disclosed for determining an output of an A linear feedback shift register (LFSR). The method includes producing a data table that represents all possible states of the A LFSR, and then partitioning the table to produce at least a B replicate of the A LFSR and a C replicate of the A LFSR, with each replicate including at least a subset of the bits of the A LFSR The B and C replicates are lookup tables that contain representations of portions of A LFSR states. To obtain a representation of an A LFSR output, an output of the B replicate is combined with an output of the C replicate using a bitwise exclusive OR operation, which yields the output of the A LFSR. 
     In another aspect of the present invention, a computer program product is disclosed which is readable by a digital processing apparatus and which tangibly embodies a computer program. The computer program product combines a computer readable medium with program code elements that determine the output of an A linear feedback shift register (LFSR) defining a configuration including a number of bits, and having an initial LFSR value. 
     In this invention, the code elements are embodied in a program stored on the computer readable medium. These code elements include computer readable code means for replicating the A LFSR in software to generate a plurality of logical model LFSRs, with each model LFSR having a respective subset of bits of the A LFSR. Code means are also provided for generating respective data tables based on the logical model LFSRs. Each data table represents model output values of the respective logical model LFSR after a predetermined number of shifts. Moreover, code means determine the output of the A linear feedback shift register based on the model output values. 
     In yet another aspect, a computer includes computer readable instructions that are executable by the computer for performing method steps for determining the output of a linear feedback shift register (LFSR). The LFSR defines a configuration having a number of bits, and has one of a plurality of initial LFSR values, with each value being defined by a respective sequence of at least first bit values and second bit values. 
     In accordance with the present invention, the method steps include, for each initial LFSR value, replacing the values of the first bits with zeroes to establish first model values. Then, the method steps determine first outputs of the LFSR for each first model value. Only non-duplicative first outputs are stored in a first table. Also, for each initial LFSR value, the values of the second bits are replaced with zeroes to establish second model values, and second outputs of the LFSR are determined for each second model value. Only non-duplicative second outputs are stored in a second table. The method steps then include determining the output of the LFSR by accessing the first table to retrieve a first test output, accessing the second table to retrieve a second test output, and undertaking a bitwise exclusive OR operation on the first and second test outputs. 
     The details of the present invention, both as to its structure and operation, can best be understood in reference to the accompanying drawings, in which like reference numerals refer to like parts, and in which: 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic view of one system implementation of the LFSR module, shown in a digital video disk (DVD) system; 
     FIG. 2 is a schematic diagram of a program storage device; 
     FIG. 3 is a schematic diagram of an LFSR to be modelled; 
     FIG. 4 is a schematic diagram of the model LFSRs; and 
     FIG. 5 is a flow chart of the steps of the present invention in using logical model LFSRs to quickly and space-efficiently determine the output of the LFSR shown in FIG. 3. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Referring initially to FIG. 1, a system for quickly and efficiently determining the output of a linear feedback shift register (LFSR) is shown, generally designated 10. In the particular architecture shown, the system 10 includes a digital processing apparatus, such as a microprocessor 12 (or computer), for example the processor made by Intel Corp. and marketed under the trademark Pentium®. In accordance with principles known in the art, the microprocessor 12 includes a data cache 14 and a CPU 15. The microprocessor 12 operates in conjunction with a main memory 13. As is known, the cache 14 stores data in a high speed semiconductor memory for rapid access by the CPU 15. The microprocessor 12 also includes a clock 18 for generating clock cycle signals. A backing storage 16 is provided for reference storage of data. 
     As shown in FIG. 1, in one application the microprocessor 12 can be incorporated into a digital video disk (DVD) processor 20, for storing and retrieving data from a digital video disk 22. In turn, the DVD processor 20 can be associated with a personal computer (PC) or laptop computer 24 for presenting, on a monitor 26 of the PC or laptop computer 24, video images that are stored on the DVD 22. In one intended embodiment, the PC or laptop computer 24 may be a personal computer made by International Business Machines Corporation (IBM) of Armonk, N.Y. Alternatively, the computer 24 may be any computer, including computers sold under trademarks such as AS400, with accompanying IBM Network Stations. Or, the computer 24 may be a Unix computer, or OS/2 server, or Windows NT server, or IBM RS/6000 250 workstation. An input device, such as a mouse 28, is also associated with the PC or laptop computer 24. Input devices other than the mouse 28 can be used, e.g., a keyboard, or trackballs, keypads, touch screens, and voice recognition devices. 
     As further shown in FIG. 1, the computer 12 includes an LFSR module 30 which may be executed by the computer 12 as a series of computer-executable instructions. These instructions may reside, for example, in main memory of the microprocessor 12. 
     Alternatively, the instructions may be contained on a data storage device with a computer readable medium, such as the computer diskette 32 shown in FIG. 2. Other data storage devices on which the instructions may be stored include a DASD array, magnetic tape, conventional hard disk drive, electronic read-only memory, optical storage device, a node in a network, or other appropriate data storage device. 
     In an illustrative embodiment of the invention, the computer-executable instructions may be lines of compiled C or C ++   code, as set forth below. FIG. 5 and Table I illustrate the logic and structure of such instructions, as embodied in a computer program. Those skilled in the art will appreciate that FIG. 5 illustrates the logic of computer program code elements that function according to this invention. Manifestly, the invention is practiced in its essential embodiment by a machine component that renders the computer program code elements in a form that instructs a programmable digital processing apparatus (that is, a computer) to perform a sequence of function steps corresponding to those shown in FIG. 5. One example of such a machine component is shown in FIG. 2 as a combination of program code elements A-D in computer readable form that are embodied in a computer-usable data medium 34, on the computer diskette 32. As mentioned above, however, such media may also be embodied in many other forms. 
     In understanding the principles of the present invention, reference is now made to FIGS. 3 and 4. FIG. 3 shows a four-bit linear feedback shift register (LFSR) &#34;A&#34; having first through fourth cells 36, 38, 40, 42, with each cell containing a binary bit having a value of either zero (0) or one (1). It is to be understood that while a four bit LFSR is shown for clarity of disclosure, the number of bits in the LFSR could be more than four. For example, the LFSR &#34;A&#34; could hold twenty-one or more bits. In the four bit embodiment shown, the initial value of the LFSR &#34;A&#34; could be any one of 2 4  =sixteen possible values. 
     As shown in FIG. 3, the cells 36-42 of the LFSR &#34;A&#34; are initially filled with bits having values that together establish an initial LFSR value. More specifically, the first cell 36 contains a bit 0  having an initial value, the second cell 38 contains a bit 1  having an initial value, the third cell 40 contains a bit 2  having an initial value, and the fourth cell 42 contains a bit 3  having an initial value. For each clock cycle that is established by the clock 18 shown in FIG. 1, the bits in the LFSR &#34;A&#34; move, i.e., shift, to the next highest cell, with the bit in the fourth cell 42 being input to an exclusive OR logic element 44 as disclosed further below. Thus, in the embodiment shown in FIG. 3, the bits move from right to left through the LFSR &#34;A&#34;, with the most recently output bit being input to the first cell 36. 
     As shown in FIG. 3, the LFSR &#34;A&#34; is an LFSR that defines a configuration in which two bits of the LF SR are compared using an exclusive OR logic element to establish an output bit that is fed back into the LFSR &#34;A&#34; as the next input bit. More particularly, in the example shown in FIG. 3, the bit in the first cell 36 is combined with the bit in the fourth cell 42 by the exclusive OR logic element 44. In the example shown, contents of the first and fourth cells 36, 42 of the LFSR &#34;A&#34; are fed by &#34;taps&#34; of the LFSR to inputs of the logic element 44. 
     It can be appreciated in reference to FIG. 3 that the result of the exclusive OR logic element 44 establishes the output of the LFSR &#34;A&#34; and also the input bit for the next subsequent register shift defined by the clock 18. Accordingly, for the first shift of the LFSR &#34;A&#34;, the value of bit 0  is combined with the value of bit 3  by the logic element 44. 
     In accordance with exclusive OR principles, when the binary value of the bit from the first cell 36 equals the binary value of the bit from the fourth cell 42, the output bit of the logic element 44 has a value of zero (0); otherwise, the output bit has a value of one (1). It further will be appreciated that the output bits from several register shifts can be combined to establish a byte. For example, the output bit sequence of eight register shifts can establish an eight bit byte. 
     As understood by the present invention, it happens that the output bit of the LFSR &#34;A&#34; is the same as the result of an exclusive OR operation undertaken on the output bits of two or more model LFSRs, each of which is identical in configuration the LFSR &#34;A&#34;, i.e., each of which has the same number of elements and same tap points as the LFSR &#34;A&#34;, provided that the model LFSRs are shifted together and have initial bit values that are related to the initial bit value of the LFSR &#34;A&#34; as follows. The initial bit values of the model LFSRs are established such that a bitwise exclusive OR operation performed on the initial bit values of the model LFSRs yields the binary value represented by the initial bits of the &#34;A&#34; LFSR. When the above conditions are met, the value of the bit that results from the exclusive O-Ring of the outputs of the model LFSRs always and forever equals the value of the bit that would be output during the same clock cycle from the LFSR &#34;A&#34;. 
     A simplified example of such a model circuit is shown in FIG. 4, wherein a model LFSR &#34;B&#34; and a model LFSR &#34;C&#34; are provided. In accordance with the present invention, the &#34;B&#34; and &#34;C&#34; LFSRs are model LFSRs that can be implemented in hardware or, more preferably, in software, as more fully set forth below. In any case, the &#34;B&#34; LFSR initially contains a first subset of the initial bits in the &#34;A&#34; LFSR, and the&#34;C&#34; LFSR initially contains a second subset of the initial bits in the &#34;A&#34; LFSR. 
     In the preferred embodiment shown, the &#34;B&#34; LFSR initially contains the initial values of the two higher order bits of the &#34;A&#34; LFSR (bit 3  and bit 2  ), and these bits are in fourth and third cells 46, 48, respectively, of the &#34;B&#34; LFSR. The first and second cells 50, 52 of the&#34;B&#34; LFSR are initially filled with logical zeroes. In contrast, the &#34;C&#34; LFSR initially contains the initial values of the two lower order bits (bit 1  and bit 0  ) of the &#34;A&#34; LFSR, and these two bits are in the second and first cells 54, 56, respectively, of the &#34;C&#34; LFSR. The third and fourth cells 58, 60 of the &#34;C&#34; LFSR are initially filled with logical zeroes, as shown. Accordingly, it will be readily seen that a bitwise exclusive OR operation performed on the &#34;B&#34; and &#34;C&#34; LFSRs, by an output logic element 62, such that bit 3  of the B LFSR is exclusive Ored with bit 3  of the C LFSR, bit 2  of the B LFSR is exclusive Ored with bit 2  of the C LFSR, and so on, yields the four bits (bit 3 , bit 2 , bit 1 , bit 0 ) of the A LFSR. 
     It is to be understood that while the bits of the &#34;A&#34; LFSR preferably are allocated evenly between the &#34;B&#34; and &#34;C&#34; LFSRs, one of the &#34;B&#34; and &#34;C&#34; LFSRs initially can contain three of the initial bit values of the LFSR &#34;A&#34;, while the other contains the other initial bit value of the &#34;A&#34; LFSR, with the remaining cells of the model LFSRs initially containing zeroes. It is to be further understood that the principles herein apply to more than two model LFSRs. For example, for a twelve element LFSR to be modelled, three model LFSRs can be provided, with every third initial bit value of the LFSR to be modelled being contained in its corresponding cell in a respective one of the three model LFSRs, and with the initial values of the remaining bits of the model LFSRs being set to zero. 
     While the above-disclosed model LFSRs can be implemented in hardware, as envisioned herein they are preferably implemented in software in the form of an LFSR module 30, using the logic shown in FIG. 5, which will now be explained with reference to the entries shown in Table II below. Commencing at block 64 in FIG. 5, the configuration of the LFSR to be modelled is defined. Thus, using the example &#34;A&#34; LFSR shown in FIG. 3, at block 64 the first through fourth cells 36-42 of the LFSR &#34;A&#34; would be defined along with the taps of the LFSR. 
     Next, at block 66 the number (n) of desired output bits is defined. Thus, for example, it might be desired to receive the output bits that would be produced by the first eight shifts of the LFSR to be modelled, and this number is defined at block 66. 
     In such an instance, the skilled artisan will recognize that the size of the output would be eight bits. While the discussion below focuses on a single value of &#34;n&#34;, however, additional tables could be constructed that yield results for other values of &#34;n&#34;. For example, sixteen bit or thirty two bit results could be specified at block 66. 
     Next, in block 67, the output value tables for the &#34;B&#34; and &#34;C&#34; LFSRs are generated, based upon (n), and omitting redundant entries. These are the fourth and fifth columns of Table II. 
     Specifically, in block 67 the fourth column of Table II (referred to as a &#34;B&#34; table) is initialized based on the desired number (n) of bits defined at block 66, the &#34;B&#34; LFSR configuration defined at block 64, and the possible initial values of the &#34;B&#34; LFSR. More specifically, for each of the sixteen possible initial values from the second column of Table II that correspond to a respective one of the sixteen possible initial values of the A LFSR defined at block 64, the process determines what the first output bit would be from the model &#34;B&#34; LFSR. Then, based on the defined LFSR configuration, the logic determines what the output bit would be for the next register shift, and so on, until &#34;n&#34; bit values have been determined by determining the output results of &#34;n&#34; shifts of the model LFSR &#34;B&#34;. These &#34;n&#34; bit values are listed in sequence as shown in the fourth column of Table II, for each of the sixteen (in the present example) possible initial values. It is to be understood that the fifth column of Table II (which fifth column establishes a &#34;C&#34; table) is likewise initialized based on the desired number (n) of bits defined at block 66, the &#34;C&#34; LFSR configuration defined at block 64, and the initial state of the &#34;C&#34; LFSR. 
     In accordance with the present invention, while Table II below lists all sixteen entries in columns four and five for disclosure purposes, duplicative entries are preferably omitted during indexing of Table II. Thus, for example, only the first entry of the first four entries of the fourth column (i.e., the &#34;B&#34; table) need be stored, because the remaining three entries in that group are all equal to the first entry. The first four possible &#34;B&#34; LFSR values from column two would point to the first entry in column four. Likewise, only one entry in the second four entries of column four need be stored, and so on. 
     In the case of the fifth column, representing the output of the C LFSR, the first, fifth, ninth, and thirteenth entries are equal; thus, only the first entry need be considered when indexing Table II, and the remaining entries ignored. For the C LFSR, the first, fifth, ninth, and thirteenth possible initial bit values from column three (i.e., the &#34;C&#34; table) would point to the same output entry from column five. Likewise, only the second, third, and fourth values from column five need be stored, because the remaining values of column five are equal to one of the first four values as shown. 
     The advantageous implications of the present invention can now be fully appreciated. To simulate a twenty bit LFSR in software, without the benefit of present principles a single table for producing 8 bits per iteration would have a size of 2 20  bytes (i.e., more than a million bytes). With the present invention, however, two tables would be required (i.e., columns four and five in Table II), but each table would have a size of only 2 10  bytes, or 1,024 bytes, which together are only 1/512 as large as a single table otherwise would be. 
     Continuing to block 68, the model LFSRs are logically constructed following the principles set forth above by replicating the logical configuration of the LFSR to be modelled, and then, for each of the 16 possible initial bit value combinations of the &#34;A&#34; LFSR, placing a first subset of the initial bit values into the corresponding cells of a first model LFSR. Also, for each of the 16 possible initial states of the &#34;A&#34; LFSR, a second subset of the initial bit values are placed into the corresponding elements of a second model LFSR, and so on. In the example shown in FIG. 4, the higher order bits defined at block 64 are placed in the corresponding high bits of the &#34;B&#34; LFSR and the lower order bits defined at block 64 are placed in the corresponding bits of the &#34;C&#34; LFSR. 
     The results of the above steps are shown in the first five columns of Table II, with the second and third columns essentially establishing the model LFSRs (&#34;B&#34; and &#34;C&#34;). The first column lists the sixteen possible initial values, i.e., bit combinations, for the &#34;A&#34; LFSR. For disclosure purposes, the values are set forth in both hexadecimal notation and binary notation. The second column sets forth the values of the bits of the &#34;B&#34; LFSR that correspond to the sixteen initial values in the first column. As shown, the two higher order bits from the first column (i.e., from the LFSR to be modelled) are duplicated in the two higher order elements in the second column (i.e., in the higher order elements of the high order &#34;B&#34; LFSR). The two lower elements of the &#34;B&#34; LFSR are set equal to zero (0) for all sixteen possible initial values of the &#34;A&#34; LFSR. 
     In contrast, the third column of Table II sets forth the values of the bits of the &#34;C&#34; LFSR that correspond to the sixteen initial values in the first column. As shown, the two lower order bits from the first column (i.e., from the A LFSR) are duplicated in the two lower order elements in the third column (i.e., in the lower order elements of the low order model C LFSR). The two higher elements of the low order model LFSR &#34;C&#34; are set equal to zero (0) for all sixteen possible initial values of the &#34;A&#34; LFSR. 
     Additionally, as mentioned above, more than two model LFSRs (i.e., more than two tables) can be defined at block 64 to model the output of the A LFSR. Using more than two tables can facilitate storing all the lookup tables in the high speed data cache 14 of the microprocessor 12, without requiring accessing the relatively slower main memory 13. For example, in the case of a 25 bit LFSR on an Intel Pentium® processor, assuming 32 bit wide tables are desired, using three model LFSRs (respectively incorporating 8, 8, and 9 of the initial bits) permits the tables to be stored entirely in the data cache, whereas using two model LFSRs (respectively incorporating 12 and 13 of the initial bits) does not permit the tables to be stored in cache. Under these circumstances, the performance gain realized from using three tables in cache versus using two tables in main memory dwarfs the cost of the extra table lookup required when using three tables instead of two. 
     In block 70, the LFSR B table of output values (column 4 of Table II, for example) and the current value of LFSR B are used to determine B out . In this regard, the current value of LFSR B (in column 2) indexes to the output value in column 4 that represents the output value of the B LFSR. Similarly, the current value of the C LFSR in column 3 indexes to the output value of the C LFSR output in column 5. 
     Once the outputs of the model LFSRs have been determined and obtained from columns four and five, the output of the A LFSR to be modelled is determined at block 72 by combining outputs of the B and C LFSRs. According to the example of FIG. 3, the combination is embodied in a bitwise exclusive OR operation on the entries from columns four and five, which generates column six. Accordingly, when an output is desired, a value equivalent to one in column 6 can instead be produced in a few clock cycles by indexing the two values in columns 4 and 5, which are much smaller tables. 
     The output value derived in block 72 from exclusive ORing the outputs of the model LFSRs is output at block 74. Also, the output value of block 72 is sent to block 76, wherein it is combined with the left-shifted current value of LFSR &#34;A&#34; to determine the LFSR &#34;A&#34; initial value for the next bits to be produced, should any additional bits be desired. 
     The above-disclosed logic can be implemented in C code as set forth in table I, wherein the variable &#34;BITS&#34; is the number of cells in the LFSR to be modelled. The code below produces 8 bits per iteration. It is to be understood, however, that more than eight bits (for example, sixteen bits or thirty two bits) per iteration can be produced by increasing the width of the &#34;B&#34; and &#34;C&#34; tables. 
     
                       TABLE I______________________________________#define MASK ((1&lt;&lt;(BITS/2))-1)void LFSR(long A, /* the initial value of the LFSR */unsigned char*out, /* output of the LFSR put here */int bytes) /* number of bytes of output to put at `out` */static unsigned char hitable MASK+1!; /* B lookup table */static unsigned char lowtable MASK+1!; /* C lookup table *//* tables are 1&lt;&lt;(BITS/2) in size */long B = A &gt;&gt; (BITS/2); /* B register from Figure 4, shifted right by        BITS/2 to index the table */Long C = A &amp; MASK; /* C register from Figure 4 */while (--bytes &gt;= 0) {*out = lowtable C! Λ hitable B!;C = (C &lt;&lt; 8) + *out; /* begin reassembling `A` */B = MASK &amp; ((B &lt;&lt; 8) + (C &gt;&gt; (BITS/2)));C &amp;= MASK;out++;}}______________________________________ 
    
     When the value of BITS is odd, two MASK values would be used, one with the B register and one with the C register. 
     While the particular embodiment herein shown and described in detail is fully capable of attaining the above-described objects of our invention, it is to be understood that it is only a preferred embodiment, and is thus representative of subject matter that is broadly contemplated by the invention. Therefore, the scope of our invention fully encompasses other embodiments which may become obvious to those skilled in the art, and is accordingly to be limited by nothing other than the appended claims. 
     
                                           TABLE II__________________________________________________________________________Value.sub.AValue.sub.B     Value.sub.C          Out.sub.B                 Out.sub.C                        Out.sub.B XOR Out.sub.C__________________________________________________________________________0 (0000)0 (0000)     0 (0000)          00 (00000000)                 00 (00000000)                        00 (00000000)1 (0001)0 (0000)     1 (0001)          00 (00000000)                 eb (11101011)                        eb (11101011)2 (0010)0 (0000)     2 (0010)          00 (00000000)                 3d (00111101)                        3d (00111101)3 (0011)0 (0000)     3 (0011)          00 (00000000)                 d6 (11010110)                        d6 (11010110)4 (0100)4 (0100)     0 (0000)          7a (01111010)                 00 (00000000)                        7a (01111010)5 (0101)4 (0100)     1 (0001)          7a (01111010)                 eb (11101011)                        91 (10010001)6 (0110)4 (0100)     2 (0010)          7a (01111010)                 3d (00111101)                        47 (01000111)7 (0111)4 (0100)     3 (0011)          7a (01111010)                 d6 (11010110)                        ac (10101100)8 (1000)8 (1000)     0 (0000)          f5 (11110101)                 00 (00000000)                        f5 (11110101)9 (1001)8 (1000)     1 (0001)          f5 (11110101)                 eb (11101011)                        1e (00011110)a (1010)8 (1000)     2 (0010)          f5 (11110101)                 3d (00111101)                        c8 (11001000)b (1011)8 (1000)     3 (0011)          f5 (11110101)                 d6 (11010110)                        23 (00100011)c (1100)c (1100)     0 (0000)          8f (10001111)                 00 (00000000)                        8f (10001111)d (1101)c (1100)     1 (0001)          8f (10001111)                 eb (11101011)                        64 (01100100)e (1110)c (1100)     2 (0010)          8f (10001111)                 3d (00111101)                        b2 (10110010)f (1111)c (1100)     3 (0011)          8f (10001111)                 d6 (11010110)                        59 (01011001)__________________________________________________________________________