Talk:Non-adjacent form

From Wikipedia, the free encyclopedia

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;
ei: = ci + bi − 2ci + 1;

end