23 MULTIPLIER/DIVIDER (COPRO)
S1C17554/564 TECHNICAL MANUAL
Seiko Epson Corporation
23-3
3.1 Operation in Multiplication Mode
Table 23.
Mode setting
value
Instruction
Operations
Flags
Remarks
0x04
or 0x05
ld.ca %rd,%rs
res[31:0]
← %rd × %rs
%rd
← res[15:0]
psr (CVZN)
← 0b0000 The operation result register
keeps the operation result until
it is rewritten by other opera-
tion.
(ext
imm9)
ld.ca %rd,imm7
res[31:0]
← %rd × imm7/16
%rd
← res[15:0]
0x14
or 0x15
ld.ca %rd,%rs
res[31:0]
← %rd × %rs
%rd
← res[31:16]
(ext
imm9)
ld.ca %rd,imm7
res[31:0]
← %rd × imm7/16
%rd
← res[31:16]
res: operation result register
Example:
ld.cw %r0,0x4
; Sets the modes (unsigned multiplication mode and 16 low-order bits output mode).
ld.ca %r0,%r1
; Performs “res = %r0
× %r1” and loads the 16 low-order bits of the result to %r0.
ld.cw %r0,0x13 ; Sets the modes (operation result read mode and 16 high-order bits output mode).
ld.ca %r1,%r0
; Loads the 16 high-order bits of the result to %r1.
Division
23.4
The division function performs “B (16 bits)
÷ C (16 bits) = A (16 bits), residue D (16 bits).”
To perform a division, set the operation mode to 0x8 (unsigned division) or 0x9 (signed division). Then send the
16-bit dividend (B) and 16-bit divisor (C) to the multiplier/divider using a “ld.ca” instruction. The quotient and
the residue will be stored in the low-order 16 bits and the high-order 16 bits of the operation result register, respec-
tively. The 16-bit quotient or residue according to the output mode specification and the flag status will be returned
to the CPU registers. Another 16-bit result should be read by setting the multiplier/divider into operation result read
mode.
S1C17 Core
Operation result
register
Selector
Argument 2
Argument 1
16 bits
Coprocessor
output (16 bits)
Flag output
Operation
result
÷
4.1 Data Path in Division Mode
Figure 23.
4.1 Operation in Division Mode
Table 23.
Mode setting
value
Instruction
Operations
Flags
Remarks
0x08
or 0x09
ld.ca %rd,%rs
res[31:0]
← %rd ÷ %rs
%rd
← res[15:0] (quotient)
psr (CVZN)
← 0b0000 The operation result register
keeps the operation result until
it is rewritten by other opera-
tion.
(ext
imm9)
ld.ca %rd,imm7
res[31:0]
← %rd ÷ imm7/16
%rd
← res[15:0] (quotient)
0x018
or 0x19
ld.ca %rd,%rs
res[31:0]
← %rd ÷ %rs
%rd
← res[31:16] (residue)
(ext
imm9)
ld.ca %rd,imm7
res[31:0]
← %rd ÷ imm7/16
%rd
← res[31:16] (residue)
res: operation result register