
344 Embedded systems design
Directional buffers
If you sit down and start playing with buffers, it quickly
becomes apparent that there is more to buffer design than first
meets the eye. For example, the data must be kept in the same
order in which it was placed to preserve the chronological order.
This is especially important for signal data or data that is sampled
periodically. With an infinitely long buffer, this is not a problem.
The first data is placed at the top of the buffer and new data is
inserted underneath. The data in and out pointers then simply
move up and down as needed. The order is preserved because
there is always space under the existing ...