# Redundant binary representation

A redundant binary representation (RBR) is a numeral system that uses more bits than needed to represent a single binary digit so that most numbers have several representations. A RBR is unlike usual binary numeral systems, including two's complement, which use a single bit for each digit. Many of a RBR's properties differ from those of regular binary representation systems. Most importantly, a RBR allows addition without using a typical carry. When compared to non-redundant representation, a RBR makes bitwise logical operation slower, but arithmetic operations are faster when a greater bit width is used. Usually, each digit has its own sign that is not necessarily the same as the sign of the number represented. When digits have signs, that RBR is also a signed-digit representation.

## Conversion from RBR

A RBR is a place-value notation system. In a RBR, digits are pairs of bits, that is, for every place, a RBR uses a pair of bits. The value represented by an RBR digit can be found using a translation table. This table indicates the mathematical value of each possible pair of bits.

As in conventional binary representation, the integer value of a given representation is a weighted sum of the values of the digits. The weight starts at 1 for the rightmost position and goes up by a factor of 2 for each next position. Usually, a RBR allows negative values. There is no single sign bit that tells if a RBR represented number is positive or negative. Most integers have several possible representations in an RBR.

Often one of the several possible representations of an integer is chosen as the "canonical" form, so each integer has only one possible "canonical" representation -- non-adjacent form and two's complement are a popular choices for that canonical form.

An integer value can be converted back from a RBR using the following formula, where n is the number of digit and dk is the interpreted value of the k-th digit, where k starts at 0 at the rightmost position:

$\sum _{k=0}^{n-1}d_{k}2^{k}$ The conversion from a RBR to two's complement can be done in O(log(n)) using prefix adder where n is the number of digit.

## Example of redundant binary representation

Example of translation table for a digit
Digit Interpreted value
00 −1
01  0
10  0
11  1

Not all RBR have the same properties. For example, using the translation table on the right, the number 1 can be represented in this RBR in many ways: "01·01·01·11", "01·01·10·11", "01·01·11·00", "11·00·00·00". Also, for this translation table, flipping all bits (NOT gate) corresponds to finding the additive inverse (multiplication by −1) of the integer represented.

## Arithmetic operations

A RBR is used by particular arithmetic logic units.

In particular, a carry-save adder uses a RBR.