A memory location determining device for determining locations in a memory, the locations for storing M pieces of compressed data each compressed from a corresponding one of M pieces of N-bit data to be less than N bits, the M pieces of N-bit data constituting a data block, the memory location determining device comprising:
- a judgment unit configured to judge, for each of the M pieces of compressed data, whether a piece of compressed data is ordinary compressed data or special compressed data, the ordinary compressed data having a length of X bits or less, where X<N, the special compressed data having a length of Y bits, where Y>X;
- a division unit configured to, with respect to each of the M pieces of compressed data, when the judgment unit judges that the piece of compressed data is special compressed data, divide the piece of compressed data being the special compressed data into first compressed data having a length of X bits and second compressed data having a length of Y−X bits;
- a first determiner configured to
- perform, for each of the M pieces of compressed data, a first arithmetic operation on an address value of a corresponding piece of N-bit data in the data block, and
- determine a location indicated by a result value of the first arithmetic operation as a location for storing first data of the piece of compressed data, the first data having a length of L bits or less, where L<N,
- wherein when the piece of compressed data is ordinary compressed, where X<L<N, the first data includes all bits of the piece of ordinary compressed data and a flag indicates that the length is X bits or less, and
- wherein when the piece of compressed data is special compressed data, the first data includes the first compressed data and a flag indicating that the length exceeds X bits;
- and
- a second determiner configured to
- perform, for each piece of special compressed data, a second arithmetic operation on the address value of the corresponding piece of N-bit data in the data block, and
- determine a location indicated by a result value of the second arithmetic operation as a location for storing second data of the piece of special compressed data, the second data including the second compressed data,
- wherein the second arithmetic operation is selected from a plurality of second arithmetic operations based on a status of one or more pieces of special compressed data among the M pieces of compressed data.