11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MPYR Signed Multiply and Round MPYROperation:±S1 *S2+r -+ D (parallel move)±S1 *S2+r -+ D (parallel move)±(S1 *2- n )+r -+ D (no parallel move)Assembler Syntax:MPYR (±)S1,S2,D (parallel move)MPYR (±)S2,S1,D (parallel move)MPYR (±)S,#n,D (no parallel move)Description: Multiply the two signed 24-bit source operands S1 and S2 (or the signed24-bit source operand S by the positive 24-bit immediate operand 2- n ), round the resultusing convergent rounding, and store it in the specified 56-bit destination accumulator D.The "-" sign option is used to negate the product prior to rounding. The default signoption is "+". The contribution <strong>of</strong> the LS bits <strong>of</strong> the result is rounded into the upper portion<strong>of</strong> the destination accumulator (A1 or B1) by adding a constant to the LS bits <strong>of</strong> the lowerportion <strong>of</strong> the accumulator (AO or BO). The value <strong>of</strong> the constant added is determined bythe scaling mode bits SO and S1 in the status register. Once the rounding has been completed,the LS bits <strong>of</strong> the destination accumulator D (AO or BO) are loaded with zeros tomaintain an unbiased accumulator value which may be reused by the next instruction.The upper portion <strong>of</strong> the accumulator (A1 or B1) contains the rounded result which maybe read out to the data buses. Refer to the RND instruction for more complete informationon the convergent rounding process.Example 1:MPYR - YO,YO,B (R3)-N3;square and negate YO, update R3Before ExecutionYOI~ ________ $_65_4_32_1 __ ~After ExecutionYOI~ ________ $_6_54_32_1 __ ~BI~ ___ $_OO_:O_OO_OO_O_:OO_O_OO_O __ ~ BI~ ___ $_F_F:_AF_E_3E_D_:O_OO_OO_O __ ~Explanation <strong>of</strong> Example 1: Prior to execution, the 24-bit YO register contains the value$654321 (0.791111112), and the 56-bit B accumulator contains the value$00:000000:000000 (0.0). The execution <strong>of</strong> the MPYR -YO,YO,B instruction squares the24-bit signed value in the YO register, negates the resulting 48-bit product, rounds theresult into B1, and zeros BO (-YO*YO=-0.625856790961748 approximately=$FF:AFE3EC:B76B7E, which is rounded to the value $FF:AFE3ED:000000=-0.625856757164002=B).

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

Saved successfully!

Ooh no, something went wrong!