Talk:Linear-feedback shift register

message: The register should have been tapped at location 15 (consider 1-16 numbering), but it is tapped at location 14. Even the polynomial equation mentions it to be 15.  — Preceding unsigned comment added by 202.83.19.101 (talk) 06:53, 27 May 2016 (UTC)
thread_title: 16-bit Fibonacci LFSR wrongly tapped

message: "A list of alternative maximal-length polynomials for shift-register lengths 4-32 (beyond which it becomes unfeasible to store or transfer them) can be found here"
Uh, why does it become unfeasable? It's just a list of exponents, and later we link to a document that contains them up to 168! This seems contradictory or it's unclear and I'm misinterpreting it.  — Preceding unsigned comment added by 208.54.80.175 (talk) 22:13, 2 March 2013 (UTC)
replies: text:  Full lists of alternative exponents become infeasible to store because the number of alternatives increase quickly.  There are 67,108,864 32-bit alternative polynomials in the 186MB file 32.dat.gz at http://users.ece.cmu.edu/~koopman/lfsr/index.html . Presumably the 33 bit list of alternatives would be another 180MB file.  The  https://web.archive.org/web/20161007061934/http://courses.cse.tamu.edu/csce680/walker/lfsr_table.pdf is has a table with polynomials up to 786 plus for 1024, 2048 and 4096. Drf5n (talk) 01:38, 5 January 2022 (UTC)
thread_title: Why can't we store?

message: if the animation is wrong maybe we should eliminate it.
:Agreed and done. Cuddlyable3 (talk) 21:13, 3 January 2008 (UTC)
thread_title: Animation

message: Hi, I don't see where it is stated that the LFSR maximal period is 2^N,with N the number of state bits, am I missing something here?
:See the table I added. The maximal period is 2^N - 1. Cuddlyable3 (talk) 21:15, 3 January 2008 (UTC)
thread_title:  Where is the period of maximal LFSR stated? 

message: I recently cleaned up the C source code for the Galois LFSR. However, I am considering removing everything but the actual implementation of the LFSR (2-3 lines of code), because I think most people would find that more useful (and less confusing). I am also unsure how "optimized" the code should be. Any opinions? -Ufretin 14:40, 16 January 2007 (UTC)
replies: text: Could someone figure out which book that was in, and add it as a citation to this article? (Possibly the "TTL Cookbook" or "CMOS Cookbook" ?) --DavidCary (talk) 17:28, 31 July 2013 (UTC)
thread_title:  Galois source code 

message: Is there a proof for this statement? How shall the tap values be taken?
The polynomial 0133 is a maximum length polynomial, if it is written as
x^6 + x^4 + x^3 + x^1 + 1, the tap values would contain 6 and 3, which have 3 as a common factor.
84.161.181.208 19:48, 28 January 2007 (UTC)
replies: text: Primarscources has posted original "research" with an incorrect report of his LFSR period. The decent thing to do is to remove such disinformation. Cuddlyable3 23:35, 1 December 2007 (UTC)

text: I confirm that LFSR period = 1023.Cuddlyable3 21:05, 3 December 2007 (UTC)

text: You've misunderstood what they mean by relatively prime.  The entire set must be relatively prime with respect to each other, not just pairwise.  4, 5, 8, and 10 are not relatively prime.  See the distinction in http://en.wikipedia.org/wiki/Relatively_prime between a group of numbers being relatively prime and being pairwise relatively prime.  If all taps are divisible by some number a, then the polynomial will be divisible by x^a + 1, and hence obviously not be primitive.  This is the same principle that forces the number of taps to be even (or else x + 1 divides the polynomial).  —Preceding unsigned comment added by 70.110.22.198 (talk) 14:47, 29 April 2008 (UTC)

text: The section is quite generally a mess and even the set of tabs is not well defined. E.g. the tabs of the feedback polynomial x^{16} + x^{14} + x^{13} + x^{11} + 1 is [16, 14, 13, 11, 1] in the intro, then [16, 14, 13, 11] when the editors claim that the number of tabs must be even and finally [16, 14, 13, 11, 0] when they construct an equivalent sequence. The claim that not every tab must be divisible by some integer a> 1 is certainly correct, because then every output bit only depends on bits on positions that preceed it by a multiple of a, but that does not imply that the feedback polynomial is divisible by x^a+1 as claimed above. A counterexample is x^6+x^3+1, which is not divisible by x^3+1. 92.107.127.170 (talk) 07:50, 25 March 2009 (UTC)
thread_title:  The tap values in a maximal LFSR will be relatively prime 

message: The wording in section Uses in cryptography implies that an encryption system based on an LFSR is unbreakable, i.e. an attacker has no resort other than brute force search to crack the cipher.  Although LFSR-based scrambling is used in some applications (idem), and while a one time pad is unbreakable, a stream from an LFSR is not necessarily a perfectly unpredictable stream of random bits and so a citation is needed to show that the search space of such a cipher is 2n (or less, as the case may be.) -- Regregex (talk) 20:38, 2 August 2008 (UTC)
replies: text: I removed the entire paragraph. It simply isn't true, as the subsequent paragraph makes clear. --agr (talk) 10:15, 3 August 2008 (UTC)
thread_title:  Cryptographic strength 

message: I was able to get the two version to produce the same output at "bit 1", but there is a time offset of 656. I mention the time offset in the text. This is the code that I used to find the offset:
   for ( uint16 offset = 0; offset < 0xFFFF; ++offset) {
       
       unsigned short lfsr1 = 0xFFFF;
       unsigned short lfsr2 =  0xFFFF;
       unsigned int in, bit10, bit11, bit20, bit21;
       unsigned int period = 0;
       
       for( int a = 0;; a++ )
           {
               // taps: 16 14 13 11; feedback polynomial: x^16 + x^14 + x^13 + x^11 + 1
               
               in  = ((lfsr1 >> 15) ^ (lfsr1 >> 13) ^ (lfsr1 >> 12) ^ (lfsr1 >> 10)) & 1;
               lfsr1 =  (lfsr1 << 1) | in;
               bit10 = lfsr1 & 1;
               bit11 = (lfsr1 >> 15) & 1;
               
               if (a >= offset) {
                   in = lfsr2 & 1u;
                   lfsr2 = (lfsr2 >> 1) ^ ((in << 15) | (in << 13) | (in << 12) | (in << 10));   
                   bit20 = lfsr2 & 1;
                   bit21 = (lfsr2 >> 15) & 1;
                                     
                   if (bit10 != bit20) break;
                   printf( "%d %d %d %d %d %d %d %d %s %s\n",
                           offset, a,
                           bit10, bit11, bit20, bit21, 
                           lfsr1, lfsr2,
                           byte_to_binaryN(lfsr1,16).c_str(), byte_to_binaryN(lfsr2,16).c_str() );
                   
               }
           } 
   }
Quanticles (talk) 17:45, 5 October 2012 (UTC)
thread_title:  Calculating Time Offset 

message: The maximal polynomials in the table are incorrect. I had fixed the 8-bit case but it has been reverted. The coefficients in that case are 8,6,5,4. As the gcd of 8,4 is 2 these are not relatively prime and so either the claim in the article is wrong or this polynomial is wrong. Please provide the sequence that you believe this polynomial generates. Amoss (talk) 02:25, 19 November 2008 (UTC)
replies: text: Cuddlyable3 (talk) 14:09, 19 November 2008 (UTC)
thread_title: Maximal Polynomials

message: WP:MOSMATH actually exists.  Really.  It does.  If found this in the article:
: 
: [n,n-C,n-B,n-A,0]
: 
I changed it to this:
: 
: [n, n − C, n − B, n − A, 0]
: 
Do some people really think the former looks like the latter? Michael Hardy (talk) 21:48, 18 February 2009 (UTC)
thread_title:  MOSMATH 

message: Why are all the images in reversed colours?  Oli Filth(talk|contribs) 20:11, 1 March 2009 (UTC)
replies: text: Because that's how I made them. Cheers. Cuddlyable3 (talk) 21:04, 2 March 2009 (UTC)

text: I also made them public domain so you are free to try different colours. To do that use a hex editor (such as Hexplorer which is free) and make changes to the palette of the gif file. I think the present colours look well on a screen (where most Wikipedia viewing is done) but are less good for printouts. Cuddlyable3 (talk) 10:39, 4 March 2009 (UTC)
replies: text: Personally, I love white-on-black. --Andreas Rejbrand (talk) 19:18, 8 January 2010 (UTC)
replies: text: However, the static images should be vector graphical, i.e. SVGs. --Andreas Rejbrand (talk) 19:18, 8 January 2010 (UTC)
replies: text: Yes, MediaWiki should support SVG animation, but at least when I made :file:Dual boot icon.svg, it didn't. --Damian Yerrick (talk | stalk) 22:18, 16 January 2010 (UTC)
thread_title:  Image colour scheme 

message: "The only linear functions of single bits are xor and inverse-xor; thus it is a shift register whose input bit is driven by the exclusive-or (xor) of some bits of the overall shift register value."
It is unclear what this means. The first clause appears to refer to a linear map from one n-dimensional binary vector space to another. Is the function of the map XOR some constant n-tuple? In this case, the clause is false. Consider a one dimensional binary vector space and a map function constant of 1. XOR 1 is just negation. However ~e1 + ~e2 != ~(e1 + e2), where e1 and e2 are element of the first vector space. Hence, XOR is not a valid linear map.  —Preceding unsigned comment added by 72.15.8.14 (talk) 23:59, 19 May 2009 (UTC)
replies: text: XOR is integer addition modulo 2, and ~x = 1 + x. Of course (1+e1) + (1+e2) != 1+(e1 + e2), because addition of a constant is never a linear map, but addition of the arguments (without a constant) is linear. Therefore, a polynomial counter using the XNOR function would not strictly be an LFSR because it is not linear, even though the sequence is the complement of the corresponding XOR counter. But are there any sources that distinguish XOR counters from XNOR ones and call only the former LFSRs? --Damian Yerrick (talk | stalk) 19:43, 16 January 2010 (UTC)
replies: text: A recent edit to this article assumes that linear means an affine map as opposed to a linear map, which would make XNOR also linear. I've brought up this definition dispute in Talk:Linear#Boolean functions. --Damian Yerrick (talk | stalk) 00:52, 3 August 2011 (UTC)
thread_title:  Linear functions of single bits 

message: I reinstated the sub-section Uses as counters. The usefulness is notable because 1) LFSR's uniquely provide any desired count (i.e. cycle length or division ratio) with the minimum amount of logic gates excluding only simple ripple-through counters that are unsuitable for fast synchronous circuits; and 2) their speed advantage, especially in the Galois configuration. Tables 1 and 2 of the Xilinx source cited describe this application of LFSRs to "Counters with a shorter cycle [that] require additional decoding of the feedback signal". Cuddlyable3 (talk) 10:16, 31 May 2009 (UTC)
replies: text: Fair enough!  I removed it because it sounded like OR, and I had assumed (without checking) that the link was just a table of polynomials.  But you're absolutely right, the app note does describe their use in this context.  Oli Filth(talk|contribs) 10:23, 31 May 2009 (UTC)
thread_title:  Usefulness as counters 

message: There is the statement that:
As an alternative to the XOR based feedback in an LFSR, one can also use XNOR.[1] This function is not linear, but it results in an equivalent polynomial counter whose state of this counter is the complement of the state of an LFSR. A state with all ones is illegal when using an XNOR feedback, in the same way as a state with all zeroes is illegal when using XOR. This state is considered illegal because the counter would remain "locked-up" in this state.
It seems to me that with an odd number of XNOR inputs that this isn't true.  If you XOR an odd number of ones the result will be one, invert that and it is zero.  The all ones state is not the stationary state for such register.  There will still be one, but that isn't it.   Gah4 (talk) 04:19, 6 February 2010 (UTC)
replies: text: True but AFAIK one never needs an odd number of taps to generate a maximal sequence. Cuddlyable3 (talk) 20:38, 6 February 2010 (UTC)

text: No that's not true. If all-zeros and all-ones can't be stationary states there is none because all other patterns are variable under the bitshift operation. This is not proof that there is a single 2^n step sequence. Perhaps, instead there are two or more disjoint sequences? Jasen betts (talk) 11:39, 23 September 2010 (UTC)
thread_title:  XNOR register question 

message: To native english speakers, the phrase ".. an LFSR .. " is preferred to ".. a LFSR".  The usage of "a" vs. "an" depends on whether the _sound_ of the syllable which follows is that of a vowel or consonant:
- An Apple (Apple begins with a vowel sound)
- A Rabbit (Rabbit begins with a consonant sound) 
Even though "LFSR" begins with a letter, when something is written as an abbreviation it would be read aloud letter by letter: "an Ell eff es are" reads normally.  In the article, there are several examples written as "a Ell eff es are" which forces the reader to try to see if LFSR can be pronounced as a word.  It cannot be pronounced by the normal rules of English pronunciation because lfsr doesn't contain any vowels.  So then the reader reads a third time, mentally editing the "a" into an "an," which reads normally.  This mental process slows normal reading.
There is a certain ambiguity here because some people DO pronounce acronyms as words.  But here, a dictionary and spelling will tell the difference.  If an acronym becomes a word, like radar, it is no longer written in CAPS.  So in the case where the acronym can be pronounced, and if you mean to lead the vanguard, write the acronym in lowercase if you mean it to be pronounced. Otherwise, write the acronym in all uppercase letters if you mean it to be read letter-by-letter (it always will be).
Does Wikipedia have a grammar rule for this?  —Preceding unsigned comment added by 142.68.233.4 (talk) 09:54, 31 March 2010 (UTC)
replies: text: Agree that ".. an LFSR .." reads naturally. I corrected the heading to "Grammar". Cuddlyable3 (talk) 18:03, 11 April 2010 (UTC)
thread_title:  Grammar Question 

message: There is a note that citations are needed for the security weaknesses in A5 and E0.  What is the appropriate way to indicate that the citations are present in the articles on A5/1, A5/2, and E0?  Thanks Doctorhook (talk) 00:31, 23 June 2010 (UTC)
replies: text: By re-citing the relevant citations. Effectively citing other articles looks evasive IMHO. -- Regregex (talk) 10:06, 23 June 2010 (UTC)
replies: text: Okay, I added a few.  Does the article still need more citations?  If so I'll try to help, but I don't see where.  Otherwise we should remove the tag. Doctorhook (talk) 15:07, 24 June 2010 (UTC)
thread_title:  A5 and E0 

message: Is Marsagalia's Xorshift algorithm a linear feedback shift register? It seems similar but I'm not sure. Should there be a mention on the page? Hiiiiiiiiiiiiiiiiiiiii (talk) 02:56, 16 May 2011 (UTC)
thread_title:  Xorshift 

message: There is a really cool application of LFSRs in the classic Atari game "Pitfall!":
http://www.gdcvault.com/play/1014632/Classic-Game-Postmortem-PITFALL
Check out the section "polynomial counter"  — Preceding unsigned comment added by 70.91.166.181 (talk) 00:28, 12 June 2011 (UTC)
replies: text: Yes. A reversible sequence was generated. The way of doing this could be added to the "Uses as counters" section. Cuddlyable3 (talk) 11:14, 4 August 2011 (UTC)
thread_title:  Pitfall! 

message: First of all, I just changed the redirect for PN sequences to go to here.  Another pseudonym or synonym for LFSR sequence (besides *"PN sequence"*) is Maximum length sequence, but there is already an article there.
"LFSR sequences", "PN sequences", "Maximum length sequences" (MLS), and binary Galois fields" (GF(2)) are all about the same thing.  While I certainly do not propose merging this with the Galios field page, the first three should be merged and presented in the Computer science or Electrical engineering context.  Not in a pure mathematics context.
I am and will remain an anonymous IP.  But will some Wikipedians with accounts join in this effort to fix this problem?  Please discuss below. 71.184.228.118 (talk) 03:35, 30 July 2016 (UTC)
replies: text: A pseudo-noise sequence can be generated in many way, not just by LFSRs (so I undid your change of the redirect).  And not all LFSR sequences are maximum length.  And GF(2) is good for lots of things besides LFSRs.  So how about a more precise proposal?  Dicklyon (talk) 04:34, 30 July 2016 (UTC)
replies: text:  I won't undo your undo.  The proposal is already precise.  It's about merging the content of Maximum length sequences to here.  And yes, not all LFSR sequences are MLS, but every MLS is an LFSR sequence. 71.184.228.118 (talk) 04:53, 30 July 2016 (UTC)
thread_title:  Merge [[Maximum length sequence]] to here 

message: Hello fellow Wikipedians,
I have just modified 2 external links on Linear-feedback shift register. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Corrected formatting/usage for http://courses.cse.tamu.edu/csce680/walker/lfsr_table.pdf
*Added archive https://web.archive.org/web/20060111183721/http://homepage.mac.com/afj/lfsr.html to http://homepage.mac.com/afj/lfsr.html
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 09:56, 16 May 2017 (UTC)
thread_title:  External links modified 

message: Current generation bits are shifting, but not yet inputs to any XOR.
16bit example on Wiki would then contain 10 cells of one generation.
From first XOR onward, consider those bits to be previous generation.
16bit example on Wiki would then contain 6 cells of prior generation.
For 10celled generations, display only every 10th bit-serial iteration.
Format the output accordingly to see the cellular automata at work.
CA behavior becomes more obvious with longer LFSRs, and simple rules
of narrow span.
Try a 48bit LFSR with single XOR, or Wolfram's Rule30: XOR(A,OR(B,C)).
CA may place a mirror on one boundary to assure symmetry will evolve
beside and never inside the register.
LFSR uses the arrow of time to extend one boundary, a similar but not
identical break of symmetry.
76.8.25.170 (talk) 02:43, 30 July 2017 (UTC)
thread_title:  LFSR as bit-serial cellular automata 

message: Hello fellow Wikipedians,
I have just modified one external link on Linear-feedback shift register. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20060315203220/http://www.yikes.com/~ptolemy/lfsr_web/index.htm to http://www.yikes.com/~ptolemy/lfsr_web/index.htm
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 18:39, 23 December 2017 (UTC)
thread_title:  External links modified 

message: Hello fellow Wikipedians,
The text says "In the diagram the taps are [16,14,13,11]"  - this seems to indicate that location 16, the "output", is a "tap". Therefore it's awkward (wrong?) to state "The taps are XOR'd sequentially with the output bit" because that means the output bit is to be XOR'd with itself (tab 16) effectively.
Cheers
Mike (talk) 18:31, 29 August 2018 (UTC)
thread_title:  "The taps are XOR'd sequentially with the output bit" 

message: I think this article needs more Galois field theory. In particular the "Fibonacci" (I have never heard this term before) feedback system is calculating successive powers of x mod a primitive polynomial over GF(2). The feedback reduces the result after each shift by the primitive polynomial. If the polynomial is irreducible and not primitive then the cycle is not of maximum length. Note that the multiplicative group of a finite field is cyclic of order p^n-1 so has a generator that generates the entire multiplicative group.
Note that the field operators for GF(2) are XOR for plus and ordinary multiplication for times. For GF(2^n) a representation is polynomials over GF(2) mod a primitive polynomial. (An irreducible polynomial also works but powers of x do not cover all of the non-zero elements.)
Some proofs that the output of a maximal LFS sequence mimics white noise would also be appropriate.
I am willing to try to add this material.
References:
Berlekamp - Algebraic Coding Theory
Peterson - Error Correcting Codes
RochesterRetired (talk) 21:54, 28 December 2019 (UTC)
thread_title:  This article needs more Galois field theory 

message: The claim "State and resulting bits can also be combined and computed in parallel. " seems overstated. The `prgs63` function is given as an example to prove the point.  This particular polynomial x^63+x^62+1 supports computing 32 bits in parallel at a time (twice) because the polynomial has no nonzero coefficients in the low 32 bits (except the implicit x^0).
I think the generalization here is that you can create a number of parallel outputs at or less than the length of the feedback loop := number of trailing zeros in the "taps" description (which omits the implicit x^0). Mborg (talk) 22:19, 21 December 2023 (UTC)
thread_title:  Galois Parallel computation claim seems too hasty to generalize from an example