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

Fibonacci LFSR (left-shift version) More...

#include <lfsr.hpp>

Public Types

using state_type_t = std::bitset<N>
 

Public Member Functions

const state_type_t & state () 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 (Left). Returns output bit (MSB before shift)
 
uint64_t step (const uint32_t nbits) noexcept
 Shift nbits steps and pack outputs LSB-first.
 
Constructor
 FibonacciLFSR_Left (const uint64_t seed) noexcept
 
 FibonacciLFSR_Left (const state_type_t s) noexcept
 
Helpers
uint16_t next16 () noexcept
 
uint32_t next32 () noexcept
 
uint64_t next64 () noexcept
 

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_Left< N, Taps >

Fibonacci LFSR (left-shift version)

Template Parameters
NValue bit width (1..64)
TapsTap bit indexes
Note
Output bit = MSB, feedback is inserted to LSB (left shift).