English
Language : 

NS32CG16-10 Datasheet, PDF (73/82 Pages) National Semiconductor (TI) – High-Performance Printer / Display Processor
Appendix B Instruction Execution Times (Continued)
TOPi
L
f
Tf
Ti
If operand is in a register or is immediate then
TOPi e 0
else if i e byte then TOPi e TOPB
else if i e word then TOPi e TOPW
else (i e double-word) then TOPi e TOPD
If i (operation length) e byte then L e 1
else if i e word then L e 2
else (i e double-word) L e 4
If standard floating (32 bits) f e 1
If long floating (64 bits) f e 2
Tf e 4
If integer e byte or word then Ti e 2
If integer e double-word then Ti e 4
B 1 2 Notes on Table Use
Values in the TEA1 and TEA2 columns indicate whether
effective addresses need to be calculated
A value of 1 indicates that address calculation time is re-
quired for the corresponding operand A 0 indicates that the
operand is either missing or it is in a register and the in-
struction has an optimized form which eliminates the TEA
calculation for it
In the L column multiply the entry by the operation length in
bytes (1 2 or 4)
In the TCY column special notations sometimes appear
x n1
n2 means n1 minimum n2 maximum
n1%n2 means that the instruction flushes the instruction
queue after n1 clock cycles and nonsequentially fetches the
next instruction The value n2 indicates the number of clock
cycles for the internal execution of the instruction (including
n1)
The effective number of cycles (TCY) must take into ac-
count the time (Tfetch) required to fetch the portion of the
next instruction including the basic encoding and the index
bytes This time depends on the size and the alignment of
this portion
If only one memory cycle is required then
TCY e n1 a 6 a Tfetch
If more than one memory cycle is required then
TCY e n1 a 5 a Tfetch
In the notes column notations held within angle brackets
k l indicate alternatives in the operand addressing modes
which affect the execution time A table entry which is af-
fected by the operand addressing may have multiple values
corresponding to the alternatives These addressing nota-
tions are
kIl Immediate
kRl CPU Register
kMl Memory
kFl FPU Register either 32 or 64 Bits
kxl Any Addressing Mode
kabl a and b represent the addressing modes of operand
1 and 2 respectively Both a and b can be any ad-
dressing mode (e g kMRl means memory to
CPU register)
Note Unless otherwise specified the TCY value for immediate addressing is
the same as for CPU register addressing
B 1 3 Calculation of the Execution Time TEX for Basic
Instructions
The execution time for a basic instruction is obtained by
performing the following steps
1 Find the desired instruction in Table B-1
2 Calculate the values of TEA TOPB etc using the num-
bers in the table and the equations given in the previous
sections
3 The result derived by adding together these values is the
execution time TEX in clock cycles
EXAMPLE
Calculate TEX for the instruction CMPW R0 TOS
Operand 1 is in a register Operand 2 is in memory This
means that we must use the table values corresponding to
the kxMl case as given in the Notes column
Only the TEA1 TEA2 TOPi and TCY columns have
values assigned for the CMPi instruction Therefore they
are they only ones that need to be calculated to find TEX
The blank columns are irrelevant to this instruction
Both TEA1 and TEA2 columns contain 1 for the kxMl
case This means that effective address times have to be
calculated for both operands (For the kMRl case the
Register operand would have required no TEA time there-
fore only the Memory operand TEA would have been neces-
sary ) From the equations
TEA1 (Register mode) e 2
TEA2 (Top of Stack mode access class read) e 2
The TOPi column represents potential operand transfers
to or from memory For a Compare instruction each oper-
and is read once for a total of two operand transfers
TOPi (Word Register) e 0
TOPi (Word TOS) e 3 (assuming the operand aligned)
Total TOPi e 3
TCY is the time required for internal operation within the
CPU The TCY value for this case is 3
TEX e TEA1 a TEA2 a TOPi a TCY e 2 a 2 a 3 a 3
e 10 machine cycles
If the CPU is running at 20 MHz then a machine cycle (clock
cycle) is 50 ns Therefore this instruction would take 10 c
50 ns or 0 5 ms to execute
B 1 4 Calculation of the Execution Time TEX for Float-
ing-Point Instructions
The execution time for a floating-point instruction is ob-
tained by performing the following steps
1 Find the desired instruction in Table B-2
2 Calculate the values of TEA1 TEA2 TOPB etc using
the numbers in the table and the equations given in the
previous sections
3 Get the floating-point instruction execution time TFPU
from the appropriate FPU data sheet
4 Choose the higher value between TPR and TFPU a 3
5 The result derived by adding together these values is the
execution time TEX in clock cycles
EXAMPLE 1
Calculate TEX for the instruction MOVLF F0 h 3000
Assumptions
 The FPU being used is the NS32181
 Write cycles are performed with no wait states
73