Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
LFSR.h File Reference
#include <array>
#include <bitset>
#include <cassert>
#include <cstdint>
#include <vector>
#include <set>
#include <cmath>
#include "TError.h"
Include dependency graph for LFSR.h:

Namespaces

namespace  ROOT
 
namespace  ROOT::Math
 
namespace  ROOT::Math::LFSR
 Pseudo Random Binary Sequence (PRBS) generator namespace with functions based on linear feedback shift registers (LFSR) with a periodicity of 2^n-1.
 

Functions

template<size_t k, size_t nTaps, typename Output = unsigned char>
std::vector< Output > ROOT::Math::LFSR::GenerateSequence (std::bitset< k > start, std::array< std::uint16_t, nTaps > taps, bool left=true, bool wrapping=false, bool oppositeBit=false)
 Generation of a sequence of pseudo-random bits using a linear feedback shift register (LFSR), until a register value is repeated (or maxPeriod is reached)
 
template<size_t k, size_t nTaps>
bool ROOT::Math::LFSR::NextLFSR (std::bitset< k > &lfsr, std::array< std::uint16_t, nTaps > taps, bool left=true)
 Generate the next pseudo-random bit using the current state of a linear feedback shift register (LFSR) and update it.