The ALU and Basic Arithmetic
Last Edit November 1, 1996; May 1, 1999 ; July 18, 2001
Multiplication with the Am2901
To implement the above algorithm using the Am2901,
the bits of the multiplier need to be examined one at a time. To
perform the addition, shifting down is necessary to maintain alignment.
To conditionally ass the multiplicand or 0, control of the sourceoperand
pair (A, B) or (A, 0) is required and a method of conditional subtraction
is needed.
The functional diagram of the multiply operation is
given in Figure 66. The actual schematic of a 16bit Am2901
ALU is shown in Figure 67.
Figure 66 Am2901A Multiply functional diagram
Figure 67 Specific interconnections for 16bit
multiply  ripple carry
The additional hardware provides the following connections:
 When Q is loaded and after each instance when it is shifted,
Q_{0}, is inverted and connected to a MUX which is controlled
from the CCU. Under multiply, the MUX selects Q_{0}; under
normal operation, the MUX selects 1_{i}. Q_{0}
operates to control the source operands so that:
Q_{0}

I_{i}

Source Pair

0

1

B + 0

1

0

B + A

 When R_{B} is shifted down (R_{B} is any scratchpad
register), R_{B0} is shifted into Q_{3}
of the most significant slice.
 When R_{B} is shifted down SIGN OVR is shifted into
R_{B3} of the most significant slice. This
is equivalent to:
R_{B3} = F_{3} EXOR C_{n+4}
EXOR C_{n+3}
The Algorithm
The microcode algorithm is as follows:
The result is across registers R_{B} and Q,
and the result is signextended to produce the proper number of
bits so that multiplication with any two 8bit two's complement
numbers always produces a 16bit result.
A sample 8 x 8 bit multiply is shown in Figures 68
and 69. Figure 69 shows the stepbystep walkthrough of the problem.
Sample microcode is given in the Am2900 Family Data Book
and the 2900 Family Study Guide. [Rare books at this point.]
Figure 68 Eaxmple: 8 x 8 bit multiply two's complement
(B = b, A = a)
Figure 69 Walking through the Am2901A algorithm.
The Am2901A algorithm takes advantage of added hardware to eliminate
conditional jumps and therefore improve speed and reduce microcode
Am2903 Multiply
Unsigned Multiply
The Am2903 has unsigned multiplication implemented
as one of its special functions. To perform multiplication, zero
out the RAM register which, with Q, will contain the final result.
If it is not already present, load the multiplicand into another
RAM register. Load the multiplier into the Q register. The shift
connection should tie the LSB (leasat significant bit) of the RAM
register (S_{0}) to the MSB (most significant bit) of the
Q register (Q_{3}) of the most significant slaice.
The actual microcode is two microwords
 load the Am2910 counter with the number of bits minus 1 (for
16 x 16, load with 15) and place the multiplier into Q
 use RCPT for the Am2910 to repeat the actual multiply operation
Two's Complement Multiply
The Am2903 has two other special functions which enable
multiplication of a signed number. Two's complement multiply requires
three microwords for any width multiplication.
The same initialization is required, with the multiplier
being replaced into the Q register. The counter is this case is
loaded with the number of bits minus 2 (for 16x16, load with 14).
The repeast loop instruction is the same as before. The added step
is effectively the sign bit "correction" which was the
last step in the Am2901 algorithm. The required interconnect of
the slices is the same as before, with the addition of the Z status
line tied to C_{in}.
