Multiplication - Epson S1C17W03 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

20 Multiplier/Divider (COPRO2)
Setting
value
(D[6:4])
16 low-order bits output mode 0
0x0
The low-order 16 bits of the operation result reg-
ister 0 can be read as the coprocessor output.
16 high-order bits output mode 0
0x1
The high-order 16 bits of the operation result reg-
ister 0 can be read as the coprocessor output.
16 low-order bits output mode 1
0x2
The low-order 16 bits of the operation result reg-
ister 1 can be read as the coprocessor output.
16 high-order bits output mode 1
0x3
The high-order 16 bits of the operation result reg-
ister 1 can be read as the coprocessor output.
0x4–0x7 Reserved

20.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 0) or 0x05 (signed multiplica-
tion, 16 low-order bits output mode 0).
2. Send the 16-bit multiplicand (B) and 16-bit multiplier (C) to COPRO2 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 0).
5. Read another one-half result (16 high-order bits = A[31:16]).
S1C17 Core
20-2
Table 20.2.1 Mode Settings
Output mode
COPRO2
Argument 2
Argument 1
Operation result
Coprocessor
output (16 bits)
Flag output
Figure 20.3.1 Data Path in Multiplication Mode
Seiko Epson Corporation
Setting
value
(D[3:0])
Initialize mode 0
0x0
Clears the operation result registers 0 and 1
to 0x0.
Initialize mode 1
0x1
Loads the 16-bit augend into the low-order
16 bits of the operation result register 0.
Initialize mode 2
0x2
Loads the 32-bit data into the operation re-
sult register 0.
Operation result read mode
0x3
Outputs the data in the operation result reg-
isters 0 and 1 without computation.
Unsigned multiplication mode
0x4
Performs unsigned multiplication.
Signed multiplication mode
0x5
Performs signed multiplication.
Unsigned MAC mode
0x6
Performs unsigned MAC operation.
Signed MAC mode
0x7
Performs signed MAC operation.
Unsigned division mode
0x8
Performs unsigned division.
Signed division mode
0x9
Performs signed division.
Initialize mode 3
0xa
Loads the 32-bit data into the operation re-
sult register 1.
0xb–0xf Reserved
16 bits
32 bits
Operation result
Operation result
register 1
register 0
Selector
S1C17W03/W04 TECHNICAL MANUAL
Operation mode
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w04

Table of Contents