data.buffer ≡
template <auto N, typename T, bool Initialize = true> inline pair<T[N], T[N]> serial_in_parallel_out(T data) ยง
This function implements a shift register that accepts one data value per cycle to be shifted in at the most-significant end and returns the contents of the entire register prior to shifting and after shifting. If needed, the number of valid entries in the shift register must be tracked by the user manually. Since this is an inline function, each call-site will have its own private shift register instance; sharing the same instance can be achieved by calling this function from a non-inline shared outer function.
Parameters
-
auto NLength of shift register
-
typename TType of each buffer entry
-
bool Initialize = true
true if the state values should be initialized to {}