Signed-digit representation should not be confused with Signed number representations.
In mathematical notation for numbers, a signed-digit representation is a positional numeral system with a set of signed digits used to encode the integers.
Signed-digit representation can be used to accomplish fast addition of integers because it can eliminate chains of dependent carries.[1] In the binary numeral system, a special case signed-digit representation is the non-adjacent form, which can offer speed benefits with minimal space overhead.
Challenges in calculation stimulated early authors Colson (1726) and Cauchy (1840) to use signed-digit representation. The further step of replacing negated digits with new ones was suggested by Selling (1887) and Cajori (1928).
In 1928, Florian Cajori noted the recurring theme of signed digits, starting with Colson (1726) and Cauchy (1840).[2] In his book History of Mathematical Notations, Cajori titled the section "Negative numerals".[3] For completeness, Colson[4] uses examples and describes addition (pp. 163–4), multiplication (pp. 165–6) and division (pp. 170–1) using a table of multiples of the divisor. He explains the convenience of approximation by truncation in multiplication. Colson also devised an instrument (Counting Table) that calculated using signed digits.
Eduard Selling[5] advocated inverting the digits 1, 2, 3, 4, and 5 to indicate the negative sign. He also suggested snie, jes, jerd, reff, and niff as names to use vocally. Most of the other early sources used a bar over a digit to indicate a negative sign for it. Another German usage of signed-digits was described in 1902 in Klein's encyclopedia.[6]
Let
l{D}
b>1
b\leq1
di
0\leqi<b.
b
l{D}
fl{D}:l{D} → Z
fl{D}(di)\equivi\bmodb
0\leqi<b.
fl{D
l{D}.
l{D}
l{D}+
l{D}0
l{D}-
d+\inl{D}+
fl{D}(d+)>0
d0\inl{D}0
fl{D}(d0)=0
d-\inl{D}-
fl{D}(d-)<0
l{D}+
b+
l{D}0
b0
l{D}-
b-
b=b++b0+b-
See also: Balanced ternary. Balanced form representations are representations where for every positive digit
d+
d-
fl{D}(d+)=-fl{D}(d-)
b+=b-
db/2
0\ne
b2 | |
d-\inl{D}-
d-=\bar{d}+
d+\inl{D}+
l{D}3=\lbrace\bar{1},0,1\rbrace
fl{D3
fl{D3
fl{D3
q
Fq=\lbrace0,1,\bar{1}=-1,...d=
q-1 | |
2 |
, \bar{d}=
1-q | |
2 |
| q=0\rbrace.
Every digit set
l{D}
l{D}\operatorname{op}
g:l{D} → l{D}\operatorname{op}
-fl{D}=g\circ
\operatorname{op}} | |
f | |
l{D |
l{N}
N
l{D}
vl{D}:l{N} → N
N
l{N}\operatorname{op}
l{D}\operatorname{op}
\operatorname{op}}:l{N} | |
v | |
l{D |
\operatorname{op} → N
h:l{N} → l{N}\operatorname{op}
-vl{D}=h\circ
\operatorname{op}} | |
v | |
l{D |
-
N
Given the digit set
l{D}
f:l{D} → Z
T:Z → Z
T(n)=\begin{cases}
n-f(di) | |
b |
&ifn\equivi\bmodb,0\leqi<b \end{cases}
T
0
Z
l{D}
l{D}+
dn\ldotsd0
n\inN
m\inl{D}+
+ → Z | |
v | |
l{D}:l{D} |
vl{D}(m)=
n | |
\sum | |
i=0 |
fl{D}(di)bi
l{D}=\lbrace\bar{1},0,1\rbrace
Otherwise, if there exist a non-zero periodic point of
T
l{D}
\operatorname{dec}=\lbrace0,1,2,3,4,5,6,7,8,9\rbrace
9
-1
T\operatorname{dec}(-1)=
-1-9 | |
10 |
=-1
l{D}=\lbraceA,0,1\rbrace
f(A)=-4
A
2
Tl{D}(2)=
2-(-4) | |
3 |
=2
l{D}+
b
Z[1\backslashb]
l{Q}=l{D}+ x l{P} x l{D}*
l{D}+
dn\ldotsd0
l{P}
.
,
l{D}*
d-1\ldotsd-m
m,n\inN
q\inl{Q}
vl{D}:l{Q} → Z[1\backslashb]
vl{D}(q)=
n | |
\sum | |
i=-m |
fl{D}(di)bi
l{D}+
R
l{R}=l{D}+ x l{P} x l{D}N
l{D}+
dn\ldotsd0
l{P}
.
,
l{D}N
d-1d-2\ldots
n\inN
r\inl{R}
vl{D}:l{R} → R
vl{D}(r)=
n | |
\sum | |
i=-infty |
fl{D}(di)bi
All base-
b
l{D}Z
l{D}
Z
b
Z[[b,b-1]]
infty | |
\sum | |
i=-infty |
aibi
ai\inZ
i\inZ
The set of all signed-digit representations of the integers modulo
bn
Z\backslashbnZ
l{D}n
dn\ldotsd0
n
n\inN
m\inl{D}n
n → Z/b | |
v | |
l{D}:l{D} |
nZ
vl{D}(m)\equiv
n-1 | |
\sum | |
i=0 |
fl{D}(di)bi\bmodbn
Z(binfty)=Z[1\backslashb]/Z
b
l{D}*
d1\ldotsdn
n\inN
p\inl{D}*
* → Z(b | |
v | |
l{D}:l{D} |
infty)
vl{D}(m)\equiv
n | |
\sum | |
i=1 |
fl{D}(di)b-i\bmod1
The circle group is the quotient group
T=R/Z
l{D}N
d1d2\ldots
m\inl{D}n
N → T | |
v | |
l{D}:l{D} |
vl{D}(m)\equiv
infty | |
\sum | |
i=1 |
fl{D}(di)b-i\bmod1
The set of all signed-digit representations of the b
Zb
l{D}N
\ldotsd1d0
m\inl{D}n
N → Z | |
v | |
b |
vl{D}(m)=
infty | |
\sum | |
i=0 |
fl{D}(di)bi
The set of all signed-digit representations of the
b
Tb
l{D}Z
\ldotsd1d0d-1\ldots
m\inl{D}n
Z → T | |
v | |
b |
vl{D}(m)=
infty | |
\sum | |
i=-infty |
fl{D}(di)bi
The oral and written forms of numbers in the Indo-Aryan languages use a negative numeral (e.g., "un" in Hindi and Bengali, "un" or "unna" in Punjabi, "ekon" in Marathi) for the numbers between 11 and 90 that end with a nine. The numbers followed by their names are shown for Punjabi below (the prefix "ik" means "one"):[8]
Similarly, the Sesotho language utilizes negative numerals to form 8's and 9's.
In Classical Latin,[9] integers 18 and 19 did not even have a spoken, nor written form including corresponding parts for "eight" or "nine" in practice - despite them being in existence. Instead, in Classic Latin,
For upcoming integer numerals [28, 29, 38, 39, ..., 88, 89] the additive form in the language had been much more common, however, for the listed numbers, the above form was still preferred. Hence, approaching thirty, numerals were expressed as:
This is one of the main foundations of contemporary historians' reasoning, explaining why the subtractive I- and II- was so common in this range of cardinals compared to other ranges. Numerals 98 and 99 could also be expressed in both forms, yet "two to hundred" might have sounded a bit odd - clear evidence is the scarce occurrence of these numbers written down in a subtractive fashion in authentic sources.
There is yet another language having this feature (by now, only in traces), however, still in active use today. This is the Finnish Language, where the (spelled out) numerals are used this way should a digit of 8 or 9 occur. The scheme is like this:[10]
...
Above list is no special case, it consequently appears in larger cardinals as well, e.g.:
Emphasizing of these attributes stay present even in the shortest colloquial forms of numerals:
...
However, this phenomenon has no influence on written numerals, the Finnish use the standard Western-Arabic decimal notation.
In the English language it is common to refer to times as, for example, 'seven to three', 'to' performing the negation.
There exist other signed-digit bases such that the base
b ≠ b++b-+1
l{D}=\lbrace\bar{1},0,1\rbrace
b+=1
b-=1
b=2<3=b++b-+1
\lbrace0,1\rbrace
Note that non-standard signed-digit representations are not unique. For instance:
0111l{D
10\bar{1}1l{D
1\bar{1}11l{D
100\bar{1}l{D
The non-adjacent form (NAF) of Booth encoding does guarantee a unique representation for every integer value. However, this only applies for integer values. For example, consider the following repeating binary numbers in NAF,
2 | |
3 |
=0.\overline{10}l{D