Compression Engine

Mantissa and exponent not always represent a floating point number

Breaking a large vector into a combination of mantissa and exponent is a frequently used technique to compress data. Using mantissa and exponent reduces the number of bits needed to represent the vector with some impact on the accuracy.

Rohan wants to deploy a similar scheme where he wants a 24-bit vector to be compressed into a 12-bit mantissa and a 4-bit exponent. The resultant vector can be obtained using the combination of mantissa and exponent in the following manner:

if (exponent == 0) then
  vector = mantissa
else
  vector = {1'b1, mantissa, {exponent-1{0}}}
end

Loading the interactive workspace...