Electronic – Parallel prefix adder cells in Negabinary

adderdigital-logic

I'm trying to design a parallel prefix adder for a negabinary based adder. Negabinary is base \$-2\$ instead of the familiar base \$2\$ binary. Each 1 bit adder generates a sum and two (instead of one in binary) carries that go to the next adder.

To make the adder faster, I want to use a parallel prefix structure, like the Ladner-Fischer structure given below. I'm familiar with the functionality of the purple cell in the binary system, but I'm unsure how I could get the same functionality in the negabinary system.

The reason I'm doing this is just for fun, I haven't found any uses for negabinary yet.

Formulas for calculating the sum and carries:

\$s_i = a_i \oplus b_i \oplus (c_i^+ + c_i^-) \$

\$ c_{i+1}^+ = \overline{a_i}\overline{b_i}\overline{c_i^+}c_i^- \$

\$ c_{i+1}^- = a_ib_i\overline{c_i^-}+a_i c_i^+ \overline{c_i^-}+b_i c_i^+ \overline{c_i^-} \$

Ladner-fischer carry tree structure:

enter image description here

If anything is unclear, please don't hesitate to ask.

Best Answer

I have probably spent more time on this question than I should've, but here are my findings.

I cannot find any example of a "pure" parallel prefix adder for negabinary numbers. I also think it's an open problem, as I haven't seen any proof that it isn't possible.

The closest I can get you is by using a two-step negative negabinary addition (commonly abbreviated n.n.b.a. in literature). It is based on the following property:

Let \$f(x) = \overline{x_{n-1}}x_{n-2}...\overline{x_1}x_0\$ and \$g(x) = x_{n-1}\overline{x_{n-2}}...x_1\overline{x_0}\$. These are basically an XOR-operation with 0xAA...AA and 0x55...55 respectively. You can then prove that

$$-(a +_{nb} b) = g\left(f(a) + f(b) + 1\right)$$

Where the left side is the negabinary sum \$+_{nb}\$, while the \$+\$ on the right side is a normal binary sum.

The negative sum can then simply be inverted using the same property but with a zero operand:

$$-x = g\left(f(x) + f(0) + 1\right)$$

So in order to find the sum using parallel prefix adders, you can:

  1. Compute \$f(a)\$ and \$f(b)\$, ie. by inverting every odd bit of the negabinary numbers
  2. Compute the regular binary sum while setting the carry bit for the LSB (the \$+1\$), leading to a first intermediary sum \$s_1\$.
  3. Invert all bits of \$s_1\$ (this is \$f(g(s_1))\$). This is the finish of the first sum, while also starting the inversion.
  4. Increment the result by 0xAA...AB (\$=f(0)+1\$) using a parallel prefix adder, yielding the second intermediary sum \$s_2\$
  5. Compute \$g(s_2)\$ (inverting each even bit) to find the final negabinary sum.

I have actually tried to find a "pure" parallel prefix adder, but I considered it too complex for the time I was willing to spend on it. Here's why:

The whole point of parallel prefix adders is to find some operation of \$\{0,1\}^n \times \{0,1\}^n \rightarrow \{0,1\}^n\$ that allows you to easily calculate the (in this case 2) carries from these bits. As an added constraint, the operation needs to be associative to be computed in parallel. For example, this basically excludes any NOT operator (that is not part of a double negation). For example: \$a \circ b=a\cdot \bar b\$ is not an associative operator, because

$$\begin{align} (a\circ b)\circ c &= a\cdot \bar b \cdot \bar c\\ a\circ (b \circ c) &= a\cdot \overline{b \cdot \bar c} \end{align}$$

Note that the boolean operator for the carries in your question includes the mixed terms \$c_i^+\overline{c_i^-}\$ and \$c_i^-\overline{c_i^+}\$, making it impossible to use it as-is. For a single carry in normal binary addition, it became quite obvious how to construct this operator when thinking about it in terms of generation and propagation, but it seems to be not so obvious for negabinary carries.

Related Topic