a wire: --------------- position on output_next [-] // clear position on input [ position on output_next + position on input - ] // by the end of the loop output_next will contain what was on the input signal. // and the input signal will get a temporary value of 0