beautypg.com

Shift right/left, Normalize, Bit accumulator – Maxim Integrated High-Speed Microcontroller Users Guide: DS80C390 Supplement User Manual

Page 158

background image

High-Speed Microcontroller User’s Guide: DS80C390 Supplement

158 of 158

Maxim/Dallas Semiconductor cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim/Dallas Semiconductor product.
No circuit patent licenses are implied. Maxim/Dallas Semiconductor reserves the right to change the circuitry and specifications without notice at any time.

M a x i m I n t e g r a t e d P r o d u c t s , 1 2 0 S a n G a b r i e l D r i v e , S u n n y v a l e , C A 9 4 0 8 6 4 0 8 - 7 3 7 - 7 6 0 0

© 2006 Maxim Integrated Products

The Maxim logo is a registered trademark of Maxim Integrated Products, Inc. The Dallas logo is a registered trademark of Dallas Semiconductor Corporation.

Shift Right/Left

The shift function rotates the 32 bits of the MA register as directed by the control bits of the MCNT0
register. MA will contain the shifted results following the operation. Note that the multiplier register shift
bits (MCNT.4-0) must be set to a nonzero value or the Normalize function will be performed instead of
the desired shift operation.

1. Load MA with data LSB.
2. Load MA with data LSB+1.
3. Load MA with data LSB+2.
4. Load MA with data MSB.
5. Configure MCNT0 register as required.
6. Poll the MST bit until cleared. (9 machine cycles)
7. Read MA for result MSB.
8. Read MA for result LSB+2.
9. Read MA for result LSB+1.
10. Read MA for result LSB.

Normalize

The normalize function is used to convert four byte unsigned binary integers into floating point format by
removing all leading zeros by shift left operations. Following the operation MA will contain the
normalized value (mantissa) and the MAS4-0 bits will contain the number of shifts performed
(characteristic).

1. Load MA with data LSB.
2. Load MA with data LSB+1.
3. Load MA with data LSB+2.
4. Load MA with data MSB.
5. Write 00000b to the MAS4-0 bits in the MCNT0 register.
6. Poll the MST bit until cleared. (9 machine cycles)
7. Read MA for mantissa MSB.
8. Read MA for mantissa LSB+2.
9. Read MA for mantissa LSB+1.
10. Read MA for mantissa LSB.
11. Read MAS4–0 to determine the number of shifts performed.

40-BIT ACCUMULATOR

The accelerator also incorporates an automatic accumulator function, permitting the implementation of
multiply-and-accumulate and divide-and-accumulate functions without any additional delay. Each time
the accelerator is used for a multiply or divide operation, the result is transparently added to a 40-bit
accumulator. This can greatly increase speed of DSP and other high-level math operations.

The accumulator can be accessed any time the Multiply/Accumulate Status Flag (MCNT1;D2h) is
cleared. The accumulator is initialized by performing five writes to the Multiplier C Register (MC;D5h),
LSB first. The 40-bit accumulator can be read by performing five reads of the Multiplier C Register,
MSB first.