Non-adjacent form

Non-adjacent form
Numeral systems by culture
Hindu-Arabic numerals
Western Arabic
Eastern Arabic
Indian family
Tamil
Burmese
Khmer
Lao
Mongolian
Thai
East Asian numerals
Chinese
Japanese
Suzhou
Korean
Vietnamese
Counting rods
Alphabetic numerals
Abjad
Armenian
Āryabhaṭa
Cyrillic
Ge'ez
Greek (Ionian)
Hebrew
Other systems
Aegean
Attic
Babylonian
Brahmi
Egyptian
Etruscan
Inuit
Kharosthi
Mayan
Quipu
Roman
Sumerian
Urnfield
List of numeral system topics
Positional systems by base
Decimal (10)
2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 60, 64
List of numeral systems
v · d · e

The non-adjacent form (NAF) of a number is a unique signed-digit representation. Like the name suggests, non-zero values cannot be adjacent. For example:

(0 1 1 1)2 = 4 + 2 + 1 = 7
(1 0 −1 1)2 = 8 − 2 + 1 = 7
(1 −1 1 1)2 = 8 − 4 + 2 + 1 = 7
(1 0 0 −1)2 = 8 − 1 = 7

All are valid signed-digit representations of 7, but only the final representation (1 0 0 −1) is in NAF.

Obtaining NAF

There are several algorithms for obtaining the NAF representation of a value given in binary. One such is the following method using repeated division; it works by choosing non-zero coefficients such that the resulting quotient is divisible by 2 and hence the next coefficient a zero[1].

Input: E = (em − 1 em − 2 ··· e1 e0)2
Output: E = (zm zm − 1 ··· z1 z0)NAF
i ← 0
while E > 0 do
if E is odd then
zi ← 2 − (E mod 4)
else
zi ← 0
E ← (Ezi)/2
ii + 1
return z

Properties

NAF assures a unique representation of an integer, but the main benefit of it is that the Hamming weight of the value will be minimal. For regular binary representations of values, half of all bits will be non-zero, on average, but with NAF this drops to only one-third of all digits.

Obviously, at most half of the digits are non-zero, which was the reason it was introduced by G.W. Reitweisner in 1960 for speeding up early multiplication algorithms, much like Booth encoding.

Because every non-zero value has to be adjacent to two 0's, the NAF representation can be implemented such that it only takes a maximum of m + 1 bits for a value that would normally be represented in binary with m bits.

The properties of NAF make it useful in various algorithms, especially some in cryptography, e.g., for reducing the number of multiplications needed for performing an exponentiation. In the algorithm exponentiation by squaring the number of multiplications depends on the number of non-zero bits. If the exponent here is given in NAF form a digit value 1 implies a multiplication by the base, and a digit value -1 by its reciprocal.

References

  1. ^ D. Hankerson, A. Menezes, and S.A. Vanstone, Guide to Elliptic Curve Cryptography, Springer-Verlag, 2004. p. 98.

Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Non-standard positional numeral systems — Numeral systems by culture Hindu Arabic numerals Western Arabic (Hindu numerals) Eastern Arabic Indian family Tamil Burmese Khmer Lao Mongolian Thai East Asian numerals Chinese Japanese Suzhou Korean Vietnamese …   Wikipedia

  • Non-uniform rational B-spline — Three dimensional NURBS surfaces can have complex, organic shapes. Control points influence the directions the surface takes. The outermost square below delineates the X/Y extents of the surface …   Wikipedia

  • Non-English usage of quotation marks — A Non English usage of quotation marks Punctuation apostrophe ( …   Wikipedia

  • Non-linear editing system — NLE redirects here. For the standardized test, see National Latin Examination. For non linear or non destructive editing of 2D images, see Non destructive editing. In video, a non linear editing system (NLE) is a video editing (NLVE) or audio… …   Wikipedia

  • Non-geographic telephone numbers in the United Kingdom — In the United Kingdom, non geographic numbers (NGNs) are telephone numbers available for private sale which, rather than being assigned to a particular telephone line or circuit, provide callers with a contact number which gives no indication as… …   Wikipedia

  • Non-directional beacon — Radio Tower of NKR Leimen Ochsenbach, Germany This symbol denotes an NDB on an aeronaut …   Wikipedia

  • Long non-coding RNA — Long noncoding RNAs (long ncRNAs) are generally considered (somewhat arbitrarily) as non protein coding transcripts longer than 200 nucleotides. This limit is due to practical considerations including the separation of RNAs in common experimental …   Wikipedia

  • Contra dance form — This article supplements the main contra dance article. Contra dance form describes the arrangement of dancers into contra dance sets and minor sets. There are various forms, and each dance s choreography specifies its formation. A caller s first …   Wikipedia

  • Thomas Whitham Sixth Form — Infobox UK school name = Thomas Whitham Sixth Form size = latitude = longitude = dms = motto = motto pl = established = 2006 approx = closed = c approx = type = Sixth Form College religion = Non denominational president = head label = head = Mr… …   Wikipedia

  • Signed-digit representation — of numbers indicates that digits can be prefixed with a − (minus) sign to indicate that they are negative. Signed digit representation can be used in low level software and hardware to accomplish fast high speed addition of integers because it… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”