English
Language : 

DS80C390_05 Datasheet, PDF (33/53 Pages) Dallas Semiconductor – Dual CAN High-Speed Microprocessor
DS80C390 Dual CAN High-Speed Microprocessor
ON-CHIP ARITHMETIC ACCELERATOR
An on-chip math accelerator allows the microcontroller to perform 32-bit and 16-bit multiplication, division, shifting,
and normalization using dedicated hardware. Math operations are performed by sequentially loading three special
registers. The mathematical operation is determined by the sequence in which three dedicated SFRs (MA, MB, and
MC) are accessed, eliminating the need for a special step to choose the operation. The normalize function
facilitates the conversion of 4-byte unsigned binary integers into floating point format. Table 2 shows the operations
supported by the math accelerator and their time of execution.
Table 2. Arithmetic Accelerator Execution Times
OPERATION
32-Bit/16-Bit Divide
16-Bit/16-Bit Divide
16-Bit/16-Bit Multiply
32-Bit Shift Left/Right
32-Bit Normalize
RESULT
32-Bit Quotient, 16-Bit Remainder
16-Bit Quotient, 16-Bit Remainder
32-Bit Product
32-Bit Result
32-Bit Mantissa, 5-Bit Exponent
EXECUTION TIME
(tCLCL)
36
24
24
36
36
Table 3 demonstrates the procedure to perform mathematical operations using the hardware math accelerator. The
MA and MB registers must be loaded and read in the order shown for proper operation, although accesses to any
other registers can be performed between access to the MA or MB registers. An access to the MA, MB, or MC
registers out of sequence corrupts the operation, requiring the software to clear the MST bit to restart the math
accelerator state machine. Consult the description of the MCNT0 SFR for details of how the shift and normalize
functions operate.
Software must ensure that the input value for the normalize operation is not zero or the function will not complete.
Compilers such as the one from Keil Software have updated their libraries and compensate for this condition.
Table 3. Arithmetic Accelerator Sequencing
DIVIDE (32/16 OR 16/16)
Load MA with dividend LSB.
Load MA with dividend LSB + 1.*
Load MA with dividend LSB + 2.*
Load MA with dividend MSB.
Load MB with divisor LSB.
Load MB with divisor MSB.
Poll the MST bit until cleared. (9 machine cycles).
Read MA to retrieve the quotient MSB.
Read MA to retrieve the quotient LSB + 2.**
Read MA to retrieve the quotient LSB + 1.**
Read MA to retrieve the quotient LSB.
Read MB to retrieve the remainder MSB.
Read MB to retrieve the remainder LSB.
MULTIPLY (16 X 16)
Load MB with multiplier LSB.
Load MB with multiplier MSB.
Load MA with multiplicand LSB.
Load MA with multiplicand MSB.
Poll the MST bit until cleared. (6 machine cycles).
Read MA for product MSB.
Read MA for product LSB + 2.
Read MA for product LSB + 1.
Read MA for product LSB.
SHIFT RIGHT/LEFT
Load MA with data LSB.
Load MA with data LSB + 1.
Load MA with data LSB + 2.
Load MA with data MSB.
Configure MCNT0 register as required
Poll the MST bit until cleared. (9 machine cycles)
Read MA for result MSB.
Read MA for result LSB + 2.
Read MA for result LSB + 1.
Read MA for result LSB.
*Not performed for 16-bit numerator.
**Not performed for 16/16 divide.
***Value to be normalized must be nonzero.
NORMALIZE
Load MA with data LSB.
Load MA with data LSB + 1.
Load MA with data LSB + 2.
Load MA with data MSB.***
Load MCNT0 with 00h.
Poll the MST bit until cleared. (9 machine cycles)
Read MA for mantissa MSB.
Read MA for mantissa LSB + 2.
Read MA for mantissa LSB + 1.
Read MA for mantissa LSB.
Read MCNT0.4–MCNT0.0 for exponent.
33 of 53