dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 205

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
8.4.5
Both integer and fractional division are subject to division overflow. Overflow is the case where the
correct value of the quotient will not fit into the destination available to store it.
For division of fractional numbers, the result must be a 16-bit, signed fractional value greater than or equal
to -1.0 and less than 1.0 - 2
For the case where the magnitude of the dividend is larger than the magnitude of the divisor, this inequality
will not be true because any result generated will be larger in magnitude than 1.0. Thus, division overflow
occurs with fractional numbers for the case where the absolute value of the divisor is less than or equal to
the absolute value of the dividend:
If this condition can be true when dividing fractional numbers, it must be prevented from occurring by first
scaling the dividend.
For the division of integer numbers, the result must be a 16-bit, signed integer value greater than or equal
to -2
When integer numbers are being divided, it must be guaranteed that the final result can fit into a signed,
16-bit integer value. Otherwise, to prevent this from occurring, it is first necessary to scale the numerator.
8.5
The DSP56800 core currently supports a one-word, one-instruction-cycle POP instruction for removing
information from the stack. The PUSH operation, however, is a two-word, two-instruction-cycle macro,
which expands to the following code. (This instruction macro works quite well when pushing a single
variable.)
; Expansion of the PUSH Instruction Macro
; Emulated in 2 Icyc, 2 Instruction Words
PUSH
However, there is a better technique when it is necessary to push more than one value onto the software
stack. Instead of using consecutive PUSH instruction macros, it is more efficient and saves more
instruction words by expanding out the PUSH operation:
; Faster technique for pushing multiple values onto the stack
; Finishes in 5 Icyc, 5 Instruction Words
PUSHN MACRO
In this case five instruction cycles and five words are used to push four values onto the software stack. If
the PUSH instruction macro had been used instead, it would have performed the same function in eight
instruction cycles with eight words.
Freescale Semiconductor
[N-1]
-1.0 ≤ quotient < +1.0 - 2
| divisor | ≤ | dividend |
-2
MACRO REG1
LEA
MOVE
ENDM
LEA
MOVE
MOVE
MOVE
MOVE
ENDM
Multiple Value Pushes
Overflow Cases
and less than or equal to [2
[N-1]
≤ quotient ≤ [2
(SP)+
REG1,X:(SP)
(SP)+
X0,X:(SP)+
Y0,X:(SP)+
R0,X:(SP)+
R1,X:(SP)
-[N-1]
[N-1]
. In other words, it must satisfy the following:
-[N-1]
-1], where N = 16
[N-1]
; Pushing X0,Y0,R0,R1
; Increment SP
; No post-increment SP on last MOVE
-1], where N is equal to 16. In other words:
Software Techniques
; Push REG1 in stack
; Increment the SP (1 Icyc, 1 Word)
; Place value onto the stack
; (1 Icyc, 1 Word)
Multiple Value Pushes
8-19

Related parts for dsp56800