Skip to content

Instantly share code, notes, and snippets.

View alanvgreen's full-sized avatar

Alan Green alanvgreen

View GitHub Profile
@andreasWallner
andreasWallner / lsfr.py
Created June 12, 2014 22:12
Galois LSFR implementation for python
""" simple LFSR generator
Uses galois algorithmn to return next bit of LFSR.
To initialize the generator pass the seed value (one
value that the generator will generate, != 0) and
the used polynom.
Observe that for a n bit polynom, x^n has to be in
the polynom, which should be the case anyhow therefore e.g.:
x^4 + x^3 + 1 = 0b1100