Elias Universal Integer Codes
Decode self-delimiting integer lengths and distinguish incomplete headers from valid messages.
Free theory articleDecode self-delimiting integer lengths and distinguish incomplete headers from valid messages.
Concept & interpretation
Elias universal codes (such as Gamma and Delta codes) are used to encode positive integers so that the resulting codewords are prefix-free. This self-delimiting property allows a receiver to decode a sequence of numbers without needing to know beforehand how many bits represent each number.
Interactive Experiment
You can test different integer values and encoding types using the Elias Universal Integer Codes module.
- Select the Code as "Delta".
- Set the Integer to 16. Observe the generated "Full codeword"
001010000and how the bit trace separates the unary length from the binary size and payload. - Change the Truncate setting to "Drop final bit".
- Observe that the status changes to "Truncated code" and the "Decoded integer" becomes "Unavailable", demonstrating that prefix codes rely on the complete sequence to be decodable.