Fibonacci Linear Feedback Shift Register (Pseudo-Random Number Generator)

Dependents:   SDP_K1_Rand FibonacciLFSR_LED_Demo

Embed: (wiki syntax)

« Back to documentation index

FibonacciLFSR Class Reference

FibonacciLFSR Class Reference

Library for Fibonacci Linear Feedback Shift Register pseudo-random number generator. More...

#include <FibonacciLFSR.h>

Public Member Functions

 FibonacciLFSR (LFSR_SIZE_t size)
 Constructor of Fibonacci Linear Feedback Shift Register Objects.
uint16_t getRandom ()
 Generate and return new random number.

Detailed Description

Library for Fibonacci Linear Feedback Shift Register pseudo-random number generator.

The uniqueness of the Fibonacci LFSR is that all permutations (values) are explored except zero, ensuring at least one bit in the LFSR is always HIGH.

Applications: Random Number Generation, LED Faux Candles, LED lighting effects, etc.

References: https://en.wikipedia.org/wiki/Linear-feedback_shift_register

Definition at line 20 of file FibonacciLFSR.h.


Constructor & Destructor Documentation

FibonacciLFSR ( LFSR_SIZE_t  size )

Constructor of Fibonacci Linear Feedback Shift Register Objects.

Preconditions: None

Parameters:
sizeNumber of bits for LFSR

Definition at line 4 of file FibonacciLFSR.cpp.


Member Function Documentation

uint16_t getRandom (  )

Generate and return new random number.

Returns:
A new random value

Definition at line 10 of file FibonacciLFSR.cpp.