Signed-digit representation
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. 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.
History
Challenges in calculation stimulated early authors Colson and Cauchy to use signed-digit representation. The further step of replacing negated digits with new ones was suggested by Selling and Cajori.In 1928, Florian Cajori noted the recurring theme of signed digits, starting with Colson and Cauchy. In his book History of Mathematical Notations, Cajori titled the section "Negative numerals". For completeness, Colson uses examples and describes addition, multiplication and division using a table of multiples of the divisor. He explains the convenience of approximation by truncation in multiplication. Colson also devised an instrument that calculated using signed digits.
Eduard Selling 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 a it. Another German usage of signed-digits was described in 1902 in Klein's encyclopedia.
Definition and properties
Digit set
Let be a finite set of numerical digits with cardinality , with each digit denoted as for. is known as the radix or number base. can be used for a signed-digit representation if there exists a unique function such that.can be partitioned into three distinct sets,, and, representing the positive, zero, and negative digits respectively, such that all digits satisfy, all digits satisfy and all digits satisfy. The cardinality of is, the cardinality of is, and the cardinality of is, giving the number of positive and negative digits respectively, such that.
Balanced form representations
Balanced form representations are representations where for every positive digit, there exist a corresponding negative digit such that. It follows that. Only odd bases can have balanced form representations, as when, is always an odd number. In balanced form, the negative digits are usually denoted as positive digits with a bar over the digit, as for. For example, the digit set of balanced ternary would be with,, and. This convention is adopted in finite fields of odd prime order :Dual signed-digit representation
Every digit set has a dual digit set given by the inverse order of the digits with an isomorphism defined by. As a result, for any signed-digit representations of a number system ring constructed from with valuation, there exists a dual signed-digit representations of,, constructed from with valuation, and an isomorphism defined by, where is the additive inverse operator of. The digit set for balanced form representations is self-dual.For integers
Given the digit set and function as defined above, let us define an integer endofunction as the following:If the only periodic point of is the fixed point, then the set of all signed-digit representations of the integers using is given by the Kleene plus, the set of all finite concatenated strings of digits with at least one digit, with. Each signed-digit representation has a valuation
Examples include balanced ternary with digits.
Otherwise, if there exist a non-zero periodic point of, then there exist integers that are represented by an infinite number of non-zero digits in. Examples include the standard decimal numeral system with the digit set, which requires an infinite number of the digit to represent the additive inverse, as, and the positional numeral system with the digit set with, which requires an infinite number of the digit to represent the number, as.
For decimal fractions
If the integers can be represented by the Kleene plus, then the set of all signed-digit representations of the decimal fractions, or -adic rationals, is given by, the Cartesian product of the Kleene plus, the set of all finite concatenated strings of digits with at least one digit, the singleton consisting of the radix point, and the Kleene star, the set of all finite concatenated strings of digits, with. Each signed-digit representation has a valuationFor real numbers
If the integers can be represented by the Kleene plus, then the set of all signed-digit representations of the real numbers is given by, the Cartesian product of the Kleene plus, the set of all finite concatenated strings of digits with at least one digit, the singleton consisting of the radix point, and the Cantor space, the set of all infinite concatenated strings of digits, with. Each signed-digit representation has a valuationThe infinite series always converges to a finite real number.
For other number systems
All base- numerals can be represented as a subset of, the set of all doubly infinite sequences of digits in, where is the set of integers, and the ring of base- numerals is represented by the formal power series ring, the doubly infinite serieswhere for.
Integers modulo
The set of all signed-digit representations of the integers modulo, is given by the set, the set of all finite concatenated strings of digits of length, with. Each signed-digit representation has a valuationPrüfer groups
A Prüfer group is the quotient group of the integers and the -adic rationals. The set of all signed-digit representations of the Prüfer group is given by the Kleene star, the set of all finite concatenated strings of digits, with. Each signed-digit representation has a valuationCircle group
The circle group is the quotient group of the integers and the real numbers. The set of all signed-digit representations of the circle group is given by the Cantor space, the set of all right-infinite concatenated strings of digits. Each signed-digit representation has a valuationThe infinite series always converges.
-adic integers
The set of all signed-digit representations of the -adic integers, is given by the Cantor space, the set of all left-infinite concatenated strings of digits. Each signed-digit representation has a valuation-adic solenoids
The set of all signed-digit representations of the -adic solenoids, is given by the Cantor space, the set of all doubly infinite concatenated strings of digits. Each signed-digit representation has a valuationIn written and spoken language
The oral and written forms of numbers in the Punjabi language use a form of a negative numeral one written as una or un. This negative one is used to form 19, 29, …, 89 from the root for 20, 30, …, 90. Explicitly, here are the numbers:- 19 unni, 20 vih, 21 ikki
- 29 unatti, 30 tih, 31 ikatti
- 39 untali, 40 chali, 41 iktali
- 49 unanja, 50 panjah, 51 ikvanja
- 59 unahat, 60 sath, 61 ikahat
- 69 unattar, 70 sattar, 71 ikhattar
- 79 unasi, 80 assi, 81 ikiasi
- 89 unanve, 90 nabbe, 91 ikinnaven.
- 8 robeli meaning "break two" i.e. two fingers down
- 9 robong meaning "break one" i.e. one finger down
Other systems
There exist other signed-digit bases such that the base. A notable examples of this is Booth encoding, which has a digit set with and, but which uses a base. The standard binary numeral system would only use digits of value.Note that non-standard signed-digit representations are not unique. For instance:
The non-adjacent form 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,