A method is provided for compressing data from a source
stream of data comprising a string of values using one or more distinct
computer memory addresses as
workspace, each
computer memory address having one or more locations to hold one or more distinct values, respectively. The method works by reading two contiguous data values, of length K and N bits respectively, from a
source data stream, as a
memory address reference, and a current symbol value, respectively. The current symbol value is written to replace one of the values at the
memory address reference if the current symbol value does not match any of the values at the
memory address reference, and a MISS code, followed by the current symbol value, are appended to the compressed
data stream. Alternatively, if the current symbol value matches any of the values at the memory address reference, then a hit code is added to the compressed
data stream, said hit code representing the location, or an attribute associated with the location, where the value was found in the memory address reference. The method is repeated for all symbols read from the source
stream. An equivalent, symmetric and reversible decompression or
reconstruction method creates an uncompressed
data stream equivalent to the original source stream. Advantageously, the
workspace employed by the
compression method has similar behavior to that of a cache memory used in
computer architecture, allowing the
compression method to be implemented using
content addressable memory, that is associative or intelligent memory for hardware designs or associative arrays for
software implementation.