Unary coding: Difference between revisions

Content deleted Content added
Arlene47 (talk | contribs)
m Added material on generalized unary coding
Arlene47 (talk | contribs)
m Generalized unary coding: Clarification and fixed a typo
Line 50:
==Generalized unary coding==
A generalized version of unary coding is able to represent numbers much more efficiently than standard unary coding.<ref>Kak, S.,
Generalized unary coding. Circuits, Systems and Signal Processing. 2015. http://link.springer.com/article/10.1007/s00034-015-0120-7#page-1 </ref> Here's an example of generalized unary coding for integers from 1 through 15 that trequiresrequires only 7 bits (where three bits are arbitrarily chosen in place of a single one in standard unary to show the number). Note that the representation is cyclic where one uses markers to represent higher integers in higher cycles.
{| class="wikitable"
! n !! Unary code !! Generalized unary
Line 87:
|}
Generalized unary coding requires that the range of numbers to be represented be pre-specified because this range determines the number of bits that are needed.
 
==See also==
*[[Unary numeral system]]