Multiplication - Epson S1C17F13 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

21 Multiplier/Divider (COPRO)
Setting value
(D[6:4])
16 low-order bits output mode
0x0
The low-order 16 bits of operation results
can be read as the coprocessor output.
16 high-order bits output mode
0x1
The high-order 16 bits of operation results
can be read as the coprocessor output.
0x2–0x7
Reserved
21.3

Multiplication

The multiplication function performs "A (32 bits) = B (16 bits) × C (16 bits)."
The following shows a procedure to perform a multiplication:
1. Set the mode to 0x04 (unsigned multiplication, 16 low-order bits output mode) or 0x05 (signed multiplication,
16 low-order bits output mode).
2. Send the 16-bit multiplicand (B) and 16-bit multiplier (C) to COPRO using a "ld.ca" instruction.
3. Read the one-half result (16 low-order bits = A[15:0]) and the flag status.
4. Set the mode to 0x13 (operation result read, 16 high-order bits output mode).
5. Read another one-half result (16 high-order bits = A[31:16]).
S1C17 Core
21-2
Table 21.
2.1 Mode Settings
Output mode
Argument 2
Argument 1
Coprocessor
output (16 bits)
Flag output
Figure 21.
3.1 Data Path in Multiplication Mode
Seiko epson Corporation
Setting value
(D[3:0])
Initialize mode 0
0x0
Clears the operation result register to 0x0.
Initialize mode 1
0x1
Loads the 16-bit augend into the low-order
16 bits of the operation result register.
Initialize mode 2
0x2
Loads the 32-bit augend into the operation
result register.
Operation result read mode
0x3
Outputs the data in the operation result reg-
ister without computation.
Unsigned multiplication mode
0x4
Performs unsigned multiplication.
Signed multiplication mode
0x5
Performs signed multiplication.
0x6
Reserved
Signed MAC mode
0x7
Performs signed MAC operation.
Unsigned division mode
0x8
Performs unsigned division.
Signed division mode
0x9
Performs signed division.
0xa–0xf
Reserved
COPRO
16 bits
32 bits
Operation
result
Operation result
register
Selector
Operation mode
S1C17F13 TeChniCal Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading

Table of Contents