Performing arithmetic operations on data

Abstract: Arithmetic operations are performed on composite operands that include plural component data items. The operations obtain valid results even though the operations would ordinarily produce inter-component signals, such as carry or borrow signals or a shifted bit, causing invalid results. For example, the component data items can be pixel values or other data relating to pixels in an image. Instructions on a storage medium (62) can be accessed and executed by a processor (66) to obtain valid results despite inter-component signals. Or special circuitry, such as gating circuitry or a mask register, can be used to prevent inter-component signals. Components in composite operands can be separated by buffer bits that are cleared or set to ensure valid results. Values of components can be biased before an operation to obtain valid results.

Description: The present invention relates to techniques for performing arithmetic operations on data. Wilson, US-A 5,129,092 ("Wilson '092"), describes techniques for processing data matrices such as images and spatially related data using neighborhood processing units. As shown and described in relation to Figs. 1 and 2, the processing units form an array with several groups of eight processing units. Each processing unit's connections to its adjacent processing units to the immediate left and right in the array include a carry in line to its left and a carry out line to the right. Wilson '092 describes arithmetic operations beginning at col. 12 line 40. In bit serial arithmetic, a carry signal from a carry flip-flop is passed to multiplexers, one of which acts as a truth table for a carry propagate value, which is stored in flip-flops, provided to an output selector, and can be read back to memory. In parallel arithmetic, a carry input from a processing unit to the immediate left is obtained and a carry output propagates to a processing unit to the immediate right. When performing parallel arithmetic operations, care must be used in writing algorithms in order to avoid overflow, so that carry signals will not accidentally propagate from one data word to the next, since many data words are on the same line of bits. Mahoney, EP-A 460 970, describes techniques for operating on a body of data such as data defining an image. Fig. 7 shows a Connection Machine system that performs image processing by simulating a binary image jungle (BIJ). A front end processor can make calls to cause processing units in the Connection Machine to perform arithmetic and logical operations. Fig. 8 illustrates a part of an array of processing units in a Connection Machine, with a processing unit storing a pixel value of an image at a lowest level of a BIJ and receiving a pixel value from another processing unit at the next higher level of the BIJ. As described at page 20 lines 15-28 in relation to Fig. 10, each processing unit operates on the results from the next lower level of its first and second children. Figs. 13 and 14 each show a sequence of data item arrays in which sums of pixel values are obtained. As described in relation to Fig. 18, each processing unit's local memory can contain a respective pixel's value. EP-A-0 464 601 discloses an arithmetic operation system in which a carry control indication register stores carry control information for each of a plurality of cascaded arithmetic units. Each arithmetic unit includes a carry controller that receives a carry control bit from the carry control indication register and, based on the carry control bit, modifies an output carry from the arithmetic unit before it is supplied to the adjacent more significant bit arithmetic unit. The system can be partitioned into fields at arbitrary positions. EP-A-0 486 143 discloses techniques for parallel processing of data in which, before processing, operands are packed into a word with at least one cleared buffer bit between each operand. The buffer bit is cleared before any arithmetic or logical operation involving signed arithmetic and again before evaluating results. This prevents propagation of a signed bit from flowing into bits of another operand's result. It is the object of the present invention to provide a method of operating a processor to perform arithmetic operations with high processing speed. This object is solved by subject matter of claim 1. Preferred embodiments of the present invention are the subject matter of the dependent claims. Some operations, referred to herein as "logic operations," obtain one result bit using each operand bit. Therefore, a logic operation produces valid results when performed in parallel on a composite operand that includes a plurality of component data items. Examples include NOT, AND, OR, and XOR. In contrast, ordinary arithmetic operations can obtain a result with more bits than the values on which the operations are performed. For example, adding two K-bit values can produce a (K + 1)-bit result because of a carry signal. Subtracting one K-bit value from another that is smaller can result in a borrow signal to the (K + 1)th bit. Multiplying two K-bit values can produce a 2K-bit result. And division can sometimes produce an unlimited number of bits if not truncated at some level of precision. Because results of greater widtn could be produced, conventional processors cannot perform ordinary arithmetic operations in parallel on composite operands that include plural component data items such as pixel values. An operation on one component may produce an inter-component signal, such as a carry signal, a borrow signal, or a shift, that propagates or overflows into the next component, invalidating the result obtained from the next component. If the components are bits, logic operations can be used rather than arithmetic operations to solve this problem. But if the components contain more than one bit, logic operations cannot satisfactorily replace arithmetic operations. The invention strives to provide improved techniques that perform arithmetic operations in parallel on composite operands that include plural multi-bit component data items. For example, each component could relate to a pixel of an image; the components can be gray scale or color pixel values. Although the arithmetic operations would ordinarily produce signals between components, referred to herein as "inter-component signals," that would cause invalid results, the techniques of the invention produce valid results. Some techniques use a processor with special circuitry that can prevent inter-component signals. Others, which can use a conventional processor, obtain valid results of an arithmetic operations despite inter-component signals. Each technique that can use a conventional processor can be implemented in an article of manufacture The article includes a data storage medium and instruction data stored by the data storage medium, which could be a magnetic storage medium, an optical storage medium, a semiconductor memory, or other memory medium. The article can be used in a system that includes memory, a storage medium access device, and a processor. The memory stores multi-bit data items, such as data relating to pixels of an image. The instruction data indicate instructions a processor can execute to perform an arithmetic operation in parallel on a composite operand that includes more than one of the multi-bit data items. The instructions ensure that the results obtained are valid despite inter-component signals. The instruction data can be, for example, code that can be executed by a microprocessor such as the CPU of a conventional workstation or other computer. One special circuitry technique uses a processor with gating circuitry that can be used to control transfer of signals between component data items. This technique can use conventional microprocessors if the maximum component width is an integer multiple of the microprocessor width. Another special circuitry technique uses a processor with a mask register connected to the processing circuitry. The mask register could be loaded with an allow value, such as ON, in bit positions that are allowed to receive inter-component signals from the next lower bit positions. The mask register could be loaded with a prevent value, such as OFF, in bit positions that are not allowed to receive inter-component signals from the next lower bit positions. The mask register could be loaded each time component width changes, allowing many component widths. Also, for operations on data other than composite operands, the mask register can be loaded with values that permit inter-component signals to propagate freely. One technique that can use a conventional processor uses one or more buffer bits between each pair of adjacent component data items. For example, a buffer bit could be annexed to every component, above its most significant bit or below its least significant bit. Or, if precision can be sacrificed, the least significant bit of each component could be a buffer bit. The values of the buffer bits can then be manipulated to prevent or compensate for inter-component signals. An addition operation can clear all buffer bits before adding composite operands. For example, if the operation adds pairs of components, each composite operand can be ANDed with a mask having an OFF value in each buffer bit and an ON value elsewhere. If the operation adds a constant to every component, a constant operand can be formed by replicating the constant separated by buffer bits that have an OFF value. A subtraction operation can use a buffer bit above each component's most significant bit. To ensure valid results, each buffer bit in a composite minuend can have ON values and each buffer bit in a composite subtrahend can start with an OFF value. In effect, the buffer bits ensure that each component of the minuend has a value exceeding the aligned component of the subtrahend. As a result, a borrow signal cannot propagate to the next component's result. Multiplication and division can be implemented with addition and subtraction, together with shifting and logic operations using masks. The buffer bits can be used to generate the masks. The buffer bit technique can also be implemented using special circuitry that inserts buffer bits between component data items. Another technique that can use a conventional processor can be used to reduce or eliminate buffer bits for certain arithmetic operations. This technique prepares composite operands for an addition operation by adjusting values indicated by component data items. For example, if it can be predicted that a certain component's value will cause an inter-component carry signal, the component adjacent its most significant bit can be adjusted by subtracting one from it prior to the operation, so that the inter-component carry signal has no effect. The techniques of the invention are advantageous because they provide a range of alternatives, each of which is useful in appropriate situations. Each technique can ensure that inter-component signals do not invalidate results of an arithmetic operation performed in parallel on composite operands with plural multi-bit component data items such as pixel values. In addition, some of the techniques can be used together in certain situations. As a result of the invention, arithmetic operations on multi-bit component data items can be performed rapidly and efficiently in many situations. The present invention will be described further, by way of example, with reference to the accompanying drawings, in which:- Fig. 1 is a schematic diagram showing how a valid result of an arithmetic operation on each component of a composite operand can be obtained even though the operation would ordinarily produce an inter-component signal causing an invalid result; Fig. 2 is a schematic block diagram showing components of a system in which a processor can execute instructions from a software product to obtain valid results of an arithmetic operation despite inter-component signals; Fig. 3 is a schematic block diagram showing a processor that includes inter-component prevent circuitry that can prevent inter-component signals; Fig. 4 is a flow chart showing acts by which a processor can obtain valid results despite inter-component signals; Fig. 5 is a schematic circuit diagram showing gating circuitry implementing the inter-component prevent circuitry of Fig. 3; Fig. 6 is a schematic circuit diagram showing mask register circuitry implementing the inter-component prevent circuitry of Fig. 3; Fig. 7 is a schematic flow diagram showing an addition operation and a subtraction operation, each implementing the acts in Fig. 4; and Fig. 8 is a flow chart showing a biasing approach that implements the acts in Fig. 4. The term "composite operand" used below is an operand that includes two or more data items, referred to as "component data items" or "components." A processor or other circuitry performing an arithmetic operation on a composite operand may produce an "inter-component signal." An inter-component signal is a signal like a carry signal, a borrow signal, or a shifted bit that may cause an operation on one component to affect results obtained for another component. An arithmetic operation "would ordinarily produce an inter-component signal from a component data item" if the operation performed according to ordinary arithmetic produces an inter-component signal whose effect extends outside the component data item. Adding one to a two-bit component data item with the value 11, for example, would ordinarily produce an inter-component carry signal affecting the next bit to the left. A. General Features Figs. 1-4 illustrate general features of the invention. Fig. 1 shows schematically a technique that obtains a valid result of an arithmetic operation performed in parallel on multi-bit component data items. Fig. 2 shows a software product with instruction data indicating instructions a processor can perform in accordance with a technique like that in Fig. 1. Fig. 3 shows general features of a processor with inter-component prevent circuitry to prevent transfer of inter-component signals between processing positions. Fig. 4 shows general acts in a method of operating a processor to obtain valid results despite an inter-component signal. In Fig. 1, composite operand 10 includes component data items 12 and 14, each including two bits. Component 12 has the value 01, while component 14 has the value 10. Similarly, composite operand 20 includes components 22 and 24, with the respective values 01 and 10. Components 12 and 22 can occupy the same bit positions and components 14 and 24 similarly can occupy the same bit positions The most significant bits of components 12 and 22 can be adjacent respectively to the least significant bits of components 12 and 22. Therefore, when a processor performs an arithmetic operation adding operand 10 to operand 20, components 12 and 22 are added and components 14 and 24 are added. An ordinary arithmetic operation of addition performed on composite operands 10 and 20 by a conventional processor can produce result 30. As shown, result 30 includes data items 32 and 34, with the values 11 and 00 respectively. The "1" values in data item 32 both result from carry signals, carry signal 36 from the most significant bit of components 14 and 24 and carry signal 38 from the least significant bit of components 12 and 22. As can be seen, however, carry signal 36 causes an invalid result in data item 32, because the sum of 01 and 01 is 10, not 11. In order to avoid invalid result 30, the processor can instead produce valid result 40, in which data items 42 and 44 have the values 10 and 00 respectively. Various specific techniques for producing a valid result where an inter-component signal would ordinarily lead to an invalid result are set forth below. Fig. 2 shows software product 60, an article of manufacture that can be used in a system that includes components like those shown in Fig. 2. Software product 60 includes data storage medium 62 that can be accessed by storage medium access device 64. Data storage medium 62 could, for example, be a magnetic medium such as a set of one or more floppy disks, an optical medium such as a set of one or more CD-ROMs, semiconductor memory, or any other appropriate medium for storing data. Data storage medium 62 stores data that storage medium access device 64 can provide to processor 66, which could for example be a microprocessor. Processor 66 is connected for receiving data from input circuitry 70. The data could be obtained from any appropriate source, such as a facsimile (fax) machine; a scanner, which could be the scanner of a digital copier or an input/output device of a computer; an editor, which could be a forms editor or other interactive image editor controlled by user input devices such as a keyboard and mouse or a pen- or stylus-based input device; or a network, which could be a local area network or other network capable of transmitting data. The data could relate to an image. Processor 66 is also connected for providing data to output circuitry 80. The data could in turn be provided to a fax machine, a printer, a display, or a network. The printer could be the printer of a digital copier or an input/output device of a computer. In addition to data storage medium 62, software product 60 includes data stored by storage medium 62. The stored data include instruction data indicating arithmetic operation instructions 90. Processor 66 can execute instructions 90 to perform an arithmetic operation on a composite operand that includes a plurality of component data items. Processor 66 can obtain the component data items on which the arithmetic operation is performed by accessing memory 92. Each item of data can, for example, relate to a pixel of an image. The items of data can each include more than one bit. The data stored by storage medium 62 could also include data indicating instructions processor 66 can execute to store data items received from input circuitry 70 in memory 92, to retrieve data items from memory 92 for an arithmetic operation or to be provided to output circuitry 80, or to store data items resulting from an arithmetic operation in memory 92. Processor 66 includes processing circuitry 94 with plural processing positions 96. Processor 66 could, for example, be a conventional microprocessor. Each of processing positions 96 can perform an operation on one bit. Processing circuitry 94 includes position connecting circuitry 98 connecting processing positions 96 in pairs to form an array. A signal from one processing position in a pair can be transferred by position connecting circuitry 98 to the other processing unit. Each component data item in a composite operand on which an arithmetic operation is being performed can be in a respective subarray of processing positions 96. Processor 66 can execute arithmetic operation instructions 90 to obtain a resulting data item in each component's subarray. During execution of arithmetic operation instructions 90, the subarray of a first component provides an inter-component signal to position connecting circuitry 98. The inter-component signal is capable of causing the arithmetic operation to obtain a resulting data item indicating an invalid result in the subarray of a second component. Processor 66, in executing arithmetic operation instructions 90, acts to ensure that the resulting data item in the second component's subarray indicates a valid result of the arithmetic operation on the second component, despite the inter-component signal. Fig. 3 shows general components of a processor 100. Processing circuitry 102 can perform arithmetic operations in parallel on composite operands. Like processing circuitry 94 in Fig. 2, processing circuitry 102 has plural processing positions 104. Each of processing positions 104 can perform an operation on one bit. Processing circuitry 102 includes position connecting circuitry 106 connecting processing positions 104 in pairs to form an array. A signal from one processing position in a pair can be transferred by position connecting circuitry 106 to the other processing unit. Processor 100 is not, however, a conventional microprocesor. Inter-component prevent circuitry 110 is connected so that it can prevent transfer of signals between processing positions 104 through position connecting circuitry 106. Control circuitry 112 is connected to provide control signals to processing circuitry 102 and inter-component prevent circuitry 110. The control signals cause processing circuitry 102 to perform an arithmetic operation in parallel on a composite operand that includes plural multi-bit component data items. For example, each component data item can relate to a pixel of an image. Each component is in a respective subarray of processing positions 104. Processing circuitry 102 performs the arithmetic operation on each component to obtain a resulting data item in each component's subarray. During performance of the arithmetic operation, the subarray of a first component provides an inter-component signal to position connecting circuitry 106. The inter-component signal is capable of causing the arithmetic operation to obtain a resulting data item indicating an invalid result in the subarray of a second component. The control signals also cause inter-component prevent circuitry 110 to prevent transfer of the inter-component signal by position connecting circuitry 106. As a result, the resulting data item in the second component's subarray indicates a valid result of the arithmetic operation on the second component. Fig. 4 shows general acts in a method of operating a processor with processing circuitry like processing circuitry 94 in Fig. 2. The act in box 130 provides a composite operand to processing circuitry 94, with each component being provided to a respective subarray of processing positions 96. The act in box 132 operates processing circuitry 94 to perform an arithmetic operation in parallel on the composite operand to obtain a resulting data item in each subarray. During performance of the arithmetic operation, the subarray of a first component provides an inter-component signal. The act in box 132 is performed so as to ensure that each resulting data item indicates a valid result despite the inter-component signal. B. Implementations The general features described above in relation to Figs. 1-4 could be implemented in many different ways with a wide variety of components and with various operations. For example, some of the general features described above have been implemented with conventional processors while others could be implemented with specially designed processors. Figs. 5 and 6 illustrate two implementations of the general components shown in Fig. 3. Figs. 7 and 8 illustrate two implementations of the general steps shown in Fig. 4 that are applicable for processing units that can operate in parallel on more than one data item; a number of such processing units could be used in parallel without position connecting circuitry between them. 1. Gating Circuitry Fig. 5 illustrates an implementation of the general components described in relation to Fig. 3 that can employ conventional microprocessors in processing circuitry 102. The implementation in Fig. 5 includes inter-component prevent circuitry 110 that can prevent an inter-component signal between the microprocessors. Therefore, if each microprocessor is M bits wide, where M ≥ 1, the array of processing positions can be divided into subarrays at any integer multiple of M bits. Each subarray can then perform arithmetic operations on component data items. Fig. 5 shows microprocessor 150, the pth microprocessor in an array of microprocessors that provides processing positions 104. Within the array, position connecting circuitry 106 connects the carry in and carry out leads of adjacent microprocessors. As shown, however, the carry in lead of microprocessor 150 receives a signal from the carry out lead of the ( p - 1)th microprocessor only if a carry select signal is provided to AND gate 152. Similarly, a signal from the carry out lead of microprocessor 150 is provided to the ( p + 1)th microprocessor only if a carry select signal is provided to AND gate 154. Width-to-select decoder 156 can be a read only memory (ROM), programmable array logic (PAL), or other conventional circuitry that responds to a signal from control circuitry 112 by providing carry enable signals to the appropriate AND gates so that carry signals can be transferred within a subarray but not between subarrays of different component data items. The signal from control circuitry 112 can indicate a subarray width, such as M, 2M, 3M, and so forth, and the output from width-to-select decoder 156 can accordingly be ON for AND gates within a subarray and OFF for AND gates between subarrays. To perform an operation on an array-wide value, which is useful for tasks that tend to generate large numbers such as pixel counting, the signal from control circuitry 112 can indicate a width such that the output from width-to-select decoder 156 provides an ON output to all AND gates. 2. Mask Register Fig. 6 illustrates another implementation of the general components described in relation to Fig. 3 that can employ a customized arithmetic logic unit (ALU) 170. The implementation in Fig. 6 includes inter-component prevent circuitry that can prevent an inter-component signal between any two adjacent processing positions within ALU 170. Therefore, if ALU 170 is M bits wide, the array of processing positions can be divided into equal subarrays at any integer factor of M bits. Each subarray can then perform arithmetic operations on component data items. Processing position 172 is the pth position in processing positions 104 within ALU 170. Within the array, position connecting circuitry as in Fig. 3 connects carry in and carry out leads of adjacent processing positions. As shown, however, the carry in lead of position 172 receives a signal from the carry out lead of the ( p - 1)th position through position connecting logic 174. Similarly, the carry out lead of position 172 provides a signal to the carry in lead of the ( p + 1)th position through position connecting logic 176. Position connecting logic 174 provides a carry in signal from the ( p - 1)th position only if an ON value is provided to the other input lead of AND gate 180, so that the signal is provided to the carry in lead of position 172 through OR gate 182. When the mask register provides an OFF signal to AND gates 180 and 184, the carry in lead of position 172 receives an ON signal only if the subtract signal to AND gate 184 is ON. Position connecting logic 176 includes similar circuitry. Mask register 190 can be implemented with conventional register circuitry that can be loaded with mask values by signals from control circuitry 112. The mask values include enable values, illustratively ON, and prevent values, illustratively OFF. Mask register 190 is connected so that each mask value is provided to AND gates that control the carry in line of a respective position like AND gates 180 and 184. Mask value 192 controls the carry in line of the (p - 1)th position, mask value 194 the carry in line of the p th position, and mask value 196 the carry in line of the ( p + 1)th position. In general, an enable value allows a carry out signal from the next lower position to propagate upward, while a prevent value prevents upward propagation of carry out signals. But during a subtraction operation, a prevent value provides a carry in signal even if the next lower position is not providing a carry out signal, as required by the standard implementation of two's complement arithmetic. Control circuitry 112 can load mask register 190 each time the number of bits in each component data item changes. For instance, if the component data items are pixel values, mask values can be changed whenever the number of bits in each pixel value changes. In the illustrated example, mask value 192 controls the uppermost processing position of one component's subarray, while mask value 194 controls the lowermost processing position of an adjacent component's subarray, which is position 172. Each of the above implementations employs special circuitry. In contrast, the following implementations do not require special circuitry, but may use processing positions less efficiently than the above implementations due to additional bits such as buffer bits. 3. Buffer Bits Fig. 7 is a flow diagram illustrating two implementations of the general acts described in relation to Fig. 4 that employ extra bits, called buffer bits, between component data items. The first implementation, illustrated by operands 200 through 250, performs an addition operation, the second, illustrated by operands 250 through 300, performs a subtraction operation. Composite operand 200 includes a plurality of component data items. As shown, components 202 and 204 are adjacent to each other within operand 200. A spread operation can be performed on operand 200 to obtain composite operand 210. Operand 210 includes component 212 with the same value as component 202 and component 214 with the same value as component 204. In addition, operand 210 includes buffer bit 216 between components 212 and 214. In general, any spread operation can be used that uses a composite operand to obtain another composite operand that includes one or more buffer bits between adjacent component data items. For example, a spread operation could be implemented using spreading circuitry. The number of buffer bits could be large enough to ensure that the resulting data item produced in each component's subarray would not affect an adjacent subarray, but this may be inefficient. For maximum efficiency, the number of buffer bits should preferably be kept at a minimum. If an M-bit microprocessor is being used, for example, and each component data item includes ((M/n) -1) bits or less, where n is an integer, then n components can be included in one M-bit composite operand if one buffer bit can be inserted at or adjacent the least significant bit or at or adjacent the most significant bit of every component data item. In these cases, all arithmetic can be done MOD 2 n - 1 . If buffer bits are inserted by spreading components, range and resolution of component values are preserved but additional processing positions are used for buffer bits. If buffer bits replace least significant bits of components, precision or resolution of component values is sacrificed. If buffer bits replace most significant bits, the range of component values is reduced by half. In addition, a buffer bit at or adjacent the most significant bit may conveniently be used to indicate a binary result of an arithmetic operation for a pixel, as described in the copending, concurrently filed European Patent Application EP-A-0 602 887. If each component data item includes more than ((M/n) -1) but not more than (M/n) bits, and if some precision can be sacrificed, then n component data items can be included in one M-bit composite operand if the least significant bits of some or all components are used as buffer bits. In this case, arithmetic operations are performed on even numbers only. Before an addition operation that adds aligned components in two composite operands, each buffer bit in both operands should be cleared to zero to prevent propagation of carry signals from one component's subarray to another's. Therefore, operand 210 is ANDed with operand 220, a mask operand that is ON in every bit position in a component's subarray and is OFF in every buffer bit position, as shown by bit 222. The AND operation produces composite operand 230, with component 232 having the same value as component 212 and with component 234 having the same value as component 214. Buffer bit 236 has the value zero. The addition operation adds composite operand 230 to composite operand 240, the relevant part of which is illustratively shown as identical to operand 230, with components 242 and 244 the same as components 232 and 234 and with buffer bit 246 the same as buffer bit 236. Operand 240 could be obtained by copying operand 230 or could be obtained by acts similar to those described above. If a constant was being added to each component in a composite operand, the constant operand could be obtained starting with an all-zero operand with which the constant could be ORed at the position of each component's subarray. Addition of operands 230 and 240 produces composite operand 250, with a resulting data item in each component's subarray Resulting data item 252 indicates a valid result of adding components 232 and 242, while resulting data item 254 indicates a valid result of adding components 234 and 244. Buffer bit 256 has the value one because of carry signal 258 received from the subarray in which components 234 and 244 are added, but buffer bit 256 has ensured that resulting data items 252 and 254 indicate valid results. If another addition were performed, buffer bit 256 would be cleared again before adding. Operands 200 through 250 thus illustrate an implementation of the acts in Fig. 4. Operands 200, 210, 230, and 240 illustrate how each component data item is provided to a subarray. Operands 230, 240, and 250 illustrate how an arithmetic operation is performed in parallel to obtain valid results despite an inter-component signal, carry signal 258. A two's complement subtraction operation can be implemented by inverting a subtrahend and adding to it a minuend plus a carry to produce a difference between the minuend and the subtrahend. Therefore, to obtain a valid result for each component, it is necessary to add a carry into each resulting data item. This can be done using buffer bits, provided that the buffer bits in both the minuend operand and the inverted subtrahend operand have the value one, so that they are certain to produce a carry signal to the next subarray. In Fig. 7, composite operand 250 is the minuend operand, but it may have zeros in some buffer bits. Therefore, to prepare it for a subtraction operation, it is ORed with operand 260, a mask operand that is OFF in every bit position in a component's subarray and is ON in every buffer bit position, as shown by bits 262 and 264. Mask 260 can be seen to be the complement of mask 220. An implementation can store one of the two masks, inverting as required to obtain the other. The OR operation produces composite operand 270, with component 272 having the same value as component 252 and with component 274 having the same value as component 254. Buffer bits 276 and 278 have the value one. Composite operand 280 is the subtrahend, illustratively obtained by ORing a constant 11 with each subarray in an all-zero operand, so that constant data items 282 and 284 each have the value 11 and buffer bits 286 and 288 each have the value zero. The subtrahend must be obtained such that all buffer bits have the value zero. Then, operand 280 is inverted to obtain operand 290, in which constant data items 292 and 294 each have the value 00 and buffer bits 296 and 298 each have the value one. The inversion operation is conventionally performed by an arithmetic logic unit (ALU) as part of a two's complement subtraction operation so it need not be implemented in code. An addition operation then adds operand 270 to operand 290 to obtain operand 300, with a resulting data item in each subarray. Resulting data item 302 indicates a valid result of subtracting constant data item 282 from component 252 because of carry signal 304, while resulting data item 306 indicates a valid result of subtracting constant data item 284 from component 254 because of carry signal 308. Operands 250 through 300 thus illustrate an implementation of the acts in Fig. 4. Operands 250, 270, 280, and 290 illustrate how each component data item is provided to a subarray. Operands 270, 290, and 300 illustrate how an arithmetic operation is performed in parallel to obtain valid results despite inter-component signals, carry signals 304 and 308. As described in copending, concurrently filed European Patent Application EP-A-0 602 886, multiplication and division operations can also be performed using buffer bits together with techniques that produce masks. 4. Biasing Fig. 8 illustrates another implementation of the general acts described in relation to Fig. 4 that biases values of component data items. This implementation depends on constraints applied to values of composite operands. The act in box 350 receives input values. These values are constrained to positive numbers with no more than q bits, so that they can range from 0 to 2 q . The implementation shown in Fig. 8 performs an arithmetic operation that adds a stored value, such as a value from a table, to each input value, and the stored values are similarly constrained to positive or negative numbers with no more than r bits, ranging between ± (2 r -1 - 1). If q = r = 4, for example, input values can range from zero to 15 while stored values can range from - 7 to + 7. In this example, the arithmetic operation can obtain values ranging from - 7 to + 22. In general, an arithmetic operaion that adds a stored value to an input value can obtain values ranging from - n to + m where n and m are positive integers. The act in box 352 forms a composite operand with a subarray for each input value. All subarrays can be of the same length, which must exceed log 2 ( n + m). The act in box 354 biases the components by adding n to the value in each subarray, ensuring a non-negative result when a stored value is added to the subarray. The act in box 356 then adds a stored value to each subarray, obtaining values that can range from zero to (n + m ). The stored values added by the act in box 356 must be adjusted to ensure that carry signals do not lead to invalid results. In the example set forth above, the adjustment can be done by scanning the stored values to be added to the composite operand leftward from the least significant end to the most significant end. If a stored value is less than zero, as indicated by a one in its most significant bit, one is subtracted from the next stored value to the left. This procedure is effective because each negative stored value would produce a carry signal while none of the non-negative stored values would. As a result of this adjustment, the carry signals produced by adding negative stored values lead to valid results. The act in box 358 then adjusts the results from box 356. The act in box 358 could, for example, subtract n from each subarray, reversing the act in box 354. As a result, each subarray would include a valid result of adding an input value received in box 350 to a stored value prior to the adjustment referred to in box 356. The subtraction in box 358 could be done in more than one way. One way would be to handle each subarray separately; the value in each subarray could be used to access a lookup table to obtain another value reduced by n from the value in the subarray. Another way would be to provide a lookup table for the result from box 356. Other adjustments could be made as desired, to truncate or otherwise obtain data suitable for subsequent operations. The implementation of Fig. 8 would be useful for adding entries from a table, as in dithering pixel values. It could be extended for use in other situations. C. Applications The general implementation features described above could be used in a wide variety of data processing applications. They are expected to be particularly useful, however, in performing some types of image processing more rapidly than they could be performed serially on each component data item. In particular, the features described above could be used to implement techniques similar to those described in Serra, J., Image Analysis and Mathematical Morphology, Academic Press, 1982 and Serra, J., Image Analysis and Mathematical Morphology, Volume 2: Theoretical Advances, Academic Press, 1988. Such techniques may be used, for example, to provide document services, such as removal of noise or other non-informative features, skew correction, data encoding, extraction of segments for automatic form or control sheet creation, and printer specific correction. Such document services can be used in digital copying machines, including fax machines and photocopying machines, in machines that produce data defining an image for a printer or other image output device, in machines that operate on data defining an image received from a scanner or other image input device, and in other machines that perform image processing. The features described above can be used to perform arithmetic operations on gray scale or color pixel values during a wide variety of image processing operations. The general implementation features described above may also be useful in various other applications, such as searching an image database for images containing a particular set of features; scanning envelopes for addresses; interpreting forms from a high-speed scanner; machine vision; and process-specific print image correction and verification. The invention could also be applied to perform various other image processing operations, such as pixel counting, gray scale morphology, gray scale rotation, generating error-diffused images, and skew detection. The invention could also be used with data that does not relate to an image. The invention could be used, for example, to perform finite difference analysis or simulations of physical phenomena. D. Miscellaneous The invention has been described in relation to several implementations. The invention might also be implemented by using two or more of the implementations together. The invention has been described in relation to implementations in which component data items in an composite operand are separated by single buffer bits. The invention could also be implemented with plural buffer bits between component data items. The invention has been described in relation to inter-component prevent circuitry that includes gating circuitry or a mask register The invention might also be implemented with other types of inter-component prevent circuitry. If used with a processor that provides carry look-ahead signals or other such signals, the inter-component prevent circuitry could also prevent such signals from causing invalid results. The invention has been described in relation to addition and subtraction, but could be applied to other arithmetic operations, including multiplication, division, and threshold convolution, as described in copending, concurrently filed European Patent Application EP-A-0 602 886. The invention has been described in relation to implementations that operate on data relating to images, but might also be implemented to operate on data that does not relate to an image. The invention has been described in relation to implementations that include readily available discrete components. The invention mignt also be implemented with custom VLSI components, and similarly with custom memory components. The invention has been described in relation to implementations with conventional microprocessors, but the invention might also be implemented with reduced instruction set (RISC) chips or with any other processor, including the processor of a mainframe computer, minicomputer, supercomputer, or any other computing device. The invention has been described in relation to composite operands with simple structures. In the examples described above, all component data items are of the same length and the components within a composite operand need not be related to each other The invention could also be implemented with composite operands with additional structure, within the limitations of processor width. For example, a composite operand could include component data items of different widths, provided that other operands are aligned with components of the same widths in the same positions. Also, the component data items could be arranged in groups of two or more, with the components in each group being related: If the components in each group relate to the same pixel, each component could hold a value for a respective threshold reduction. More generally, if the components in each group relate to the same location in a physical simulation space, one component could hold a value for the location and the other locations could hold derivatives at the location.

Claims: A method of operating a processor (66) that includes processing circuitry (94) for performing arithmetic oeprations in parallel on operands; the processing circuitry (94) having a plurality of processing positions (96), each for performing operations on one bit; the processing circuitry (94) including position connecting circuitry (98) connecting the processing positions (96) to form an array of processing positions; the position connecting circuitry (98) connecting adjacent processing positions (96) so that a signal from one of the processing positions can be transferred to an adjacent processing position; the method including the steps of: a) providing one or more sequences (200) of two or more component data items (202, 204), each including more than one bit, to the processing positions (96) in the processing circuitry (94); each sequence having at least a first component data item (204) with a most significant bit adjacent to a least significant bit of a second component data item (202) in said sequence; b) providing a buffer bit (216, 236, 246, 256, 286, 288, 276, 278, 296, 298) between the first and second component data items in said sequence; said sequence of component data items forming a composite operand that includes the buffer bit; c) operating the processor (66) to perform an arithmetic operation in parallel on the composite operand; the arithmetic operation being an operation that would ordinarily produce an inter-component signal from the first component data item to the second component data item causing the arithmetic operation to obtain an invalid result for the second component data item; the buffer bit having a value that ensures that the arithmetic operation obtains a valid result for the second component data item despite the inter-component signal; the arithmetic operation producing, for each component data item, a respective resulting data item indicating a valid result of the arithmetic operation on the component data item;- said method being characterized in that said buffer bit replaces either the most significant bit of the first component data item or the least significant bit of the second component data item. A method as claimed in claim 1, in which the act of operating the processor (66) comprises obtaining a value in the position of the buffer bit so that the position of the buffer bit does not respond to the inter-component signal by providing a signal to the position connecting circuitry (98). A method as claimed in claim 1 or claim 2, in which the least significant bit of the second component data item is the buffer bit. A method as claimed in claim 1 or claim 2, in which the most significant bit of the first component data item is the buffer bit. A method as claimed in any preceding claim, further comprising: providing a second sequence of two or more component data items, each including more than one bit, to the processing positions (96) in the processing circuitry (94); the second sequence including a buffer bit aligned with the buffer bit in the first-mentioned sequence; the arithmetic operation being performed on the first and second sequences. A method as claimed in any preceding claim in which the arithmetic operation is addition and the buffer bit has the value zero. A method as claimed in any of claims 1 to 5 in which the arithmetic operation is subtraction and the buffer bit has the value one.

Inventors: DAVIES DANIEL, DAVIES, DANIEL
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1993
Main classification: G06F7
IPC codes: G06F7, G06F15