17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

126 D LOG P Float logarithm operation<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong> <strong>SX2</strong><br />

SE<br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

S 1 * * *<br />

S 2 * * *<br />

D *<br />

Operands:<br />

S 1 : Base S 2 : Antilogarithm D: <strong>Operation</strong> result<br />

DLOG, DLOGP: 13 steps<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

Explanations:<br />

1. Perform logarithm operation with S 1 as the base and S 2 as the antilogarithm and save the<br />

result in D.<br />

2. Only a positive number is valid for S. Register D has to be 32-bit format. <strong>Operation</strong> is<br />

conducted in floating point value, so the value in S needs to be converted into floating value<br />

before logarithm operation.<br />

3. Logarithm operation: S D S<br />

1 = S 2 , D = ? Log<br />

2<br />

S1 = D<br />

Example: Assume S 1 = 5, S 2 = 125, S D 1 = S 2 , D = ? 5 D S<br />

= 125 D = Log<br />

2<br />

S1 = log 125 5 = 3.<br />

4. Flags: M1020 (Zero flag), M1021 (Borrow flag) and M1022 (Carry flag).<br />

If absolute value of the result is larger than max. floating value, carry flag M1022 = ON.<br />

If absolute value of the result is smaller than min. floating value, borrow flag M1021 = ON.<br />

If the conversion result is 0, zero flag M1020 = ON.<br />

Program Example:<br />

1. When M0 = ON, convert (D1, D0) and (D3, D2) to binary floating value and save the result in<br />

register (D11, D10) and (D13, D12) individually.<br />

2. When M1= ON, perform logarithm operation with (D11, D10) as base and (D13, D12) as<br />

antilogarithm. The results are saved in register (D21, D20) in binary floating format.<br />

3. When M2 = ON, convert the value in (D21, D20) into decimal floating point value and save the<br />

result in (D31, D30). (At this time, D31 indicates powers of 10 for D30)<br />

3-309

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!