Page 561 - Introduction to Information Optics
P. 561
546 9. Computing with Optics
The logic in Eq. (9.82) determines the carry status by looking across a wide
word. In each block, the output indicates that a carry has been generated
within that block or a low-order carry would be propagated through that
block.
For TSD arithmetic operations, the input numbers are first encoded in 3\s
complement, as shown in the following equation:
N - 2
1
X = -*„_, x 3"- + X -*; x 3 '> -x,-e{0,l,2}. (9.83)
; =• o
It is evident that conversion form 3's complement to TSD is straightforward by
changing the most significant digit X N_ l to 0,1, or 2, if X N_ l is 0, 1, or 2, while
the remaining digits need not be changed. The conversion from TSD to 3's
complement can also be completed in the carry-lookahead mode. Similarly, a
4's complement number takes the form
N l
X = -X N_ i x 4 ~ + £ .x,. x 4', x te (0, 1, 2, 3}. (9.84)
i = 0
It is also possible to derive a carry-lookahead conversion algorithm from QSD
to the 4's complement number systems.
9.5.2. CONVERSION BETWEEN NSD AND NEGABINARY
NUMBER SYSTEMS
Since negabinary can uniquely encode any positive and negative numbers
without a sign digit and negabinary is a subset of NSD, the input operands
encoded in negabinary can be directly used for NSD operations without any
conversion. We only need to focus on developing a fast-conversion algorithm
from NSD to the normal negabinary [162]. Consider an NSD number X.
represented by
* = 'l *<(-2)', x,.e{T,0,l}. (9.85)
i = 0
Since 1 = 11, Eq. (9.85) can be rewritten as
Xi = I Xi = I
+1
' x,.|(-2)' (9.86)

