1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-07 08:28:57 +00:00

Documents next.

This commit is contained in:
Thomas Harte 2020-01-19 20:32:58 -05:00
parent 5391a699a4
commit 4b2c68c3d3

View File

@ -47,6 +47,10 @@ template <typename IntType = uint64_t, IntType polynomial = LSFRPolynomial<IntTy
}
}
/*!
Advances the LSFR, returning either an @c IntType of value @c 1 or @c 0,
determining the bit that was just shifted out.
*/
IntType next() {
auto result = value_ & 1;
value_ = (value_ >> 1) ^ (result * polynomial);