170 likes | 277 Views
ECT 464. Lecture 12 Advanced Math Instructions. Today’s Quote: It’s the little things in life that determine the big things.
E N D
ECT 464 Lecture 12 Advanced Math Instructions
Today’s Quote: It’s the little things in life that determine the big things. His master replied, 'Well done, good and faithful servant! You have been faithful with a few things; I will put you in charge of many things. Come and share your master's happiness!' Matthew 25:21
Scale Data (SCL) • The SCL instruction is used to produce a scaled output value that has a linear relationship. • Source and Destination must be addresses. • Rate is divided by 10000. • Offset can be an address or constant • Changes Carry, Overflow, Zero, and Sign bits
Scale with Parameters (SCP) • The SCP instruction is used to produce a scaled output value that has a linear relationship between the input and scaled values. • Input and Output Values must be addresses. • Input Min and Max can be addresses or constants. • Scaled Min and Max can be addresses or constants. • Changes Carry, Overflow, Zero, and Sign bits
Absolute (ABS) • The ABS instruction takes the absolute value of the Source and places it in the Destination. • Source and Destination must be addresses. • Changes Carry, Overflow, Zero, and Sign bits
Compute (CPT) • The CPT instruction performs copy, arithmetic, logical, and conversion operations. You define the operation in the expression and the result is written in the destination. • Destination must be addresses. • Changes Carry, Overflow, Zero, and Sign bits • Example Expression: SQR((N7:1 ** 2) + (N7:2 ** 2)) ** means ^
Swap (SWP) • Use the SWP instruction to swap the low and high bytes of a specified number of words in a bit, integer, or string file. The SWP instruction has 2 operands: • Source is the word address containing the words to be swapped. • Length is the number of words to be swapped, regardless of the file type.
Sine (SIN) • Use the SIN instruction to take the sine of a number and store the result in the destination. • Source must be between -205887 and 205887. • Changes Carry, Overflow, Zero, and Sign bits
Arc Sine (ASN) • Use the ASN instruction to take the arc sine of a number and store the result in the destination. • Source must be between -1 and 1. • Changes Carry, Overflow, Zero, and Sign bits
Cosine (COS) • Use the COS instruction to take the cosine of a number and store the result in the destination. • Source must be between -205887 and 205887. • Changes Carry, Overflow, Zero, and Sign bits
Arc Cosine (ACS) • Use the ACS instruction to take the arc cosine of a number and store the result in the destination. • Source must be between -1 and 1. • Changes Carry, Overflow, Zero, and Sign bits
Tangent (TAN) • Use the TAN instruction to take the tangent of a number and store the result in the destination. • Source must be between -205887 and 205887. • Changes Carry, Overflow, Zero, and Sign bits
Arc Tangent (ATN) • Use the ATN instruction to take the arc tangent of a number and store the result in the destination. • Source must be between -1 and 1. • Changes Carry, Overflow, Zero, and Sign bits
Natural Log (LN) • Use the LN instruction to take the natural log of a number and store the result in the destination. • Source must be between -87 and 88. • Changes Carry, Overflow, Zero, and Sign bits
Log to the Base 10 (LOG) • Use the LOG instruction to take the log base 10 of a number and store the result in the destination. • Source must be between -38 and 38. • Changes Carry, Overflow, Zero, and Sign bits
X to the Power of Y (XPY) • Use the XPY instruction to raise a value (Source A) to a power (Source B) and store the result in the destination. • Changes Carry, Overflow, Zero, and Sign bits • The XPY instruction uses the following algorithm: XPY = 2 ** (Y log2(X))