Perform an operation using the Arithmetic Logic Unit (ALU)

Perform an operation using the Arithmetic Logic Unit (ALU)

The arithmetic logic unit (ALU) which is an integral part of the Data Translation frame grabber is capable of a number of simple arithmetic and logic operations. The ALU has two input arms, labelled "A" and "B". Eight bit intensity information is transferred from one of the frame buffers, via the input look up table (ILUT) to the "A" arm of the ALU. Similarly eight bit intensity information is transferred from a second frame buffer, possibly panned in the horizontal and/or vertical pixel directions, and/or zoomed, to the "B" arm of the ALU. Note that the "B" arm is not translated by a look up table. The two eight bit inputs to the ALU are combined in the selected manner to produce a nine bit result. This nine bit result is then mapped onto eight bit space through the selected result look up table (RLUT). This facility of DigImage supports the full range of such ALU operations by specifying the buffers, look up tables, pan, zoom and ALU operations.

The ALU operations are divided into logical operations and two classes of arithmetic operations. The two classes of arithmetic operations vary in how the CARRYIN register on the frame grabber card is set. A list of the 48 operations is given below:

      Logical         Arithmetic              with carry
      0  nA           16 A                    32 A + 1
      1  n(A or B)    17 A or B               33 (A or B) + 1
      2  nA and b     18 A or nB              34 (A or nB) + 1
      3  0            19 -1                   35 zero
      4  n(A and B)   20 A + (A and nB)       36 A+(A and nB)+1
      5  nB           21 (A or B)+(A and nB)  37 (A or B)+(A and nB)+1
      6  A xor B      22 A - B - 1            38 A - B
      7  A and nB     23 (A or nB) - 1        39 A and nB
      8  nA           24 A + (A and B)        40 A+(A and B)+1
      9  n(A xor B)   25 A + B                 41 A + B + 1
      10 B            26 (A or nB)+(A and B)  42 (A or nB)+(A and B)+1
      11 A and B      27 (A and B) - 1        43 A and B
      12 1            28 A + A                44 A + A + 1
      13 A or nB      29 (A or B) + A         45 (A or B)+A+1
      14 A or B       30 (A or nB) + A        46 (A or nB)+A+1
      15 A            31 A - 1                47 A

Note that nA and nB are the logical compliments of A and B, respectively. Addition operations (+) produce results between 0 and 511 as expected from adding two eight bit values. The subtraction operations (22 and 38) produce values between 256 and 511 for positive results, and between 0 and 255 for negative results.

Select Input Look Up Table The eight bit signal applied to input arm "A" is indirected through the input look up table (ILUT). A number of simple manipulations may be performed using this table. Details on those available are given by the 'H' Help option within the Select Input Look Up Table submenu.

Select Result Look Up Table The nine bit signal output from the ALU must be mapped onto eight intensity bits. This is achieved by passing the ALU output through the 512 elements of the Result Look Up Table (RLUT), each element containing an eight bit value. The mapping may perform simple arithmetic operations in its own right. Details on the RLUTs available are given by the 'H' Help option within the Select Result Look Up Table submenu.

"A" buffer ?

Any valid image buffer may supplied as the "A" buffer. If the buffer specified is in extended memory, then the buffer is first copied to buffer 0 as the ALU is able to access only the onboard buffers.

"B" buffer ?

Any onboard image buffer may supplied as the "B" buffer. If the buffer specified is in extended memory, then it will either be copied to buffer 0 or exchanged with buffers 1 or 2 (depending on where the "A" and result buffers are) before processing. If an exchange is made, then the exchange is undone after the ALU operation has been performed.

Result buffer ?

Any valid image buffer may supplied as the result buffer. If the buffer specified is in extended memory, then the ALU places the result in buffer 0, from where it is copied to extended memory. The result buffer is always made the current output buffer by this facility.

Zoom factor 1 to 8 (1/2/4/8) ?

The "B" buffer may optionally be zoomed and panned before being supplied to the "B" input arm of the ALU. The normal complete image requires a Zoom Factor of 1, a factor of 2 produces a double size image, etc.

Vertical offset ?

This field allows vertical panning of the image supplied to the "B" input arm of the ALU. This offset may be considered as the row number of the normal image which will be positioned at the top of the buffer for the ALU operation. A value of 0 indicates no vertical panning, -1 the buffer shifted down by one line, and 1 the buffer shifted up by one line.

Horizontal offset ?

This field allows horizontal panning of the image supplied to the "B" input arm of the ALU. This offset may be considered as the column number of the normal image which will be positioned at the left of the buffer for the ALU operation. A value of 0 indicates no horizontal panning, -1 the buffer shifted right by one line, and 1 the buffer shifted left by one line.

Parent menu

Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996