truth-table look-up parallel data processing using an optical content-addressable memory

7
Truth-table look-up parallel data processing using an optical content-addressable memory M. M. Mirsalehi and Thomas K. Gaylord The extension of truth-table look-up processing beyond primitive operations (such as addition) to higher- level operations (such as discrete matched filtering) is presented. Use of the residue system and logical minimization techniques to reduce the required number of reference patterns stored in a content-addressable memory is illustrated for 16-bit full-precision addition. Multilevel coding of the numbers is introduced as a method to achieve further truth-table reduction. The required number of reference patterns for implement- ing the residue addition and multiplication operations are provided for all moduli from 2 through 32 with 2-, 3-, and 5-level coding. An optical holographic implementation of a system that processes multilevel coded numbers is presented. 1. Introduction A digital operation can be implemented by (1) con- verting the operation into a sequence of simple calcula- tions that can be realized by logic gates, or (2) reading the output from a memory in which the truth table corresponding to that operation has been previously stored. In spite of the superiority of the latter method in speed and flexibility, it has not been common in the history of data processing. This is mainly due to the large sizes of the memories that are usually needed. Recent technological advances and a growing need for parallel processing have generated renewed interest in the direct implementation of truth-table look-up pro- cessing. There are two methods of implementing a truth table. One method involves storing each output bit in a memory location whose address is determined by the input data. This type of memory is called a location- addressable memory (LAM). In the second method, for each output bit, all the input bit combinations that produce a one in that output bit location are stored. These combinations are known as the reference pat- terns. During the processing step, the input bits are compared to all the stored reference patterns that correspond to each output bit. If a match is detected, that particular output bit is designated to be a one; The authors are with Georgia Institute of Technology, School of Electrical Engineering, Atlanta, Georgia 30332. Received 15 May 1985. 0003-6935/86/142277-07$02.00/0. ) 1986 Optical Society of America. otherwise, it is designated to be a zero. This type of memory is called a content-addressable memory (CAM), and it usually requires less storage than the corresponding LAM. In precise computer engineering terminology, a content-addressable memory and an associative mem- ory have different capabilities. An associative memo- ry allows recall with incomplete or imperfect input information. It also takes into account contextual input information that may be present and usually provides a single output answer. A content-address- able memory, on the other hand, implements a type of associative recall. However, the recall is based on a complete parallel search of all reference patterns stored in the memory. Thus the output can be a parallel array of answers, as opposed to a single output answer as in the case of an associative memory. In general, a content-addressable memory is considered to be a single-input/parallel-output system. With optics, a content-addressable memory can be implemented in a straightforward manner by holo- graphically recording many reference patterns using the large dynamic range associated with volume holo- graphic recording media such as electrooptic crystals. 2 In addition, however, the basic single-input/parallel- output character of a content-addressable memory can be expanded. The lack of angular selectivity in the direction perpendicular to the recording plane of inci- dence of volume holograms 3 allows an entire array of parallel inputs to be processed simultaneously by the same set of holographic gratings. An optical volume holographic content-addressable memory can produce a separate set of parallel outputs for each of the inputs. Therefore, such a memory is capable of performing as a parallel-input/parallel-output system. This, in turn, 15 July 1986 / Vol. 25, No. 14 / APPLIED OPTICS 2277

Upload: thomas-k

Post on 03-Oct-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Truth-table look-up parallel data processing usingan optical content-addressable memory

M. M. Mirsalehi and Thomas K. Gaylord

The extension of truth-table look-up processing beyond primitive operations (such as addition) to higher-level operations (such as discrete matched filtering) is presented. Use of the residue system and logicalminimization techniques to reduce the required number of reference patterns stored in a content-addressablememory is illustrated for 16-bit full-precision addition. Multilevel coding of the numbers is introduced as amethod to achieve further truth-table reduction. The required number of reference patterns for implement-ing the residue addition and multiplication operations are provided for all moduli from 2 through 32 with 2-,3-, and 5-level coding. An optical holographic implementation of a system that processes multilevel codednumbers is presented.

1. Introduction

A digital operation can be implemented by (1) con-verting the operation into a sequence of simple calcula-tions that can be realized by logic gates, or (2) readingthe output from a memory in which the truth tablecorresponding to that operation has been previouslystored. In spite of the superiority of the latter methodin speed and flexibility, it has not been common in thehistory of data processing. This is mainly due to thelarge sizes of the memories that are usually needed.Recent technological advances and a growing need forparallel processing have generated renewed interest inthe direct implementation of truth-table look-up pro-cessing.

There are two methods of implementing a truthtable. One method involves storing each output bit ina memory location whose address is determined by theinput data. This type of memory is called a location-addressable memory (LAM). In the second method,for each output bit, all the input bit combinations thatproduce a one in that output bit location are stored.These combinations are known as the reference pat-terns. During the processing step, the input bits arecompared to all the stored reference patterns thatcorrespond to each output bit. If a match is detected,that particular output bit is designated to be a one;

The authors are with Georgia Institute of Technology, School ofElectrical Engineering, Atlanta, Georgia 30332.

Received 15 May 1985.0003-6935/86/142277-07$02.00/0.

) 1986 Optical Society of America.

otherwise, it is designated to be a zero. This type ofmemory is called a content-addressable memory(CAM), and it usually requires less storage than thecorresponding LAM.

In precise computer engineering terminology, acontent-addressable memory and an associative mem-ory have different capabilities. An associative memo-ry allows recall with incomplete or imperfect inputinformation. It also takes into account contextualinput information that may be present and usuallyprovides a single output answer. A content-address-able memory, on the other hand, implements a type ofassociative recall. However, the recall is based on acomplete parallel search of all reference patternsstored in the memory. Thus the output can be aparallel array of answers, as opposed to a single outputanswer as in the case of an associative memory. Ingeneral, a content-addressable memory is consideredto be a single-input/parallel-output system.

With optics, a content-addressable memory can beimplemented in a straightforward manner by holo-graphically recording many reference patterns usingthe large dynamic range associated with volume holo-graphic recording media such as electrooptic crystals.2In addition, however, the basic single-input/parallel-output character of a content-addressable memory canbe expanded. The lack of angular selectivity in thedirection perpendicular to the recording plane of inci-dence of volume holograms3 allows an entire array ofparallel inputs to be processed simultaneously by thesame set of holographic gratings. An optical volumeholographic content-addressable memory can producea separate set of parallel outputs for each of the inputs.Therefore, such a memory is capable of performing as aparallel-input/parallel-output system. This, in turn,

15 July 1986 / Vol. 25, No. 14 / APPLIED OPTICS 2277

produces the possibility of very high throughput paral-lel computing.

The purpose of this paper is (1) to show the exten-sion of truth-table look-up processing beyond primi-tive operations (such as addition) to more complicatedoperations (such as discrete matched filtering as pre-sented in Sec. II); (2) to show that the multilevel codingof numbers produces further reduction in the truth-table size beyond that obtained using residue numbersystem and logical minimization (Sec. III); (3) topresent the minimum number of reference patternsrequired for residue addition and multiplication for allmoduli from 2 through 32 with 2-, 3-, and 5-level coding(Sec. III); and (4) to show the design of an opticalholographic system for processing multilevel codednumbers (Sec. IV).

II. Characteristics of Truth-Table Look-Up Processing

One advantage of truth-table look-up processing isits flexibility. Any discrete function or operationwhose truth table is known can be implemented by thistechnique. This includes addition, multiplication, di-vision, exponentiation, series evaluation, and other op-erations. As an illustrative example, use of a CAM forimplementing discrete matched filtering is describedhere. Consider a 1-D discrete reference signal g(n) offour units in length defined as g(n) = n for 1 n <4.Assume that it is desired to detect signals similar tog(n). First, all possible input signals are normalized sothat the resulting discrete signals f(n) have energieswith the closest possible values to (but not greaterthan) the energy of the reference signal g(n). Second,the cross-correlations between the normalized signalsf(n) and the reference signal are calculated (Fig. 1). Ifthe two signals are the same, the cross-correlation op-eration becomes an autocorrelation, and a maximumpeak value is produced. If the signals are different,the result will have a lower peak value of its cross-correlation. The height of the peak depends on thesimilarity of the two signals. For the above example,the autocorrelation has a peak value of 30. It might beof interest to detect not only the exact matched patternbut also the patterns that have a high cross-correlationwith the reference pattern (for further inspection). Inthis case, in addition to g(n), these patterns are alsostored in the content-addressable memory. For ex-ample, if patterns of four units in length that produce across-correlation peak equal to or greater than 28 aredesired, twelve reference patterns need to be stored.The output of the system can be represented by a 2-bitnumber. An exact match could be indicated by mak-ing the first bit equal to a one and a mismatch with ahigh cross-correlation peak (28 or 29 in the above ex-ample) could be indicated by making the second bitequal to a one. In the case of a mismatch with a lowcross-correlation peak, both output bits would be zero.Thus all possible input signals can be checked in across-correlation sense using only a few stored refer-ence signals (twelve in the above example). This isrepresentative of truth-table look-up processing: alarge number of calculations are done in advance to

* g

f g 5 -5

n n(a)

n

20-

f95 5 10

0 I 0 0n 0 n

(b)

Fig. 1. Example of discrete matched filtering: (a) input signalf(n)different from the reference signal g(n); (b) input signal same as the

reference signal. The symbol * represents cross-correlation.

construct a relatively small truth table that can then beused repeatedly to perform a calculation on all possiblefuture inputs.

Ill. Truth-Table Reduction

The major problem that faces truth-table look-upprocessing is the large number of reference patternsthat usually need to be stored. This has preventedimplementation of electronic look-up processors ex-cept for moderately simple cases. Although, holo-graphic memory systems with large storage capacitiesexist, the amount of data storage required by CAM's isstill typically larger. For example, to implement thefull-precision addition of two 16-bit numbers with aCAM based on the usual binary number system, a totalof 36,507,189,248 reference patterns are required to bestored. This dramatically exceeds the number of ho-lograms that can be recorded using state-of-the artholographic techniques. Two methods of reducing thenumber of reference patterns that have been used are(1) using the residue number system (RNS)2 and (2)applying logical minimization techniques.4 These arebriefly described in Secs. III. A and B. In Sec. III. C, athird technique, multilevel coding, which has beenrecently proposed5 ,6 is described in detail, and compre-hensive results are presented.

A. Residue Number System

A residue number system is defined by choosing nrelatively prime numbers, ml, m 2, .. , mn, called mod-uli. Any integer X can then be represented as an n-tuple (x1,x2, ... ,xn), where xi = IXlm (read X modulomi) is the least positive integer remainder that is ob-tained from the division of X by mi. For example,consider a four-modulus system with moduli 3, 4, 5 and

2278 APPLIED OPTICS Vol. 25, No. 14 / 15 July 1986

f9 * g

7. In this system, the decimal numbers X = 23 and Y= 14 are represented as X = (2,3,3,2) and Y = (2,2,4,0),respectively. The important feature of RNS is thatfixed-point arithmetic operations can be performed oneach digit individually. For example, the results ofperforming addition and multiplication on the abovenumbers are X + Y = (1,1,2,2) and X Y = (1,2,2,0).These are the residue representations of the correctanswers, i.e., 37 and 322, respectively. For more infor-mation on residue arithmetic, the reader is referred toRefs. 7 and 8.

The fact that the digits of a residue number areindependent of each other results in a number of smalltruth tables rather than a single large truth table.Consequently, the number of reference patterns for aparticular function is significantly reduced by usingRNS. For example, choosing the set of moduli M =14,5,7,9,11,131 and using binary coding to represent thedigits, the number of reference patterns correspondingto full-precision addition of two 16-bit numbers isreduced from 36,507,189,248 to only 694.

B. Logical Minimization

Each reference pattern in a CAM is a combination oftwo input numbers that produce a 1 in a particularoutput bit. As an illustrative example, the simple caseof addition of two 2-bit numbers is considered here.There are eight input combinations (reference pat-terns) that produce a 1 in the first bit (least significantbit) of the output. These are: 0001 (corresponding to00 + 01), 0100, 0011, 0110, 1001, 1100, 1011, and 1110.Similarly, eight reference patterns produce a 1 in thesecond bit, and six reference patterns produce a 1 inthe third (most significant) bit of the output. There-fore, the addition of two 2-bit numbers can be imple-mented by storing 8 + 8 + 6 = 22 reference patterns in acontent-addressable memory.

Each reference pattern can be expressed as a term ina Boolean algebraic expression, and the output bit canbe expressed as the logical sum of these terms. Thelogical expression can be simplified by applying a logi-cal minimization technique such as the Karnaugh mapor the Quine-McCluskey table.9 For example, theabove eight reference patterns can be simplified to twopatterns: X1XO and XOX1, where X represents adon't-care bit, meaning that bit can be either 0 or 1.Similarly, the number of reference patterns corre-sponding to the second and third bit of the output canbe reduced to 6 and 3. Therefore, the total number ofreference patterns can be decreased from 22 to 11. Asystematic procedure for logical minimization is de-scribed in detail in Ref. 10, and the results for binary-coded residue addition and multiplication are provid-ed in Ref. 4.

C. Multilevel Coding

Multilevel coding has been recently shown to pro-vide further reduction in the number of reference pat-terns.56 This encoding technique is described here indetail.

Multilevel coding is an extension of binary coding inwhich more than two levels are used. For example, ifthree-level (ternary) coding is used, the integers zerothrough eight will be represented as 00, 01, 02, 10, 11,12, 20, 21, and 22, respectively. Minimization of mul-tilevel coded reference patterns requires a type of logicdifferent from the commonly used binary logic. Theappropriate logic, known as multiple-valued logic, is anactive area of research today.' Although significantprogress has been made in the theoretical aspects ofmultiple-valued logic, electronic implementations ofthis logic have only recently begun to appear. This ispartly due to the difficulties in realizing multistatedevices and partly due to the significant progress thathas been achieved in the area of binary logic systems.However, as will be shown in the next section, multilev-el coding in optical systems can be implemented aseasily as binary coding.

Minimization techniques in multiple-valued logicare different from those used in binary logic. In bina-ry logic, if two terms are the same in all bit positionsexcept one, they can be combined into one term whichhas a don't-care bit at that location. For example, 100and 101 can be combined as 1OX, where X represents adon't-care bit. In multiple-valued logic, terms can becombined in several ways. For example, in ternarylogic, terms 120, 121, and 122 can be reduced to 12X,where X (herein referred to as a complete-don't-caredigit) represents a digit that can take any possiblevalue (in this case 0, 1, and 2). If one of the aboveterms is absent, the other two can still be combined.For example, the terms 120 and 121 can be reduced to12X01 , where X01 (herein referred to as a partial-don't-care digit) represents a digit with possible values of 0and 1 but not 2.

As the number of entries in a truth table increases,the minimization procedure becomes too complex tobe handled by hand. In the present work, a new algo-rithm'2 was implemented on a computer to performthe minimizations. This algorithm is an extendedversion of the Quine-McCluskey technique that wasrecently introduced.6 The computer-calculated re-sults of the logical minimizations are presented in Ta-ble I for residue addition and multiplication and for allmoduli from 2 through 32. The number of referencepatterns in this table is equal to the number of holo-grams that should be recorded in the optical systemdescribed in the next section. It can be seen that thisparameter significantly decreases if the appropriatelevel of coding is used. In cases where the modulus canbe expressed as M = pn, where p is a prime number andn is a positive integer greater than one, p-level coding isthe best choice. For example, moduli such as 4, 8, 16,and 32 benefit from binary coding. The number ofrequired reference patterns for residue addition corre-sponding to the above moduli are 8, 24, 60, and 136 forbinary coding vs 12,46,158, and 533 for ternary codingand 12, 49, 173, and 539 for 5-level coding. Similarly,moduli such as 9 and 27 benefit from ternary coding.For example, the number of reference patterns forresidue addition corresponding to moduli 9 and 27 are

15 July 1986 / Vol. 25, No. 14 / APPLIED OPTICS 2279

18

16-

11-

12-

10-

8-

6-

2--I4 8 12 16 20 24 28 32

/a)

18-

16-

14 -

- 12 -

B 6 -

4-

4 8 12 16 20 24 28 32

!2MLUS

(b)

4 8 12 16 20 24 28 32

MODMUS

Fig. 2. Effect of coding level on reduction of the number of reference patterns for residue addition. The reduction factor for an n-level codedtruth table is defined as the ratio of the number of reference patterns in the unreduced binary-coded truth table to the number of reference pat-

terns in the logically reduced n-level coded truth table. (a) binary (2-level) coded, (b) ternary (3-level) coded, (c) 5-level coded.

36 and 150 for ternary coding vs 64 and 377 for binarycoding and 60 and 400 for 5-level coding. This signifi-cant reduction in the number of reference patterns isdue to the highly regular structure of the truth tablesthat are produced in these cases. For a modulus that isnot expressible as M = pn, the proper coding level canbe found among its prime factors. The prime factorthat produces the largest contribution to the modulusis usually the best choice. For example, binary codingis appropriate for modulus 12 (= 22 X 3), while modu-lus 18 (= 2 X 32) benefits from ternary coding.

The effect of coding level in reducing the number ofreference patterns is illustrated in Fig. 2 for the case ofresidue addition. The reduction factor used in thisfigure is the ratio of the number of reference patternsin the unreduced binary-coded truth table to the num-ber of reference patterns in the logically reduced n-level coded truth table. The significant effect of thecoding level for moduli that are powers of a primenumber is apparent in this figure. For example, formoduli 4, 8, 16, and 32, large reductions are found ifbinary coding is used. Similarly, large reductions arefound for moduli 9 and 27 if ternary coding is used andfor modulus 25 if 5-level coding is used. Furthermore,for n-level coding, if n is among the prime factors of amodulus, a relatively large reduction may be obtained.For example, for moduli 12, 20, 24, and 28, relativelylarge reductions are found if binary coding is used.Similarly, relatively large reductions are found formoduli 6, 12, 15, 18, 21, 24, and 30 if ternary coding isused and for moduli 10, 15, 20, and 30 if five-levelcoding is used. The corresponding curves for residuemultiplication exhibit similar behavior.

IV. Optical Implementation

A. NAND-Based Processing

The optical implementation described here is amodified version of the NAND-based processor thathas been previously introduced2 and analyzed'3 forbinary data. Changes are made in the modeling andrecording of the reference patterns so that higher cod-ing levels can be implemented. The main advantage

D

E

REFERENCE BITLOCATIONS RB

LSD - 1I/

MSD- -

POSITION 2 /

POSITION 1 - r k

INPUT WORD 1

INPUT WORD 2

REFERENCE BIT-

L

OB

Fig. 3. Schematic diagram of a ternary-coded NAND processorthat implements residue multiplication modulo 6. D, detector; E,electrooptic crystal; L, Fourier transform lens; LSD, least significantdigit; MSD, most significant digit; OB, object beam; RB, reference

beam.

of the NAND-based processor is its capability of oper-ating as a parallel-input/parallel-output system.

A schematic diagram of a ternary-coded NAND-based processor is shown in Fig. 3. The input array isan ON/OFF spatial light modulator, which is composedof three sections corresponding to two input numbersand one reference bit. In the input array, two spatialpositions (pixels) are assigned to each digit of the inputnumbers. The input numbers are coded by makingthese pixels transparent or opaque. If a digit has avalue of 1, it is coded as a transparent pixel at the firstposition. Similarly, a 2 is coded as a transparent pixelat the second position. A 0 is coded as opaque pixels inboth positions. In general, if n-level coding is used,each digit can have any integer values between zeroand n - 1, and it can be positionally coded with n - 1pixels. The input array and crystal are located at thefront and back focal planes of a lens, respectively. As aresult, an exact Fourier transform of the coded inputpattern is obtained at the crystal.

2280 APPLIED OPTICS / Vol. 25, No. 14 / 15 July 1986

18-

16-

14 -

12-

10-

8-

6-

2-

I

B. Recording

To construct a multilevel coded CAM that imple-ments a particular operation, all the input digit combi-nations that produce a nonzero value at an output digitmust be stored. These combinations are known asreference patterns. In the optical NAND-based pro-cessor, the reference patterns are recorded as thickholograms in a photorefractive crystal, such asLiNbO 3 . The recording process for each pattern isaccomplished in three steps. Figure 4 shows the pro-cedure for recording a reference pattern (2110). First,only the positions of the input array that are comple-mentary to the reference pattern are made transpar-ent, and a hologram is recorded. The relative phasebetween the reference beam and object beam in thisrecording is considered the reference phase for theother steps, and it is assigned a value of zero. Then,the phase of one of the beams is shifted by 180°, onlythe positions of the input array that correspond to thereference pattern are made transparent, and a holo-gram is recorded. Finally, only the position of thereference bit is made transparent, and a hologram isrecorded at a relative phase of zero. The exposureperiod for the first two recordings is the same resultingin an amplitude diffraction efficiency of 71 for eachrecorded bit. The reference bit, however, is recordedwith an amplitude diffraction efficiency of Rqia, whereR is the number of nonzero digits in the referencepattern (3 for the 2110 pattern). This is accomplishedby using longer exposure periods for the cases with R>1. A phasor diagram corresponding to the recordedbits in the above example is shown in Fig. 5(a).

All three steps of recording described above are per-formed with the same angle between the referencebeam and object beam. For other reference patterns,the position of the reference beam is changed so thateach pattern is recorded with a different angle betweenthe two beams. When all the reference patterns for aparticular function or operation are recorded, the re-cording process is complete, and the processor is readyto implement that function or operation.

C. Playback (Data Processing)

During the reading process, the input numbers arecoded by making the corresponding pixels transpar-ent. The pixel corresponding to the reference bit isalso made transparent. The light passes through thetransparent pixels and is diffracted by the recordedholograms. The diffracted beams are actually the re-constructed reference beams. Depending on thephase of the recorded bits, these beams add to orsubtract from each other. For each output digit, if theinput pattern matches one of the recorded referencepatterns, the reconstructed beams cancel each other atthe element of the detector array that corresponds tothat pattern. As a result, a dark spot is produced atthe corresponding detector element. This is detectedelectronically, and the proper value is assigned to thecorresponding output digit. If the input pattern is notsimilar to one of the recorded reference patterns, thereconstructed beams do not completely cancel each

(a) (b) Ic)

Fig. 4. Recording procedure for a ternary-coded reference pattern(2110): (a) recording the complementary pattern (122X1 2) at 00relative phase; (b) recording the reference pattern (2110) at 1800relative phase; (c) recording the reference bit at 00 relative phase.

2,1 _-31 4,2

_ 1,1~ 1,2

- 2,2_ 3,2

.-- 4,

R

(a)

1 5 12 19 20 15 7 2

(b)

Fig. 5. (a) Example phasor diagram corresponding to a recordedreference pattern (2110) in a ternary-coded NAND processor. Thelocation of each recorded phasor at the input array is indicated withtwo numbers (m,n). The first number is the digit number (m = 1 forthe least significant digit). The second number specifies a particu-lar position of that digit. The vertical separations between thephasors are artificially made to distinguish the phasors from eachother. (b) Phasor diagram showing possible wave front amplitudesat the detector element corresponding to the above reference pat-

tern. Numbers indicate the degeneracies of the phasors.

other at any of the elements of the detector array. Inthis case, a value of 0 is assigned to that digit. As anillustrative example, the possible output light ampli-tudes at the detector element that corresponds to thereference pattern 2110 are shown in Fig. 5(b). Thenumbers in this figure indicate the degeneracy of eachamplitude. The sum of these is 81, which is the totalnumber of different patterns that can be made by fourternary digits (34 = 81). Only one of these patterns(2110) produces a null at this detector element.

D. Don't-Care Digits

The recording process for different types of don't-care digits is presented in Fig. 6. In the case of acomplete-don't-care digit, the pixels that correspondto that digit are made opaque during all three steps ofrecording [Fig. 6(a)]. As a result, during the reading

15 July 1986 / Vol. 25, No. 14 / APPLIED OPTICS 2281

Table 1. Number of Reference Patterns (Number of Recorded Hologramsin the Optical Processor) Required in a Content-Addressable Memory to

J_1 Implement Residue Addition and Multiplication Using 2-Level, 3-Level, and

(a3)

(b3 )

(C2 )

]I

]1

(c3)

Fig. 6 Recording procedures for patterns with don't-care digits:(a) pattern with a complete-don't-care digit (OOX1); (b) pattern witha partial-don't-care digit of the first type (011X01; (c) pattern with apartial-don't-care digit of the second type (1X1222). The first andthird recordings are performed at 00 relative phase, while the second

is performed at 180" relative phase.

process, the presence or absence of light at those pixelshas no effect on the reconstructed wave front. Due tothe positional coding scheme that has been used torepresent each digit, two types of partial-don't-caredigit should be distinguished. These are: (1) par-tial-don't-care digits that include 0 as an allowed valueand (2) partial-don't-care digits that do not include 0as an allowed value. To record a partial-don't-caredigit of the first type, the pixels that correspond to thedisallowed values of that digit are made transparentduring the first exposure, and the pixels that corre-spond to the allowed values are made opaque during allthe recording steps [Fig. 6(b)]. In the case of a partial-don't-care digit of the second type, the pixels thatcorrespond to the disallowed values are made trans-parent during the first exposure, and the pixels thatcorrespond to the allowed values are made transparentduring the second exposure [Fig. 6(c)].

V. Summary and Discussion

The basic characteristics of optical truth-table look-up processing have been described. It is shown that byrecording the appropriate input patterns, any functionthat can be described by a truth table can be imple-mented by a content-addressable memory. This typeof implementation has the advantage that all the cal-culations are done in advance, and the results are usedto construct the minimized truth table (set of referencepatterns). The optical NAND-based processor oper-ates as a content-addressable memory and makes aparallel comparison of the input numbers with theprestored reference patterns. Using the lack of angu-lar selectivity in the direction perpendicular to therecording plane of incidence allows a parallel array ofinput numbers to be processed. Thus the processorperforms as a parallel-input/parallel-output system.

5-Level Coding

Addition MultiplicationModulus 2-level 3-level 5-level 2-level 3-level 5-level

2 2 2 2 1 1 13 6 6 6 4 4 44 8 12 12 5 8 65 19 18 20 15 15 166 26 16 30 19 11 177 36 37 39 18 28 298 24 46 49 14 32 389 64 36 60 55 30 50

10 64 72 38 58 65 2811 90 89 93 84 85 7812 80 84 103 71 74 8513 116 124 113 115 105 11614 118 138 130 101 138 11915 124 110 74 136 118 6816 60 158 173 44 178 16317 180 158 207 205 175 20718 172 74 221 209 74 22119 224 205 242 266 256 24220 176 223 128 200 277 12521 272 201 270 342 244 29922 260 291 280 308 356 34223 286 309 293 381 360 36124 204 232 318 238 279 36025 343 307 200 494 441 26226 329 291 385 426 453 48527 377 150 400 557 160 52428 311 377 426 393 562 59129 400 403 461 621 640 65230 371 358 350 510 513 37131 350 504 532 780 762 73532 136 533 539 143 806 782

Methods of truth-table reduction were described.The techniques of using residue number system andapplying logical minimization were reviewed. The re-cently introduced technique of using multilevel codingwas presented in detail. It was shown that for moduliexpressible as M = pn, where p is a prime number and nis a positive integer greater than one, n-level coding isthe most efficient scheme. This is due to the signifi-cant reduction in the number of reference patternsthat can be obtained by applying logical minimizationtechniques. In general, the prime factors that divide amodulus can be used to find the optimal coding levelthat corresponds to the minimum number of referencepatterns. The reduction of multilevel coded referencepatterns was described, and the number of referencepatterns required for residue addition and multiplica-tion operations were provided for all moduli 2 through32 and for 2-, 3-, and 5-level coding.

The results presented in Table I were used to studysome practical cases of addition and multiplicationoperations. For each case, the set of moduli and thecoding levels were selected so that the required rangewas covered with a minimum number of referencepatterns. The results are presented in Table II. It isinteresting to note that the number of reference pat-terns for full-precision addition of two 16-bit numbersdiscussed before has now dropped to only 300. The

2282 APPLIED OPTICS / Vol. 25, No. 14 / 15 July 1986

(al} (a2)

(b1) (b2 )

(C1 )

Table II. Optimum Sets of Moduli and Number of Required Reference Patterns N, for Implementing Some Practical Operations with a Content-AddressableMemory with 2-Level, 3-Level, and 5-Level Coding Alloweda

Operation Required range Moduli Corresponding coding levels Covered range Nr

4-bit full precision addition 0-30 3, 4, 5 2 or 3 or 5, 2, 3 0-59 328-bit full-precision addition 0-510 3, 5, 7,8 2 or 3 or 5, 3, 2, 2 0-839 84

12-bit full-precision addition 0-8,190 3, 5, 7, 8, 11 2 or 3 or 5, 3, 2, 2, 3 0-9,239 17316-bit full-precision addition 0-131,070 4, 5, 7, 9, 11, 13 2, 3, 2, 3, 3, 5 0-180,179 30016-bit fixed-point addition 0-65,535 3, 5, 7, 8, 11, 13 2 or 3 or 5, 3, 2, 2, 3, 5 0-120,119 28632-bit fixed-point addition 0-4,294,967,295 5, 7, 9, 11, 13, 16, 17, 19, 23 3, 2, 3, 3, 5, 2, 3, 3, 2 0-5,354,228,879 1001

4-bit full-precision multiplication 0-225 3, 4, 5, 7 2 or 3 or 5, 2, 2 or 3, 2 0-419 428-bit full-precision multiplication 0-65,025 5, 7, 9, 13, 16 2 or 3, 2, 3, 3, 2 0-65,519 212

12-bit full-precision multiplication 0-16,769,025 5, 7, 9, 11, 13, 17, 32 2 or 3, 2, 3, 5, 3, 3, 2 0-24,504,479 56416-bit full-precision multiplication 0-4,294,836,225 5, 7, 9, 11, 13, 16, 17, 19, 23 2 or 3, 2, 3, 5, 3, 2, 3, 5, 3 0-5,354,228,879 106716-bit fixed-point multiplication 0-65,535 3, 5, 7, 8, 11, 13 2 or 3 or 5, 2 or 3, 2, 2, 5, 3 0-120,119 23432-bit fixed-point multiplication 0-4,294,967,295 5, 7, 9, 11, 13, 16, 17, 19, 23 2 or 3, 2, 3, 5, 3, 2, 3, 5, 3 0-5,354,228,879 1067

a The corresponding coding level(s) shown for each modulus is (are) determined from Table I so that the number of reference patterns isminimized. For each operation the required range of numbers and the range of numbers covered by the selected moduli are given.

number of reference patterns in this table is equal tothe number of holograms and also to the number ofelements of the output photodetector array in the opti-cal implementation described. These numbers arewithin the range of the previously reported number ofholograms recorded in an electrooptic crystal.14

References1. T. Kohonen, Associative Memory-A System-Theoretical Ap-

proach (Springer-Verlag, Berlin, 1977).2. C. C. Guest and T. K. Gaylord, "Truth-Table Look-Up Optical

Processing Utilizing Binary and Residue Arithmetic," Appl.Opt. 19, 1201 (1980).

3. H. J. Gallagher, T. K. Gaylord, M. G. Moharam, and C. C. Guest,"Reconstruction of Binary-Data-Page Thick Holograms for anArbitrarily Oriented Reference Beam," Appl. Opt. 20, 300(1981).

4. C. C. Guest, M. M. Mirsalehi, and T. K. Gaylord, "ResidueNumber System Truth-Table Look-Up Processing-ModuliSelection and Logical Minimization," IEEE Trans. Comput. C-33, 927 (1984).

5. M. M. Mirsalehi and T. K. Gaylord, "Multi-level Coded Resi-due-Based Content-Addressable-Memory Optical Computing,"in Technical Digest, Topical Meeting on Optical Computing(Optical Society of America, Washington, D.C., 1985), paper

WB1.6. M. M. Mirsalehi, "Optical Digital Parallel Truth-Table Look-

Up Processing," Ph.D. Thesis, Georgia Institute of Technology,Atlanta (1985).

7. N. S. Szabo and R. I. Tanaka, Residue Arithmetic and ItsApplications to Computer Technology (McGraw-Hill, NewYork, 1967).

8. H. L. Garner, "The Residue Number System," IRE Trans. Elec-tron. Comput. EC-8, 140 (1959).

9. e.g., S. Muroga, Logic Design and Switching Theory (Wiley,New York, 1979).

10. T. K. Gaylord and M. M. Mirsalehi, "Truth-Table Look-UpProcessing: Number Representation, Multilevel Coding, andLogical Minimization," Opt. Eng. 25, 22 (1986).

11. D. C. Rine, Ed., Computer Science and Multiple- Valued Logic(North-Holland, Amsterdam, 1977).

12. M. M. Mirsalehi and T. K. Gaylord, "Logical Minimization ofMultilevel Coded Functions," Appl. Opt. 25 (1986).

13. M. M. Mirsalehi, C. C. Guest, and T. K. Gaylord, "ResidueNumber System Holographic Truth-Table Look-Up Process-ing: Detector Threshold Setting and Probability of Errordue to Amplitude and Phase Variations," Appl. Opt. 22, 3583(1983).

14. D. L. Staebler, W. J. Burke, W. Phillips, and J. J. Amodei,"Multiple Storage and Erasure of Fixed Holograms in Fe-dopedLiNbO 3 ," Appl. Phys. Lett. 26, 182 (1975).

0

15 July 1986 / Vol. 25, No. 14 / APPLIED OPTICS 2283