Talk:Non-adjacent form

Alternating signs paragraph
The paragraph on alternating signs is not correct. Just consider the binary representation of decimal 9, being 1001, which is its unique NAF form.

It is however correct that the Booth Algorithm determines a signed digit representation where the signs of the non-zero digits alternate.

BUT the Booth algorithm does not generate a NAF representation! Take as an example a binary string with an isolated 1, say ...$$00100$$..., which by the Booth Algorithm converts into ...$$01\bar1$$...

The original algorithm for converting a binary number into its equivalent and unique NAF form was given by Reitwiesner in 1960, but normally it is described by the following right-to-left algorithm:

Input: $$b_{n-1}\cdots b_1b_0$$ in 2's complement Output: $$e_n e_{n-1}\cdots e_1 e_0$$ $$c_0:=0;\ b_{n+1}:=b_n:=b_{n-1};$$ for $$i:=0$$ to $$n$$ do $$c_{i+1}:=\lfloor(c_i+b_i+b_{i+1})/2\rfloor;$$ $$e_i:=c_i+b_i-2c_{i+1};$$ end

— Preceding unsigned comment added by Kornerup (talk • contribs) 19:15, 8 February 2006 (UTC)

Encoding the NAF of an m-bit number using m+1 bits
The article currently states that "[b]cause 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." Can someone provide more details on this "implementation"? 188.169.229.30 (talk) 19:39, 27 April 2013 (UTC)

NAF example in Obtaining NAF
While correcly labeling binary and NAF digits for one NAF digit more, it is not striking because zm&#8239;&minus;&#8239;2 is dropped. Also, how to show the zeroes? Input   E =    (em&minus;1 em&#8239;&minus;&#8239;2 &hellip; e3 e2 e1 e0)2 Output  Z = (zm zm&minus;1 zm&#8239;&minus;&#8239;2 &hellip;  0 z2  0 z0)NAF is intuitive, but flawed: z2 may be 0, allowing z3 to be non-zero. 84.63.77.35 (talk) 02:27, 31 May 2015 (UTC)

Merge proposal
It is proposed to merge Canonical signed digit into this page, they describe the same thing. 2001:4DD7:2E47:0:7285:C2FF:FE6C:992D (talk) 08:00, 12 July 2021 (UTC)

The merge has been performed. Trex4321 (talk) 12:13, 8 August 2021 (UTC)