mcf51jf128 Freescale Semiconductor, Inc, mcf51jf128 Datasheet - Page 283

no-image

mcf51jf128

Manufacturer Part Number
mcf51jf128
Description
Mcf51jf128 Reference Manual
Manufacturer
Freescale Semiconductor, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mcf51jf128VLH
Manufacturer:
MITSUBISHI
Quantity:
321
Part Number:
mcf51jf128VLH
Manufacturer:
FREESCALE
Quantity:
5 097
Part Number:
mcf51jf128VLH
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Part Number:
mcf51jf128VLH
Manufacturer:
FREESCALE
Quantity:
5 097
12.3.1.1 Rounding
When the processor is in fractional mode, there are two operations during which rounding
can occur:
To understand the round-to-nearest-even method, consider the following example
involving the rounding of a 32-bit number, R0, to a 16-bit number. Using this method,
the 32-bit number is rounded to the closest 16-bit number possible. Let the high-order 16
bits of R0 be named R0.U and the low-order 16 bits be R0.L.
This method minimizes rounding bias and creates as statistically correct an answer as
possible.
The rounding algorithm is summarized in the following pseudocode:
if R0.L < 0x8000
else if R0.L > 0x8000
else if lsb of R0.U = 0
else Result = R0.U + 1
The round-to-nearest-even technique is also known as convergent rounding.
Freescale Semiconductor, Inc.
1. Execution of a store accumulator instruction (move.l ACCx,Rx). The lsbs of the 48-
2. Execution of a MAC (or MSAC) instruction with 32-bit operands. If MACSR[R/T]
• If R0.L is less than 0x8000, the result is truncated to the value of R0.U.
• If R0.L is greater than 0x8000, the upper word is incremented (rounded up).
• If R0.L is 0x8000, R0 is half-way between two 16-bit numbers. In this case, rounding
bit accumulator logic are used to round the resulting 16- or 32-bit value. If
MACSR[S/U] is cleared, the low-order 8 bits round the resulting 32-bit fraction. If
MACSR[S/U] is set, the low-order 24 bits are used to round the resulting 16-bit
fraction.
is zero, multiplying two 32-bit numbers creates a 64-bit product truncated to the
upper 40 bits; otherwise, it is rounded using round-to-nearest (even) method.
is based on the lsb of R0.U, so the result is always even (lsb = 0).
• If the lsb of R0.U equals 1 and R0.L equals 0x8000, the number is rounded up.
• If the lsb of R0.U equals 0 and R0.L equals 0x8000, the number is rounded
down.
then Result = R0.U
then Result = R0.U + 1
then Result = R0.U
MCF51JF128 Reference Manual, Rev. 2, 03/2011
/* R0.L = 0x8000 */
Preliminary
Chapter 12 Enhanced Multiply-Accumulate Unit (EMAC)
283

Related parts for mcf51jf128