Jump to content

Elias delta coding

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PierreAbbat (talk | contribs) at 10:19, 9 May 2002 (Moving from gamma code). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Elias Delta code is a universal code encoding the positive integers. To code a number:

  1. Write it in binary.
  2. Count the bits, remove the leading one, and write that number in binary preceding the previous bit string.
  3. Subtract 1 from the number of bits written in step 2 and prepend that many zeros.

The code begins:

 1 1
 2 0100
 3 0101
 4 01100
 5 01101
 6 01110
 7 01111
 8 00100000
 9 00100001
10 00100010
11 00100011
12 00100100
13 00100101
14 00100110
15 00100111
16 001010000
17 001010001

See also Elias Gamma coding