M5Utility 0.0.7 git rev:ba71c71
Loading...
Searching...
No Matches
m5::utility::FibonacciLFSR_Right< N, Taps > Class Template Reference

Fibonacci LFSRs (right-shift version) More...

#include <lfsr.hpp>

Public Types

using state_type_t = std::bitset<N>
 State type.
 

Public Member Functions

const state_type_tstate () const noexcept
 Gets the state.
 
template<typename UL = unsigned long, typename std::enable_if<(sizeof(UL) *CHAR_BIT >=64), std::nullptr_t >::type = nullptr>
uint64_t value () const
 Gets the state value.
 
template<typename UL = unsigned long, typename std::enable_if<(sizeof(UL) *CHAR_BIT< 64), std::nullptr_t >::type = nullptr>
uint64_t value () const
 
bool step () noexcept
 Shift 1 step (Right). Returns output bit (LSB before shift)
 
uint64_t step (const uint32_t nbits) noexcept
 Shift nbit steps and gets.
 
Constructor
 FibonacciLFSR_Right (const uint64_t seed) noexcept
 
 FibonacciLFSR_Right (const state_type_t s) noexcept
 
Helper
uint16_t next16 () noexcept
 Shift 16 bits and get.
 
uint32_t next32 () noexcept
 Shift 32 bits and get.
 
uint64_t next64 () noexcept
 Shift 64 bits and get.
 

Static Protected Member Functions

template<uint32_t... Ts>
static bool taps_xor (const std::bitset< N > &s)
 
static bool taps_xor_all (const state_type_t &s)
 

Protected Attributes

state_type_t _state
 

Detailed Description

template<uint32_t N, uint32_t... Taps>
class m5::utility::FibonacciLFSR_Right< N, Taps >

Fibonacci LFSRs (right-shift version)

Template Parameters
NValue bit width (1..64)
TapsTap bit indexes (polynomial exponent)
Note
FibonacciLFSR_Right<16,16,14,13,11> means 16bits x^16 + x^14 + x^13 + x^11 + 1