LfsrDescriptor class
Describes a right-shifting Fibonacci linear-feedback shift register.
For a degree-n polynomial, state bit zero is shifted out first. The new
state bit n - 1 is the XOR of state bits selected by the polynomial's
coefficients below x^n. For example, x^4 + x + 1 advances:
nextState[2:0] = state[3:1]
nextState[3] = state[1] XOR state[0]
The polynomial must have positive degree. The default constructor also requires a non-zero constant coefficient. Primitivity is not required.
- Annotations
Constructors
- LfsrDescriptor(BinaryPolynomial polynomial)
-
Creates an LFSR descriptor using
polynomial. -
LfsrDescriptor.fromFeedbackTaps({required int stateWidth, required Iterable<
int> feedbackTaps}) -
Creates a descriptor from zero-based feedback state-bit indices.
factory
Properties
- configurationSignature → String
-
A deterministic signature suitable for generated definition names.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- polynomial → BinaryPolynomial
-
The characteristic polynomial.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serialRecurrence → BinaryLinearRecurrenceDescriptor
-
The one-bit-per-step recurrence.
no setter
- width → int
-
The number of state bits.
no setter
Methods
-
advance(
BigInt state) → BigInt -
Advances packed
stateby one serial step. -
advanceParallel(
BigInt state, int steps) → BigInt -
Advances packed
statebystepsserial steps. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
outputBits(
BigInt state, int steps) → BigInt -
Returns
stepsconsecutive shifted-out bits packed earliest-first. -
outputTransform(
int steps) → BinaryAffineTransform -
Returns the output transform for
stepsconsecutive shifted-out bits. -
parallelRecurrence(
int steps) → BinaryLinearRecurrenceDescriptor -
Returns the recurrence that advances
stepsserial steps at once. -
toString(
) → String -
A string representation of this object.
inherited
-
transition(
int steps) → BinaryAffineTransform -
Returns the state transform for
stepsserial advancements.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override