


%
% (C) 2006 Muthiah Annamalai <muthuspost@gmail.com>
%
% This function generates the output bits from the PRBS
% state, for the number of iterations specified.
%
% First argument is the PRBS structure obtained from prbs_generator.
% PRBS iterations is specified in the second argument.
% PRBS start state is taken from the prbs.sregs.
%
% Second argument of the output is PRBS structure with a new
% state. This allows error like:
%
% [ seq, prbs ] = prbs_iterator( prbs, niterations );
%
% while the state of the PRBS is updated.
%
% Example: If you had a PRBS shift register like the diagram
% below with 4 registers we use representation by polynomial
% of [ 1 2 3 4], and feedback connections between [ 1 3 4 ].
% The output PRBS sequence is taken from the position 4.
%
% +---+ +----+ +---+ +---+
% | D |----| D |---| D |---| D |
% +---+ +----+ +---+ +---+
% | | |
% \ / /
% [+]---------------+------+
% 1 + 0.D + 1.D^2 + 1.D^3
%
% The code to implement this PRBS will be
% prbs=prbs_generator([1 3 4],{[1 3 4]},[1 0 1 1]);
% x = prbs_iterator(prbs,15)
%
% See Also: This function is to be used along with functions
% prbs_iterator, prbs_generator and prbs_sequence.
%