5 Categories and Use of Basic Application Instructions Operands: S : Source device (binary floating value) D : Operation result Explanations: 1. TANH value = (e s – e -s ) / (e s + e -s ).TANH instruction performs hyperbolic-tangent operation on S and stores the result in D 2. F refers to floating point input. Be sure to add a decimal point when using it. 3. Only 32-bit instructions DTANH and DTANHP are applicable. 4. Flags: a) If the absolute value of the result exceeds the max floating point value, carry flag will be ON. b) If the absolute value of the result is less than min. floating point value, borrow flag will be ON. c) If the conversion result is 0, zero flag will be ON.
Program Example: When X0 = ON, DTANH instruction performs hyperbolic-tangent operation on the binary floating value in (D1, D0) and stores the TANH value in (D11, D10) in binary floating format.. X0 Binary floating point TANH value binary floating point Points to note: For floating point operations, see “5.3 Numeric Values for Data Processing.” DVP-PM Application Manual 5-121 API Mnemonic Operands Function Controllers 20PM 10PM 138 D TANH P Hyperbolic Tangent Type OP Bit Devices Word Devices Program Steps X Y M S F H KnX KnY KnM KnS T C D V Z D S * * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 DTANH D0 D10 D 1 D 0 D 11 D 10