commit | 9943a14a792e654d2ceb901137bb5dd2d89da3ae | [log] [tgz] |
---|---|---|
author | Jeff DiCorpo <jeffdi@efabless.com> | Fri Jan 20 07:09:52 2023 -0800 |
committer | Jeff DiCorpo <jeffdi@efabless.com> | Fri Jan 20 07:09:52 2023 -0800 |
tree | 55a7231c0d2d735ac1886006e41b98e03ad000f7 | |
parent | 0ba1bb9da2c5909678d85eac82eca6f9075466d4 [diff] |
final gds oasis
LIFO (Last in First out) Buffer Many times in embedded programming, we need to use a data structure to organize our data, and a good example of this is the buffer. Oftentimes, we have a source of data, or a producer, and we also have a destination for data, a consumer. These two devices usually need to pass data in between one another. It is possible that these two devices often do not work at the same speed. Sometimes, one is much faster at producing or consuming the data. This means that we cannot just call the consumer from the producer to handle that data directly with a function call. We need an intermediate location to store data to act as a buffer for this interface. This buffer is usually implemented as a data structure in shared memory between these two processing interfaces. The LIFO buffer adds data and removes data from the same end. The LIFO data structure can be referred to as a stack, but not be confused with the processor stack. The LIFO differs from the processor stack because it adds and removes data of the same type, whereas the stack on the processor adds or removes different types of data depending on the type of calling convention or function. In terms of memory, this buffer usually is implemented in an array-like format but it is not an array. LIFO buffers are a contiguous piece of memory that require special methods to add and remove data.