3.15.2 Rounding Modes

The accumulator stores the instruction SACR, and all AWB write operations can operate with one of two different accumulator rounding modes. The rounding function, either conventional (biased) or convergent (unbiased), is applied during the accumulator write (store). The rounding mode is selected by CORCON.RND.

Conventional (biased) rounding examines bit 31 (for long word sized data op) or bit 47 (for word sized data op) of the 72-bit accumulator, zero extends it, and adds it to the MS portion of the accumulator. Consequently, if the LS word of the accumulator is between 32’h8000000 and 32’hFFFFFFFF (for long word sized data op) or 48’h800000000000 and 48’hFFFFFFFFFFFF (for word sized data op), the MS portion of the accumulator will be incremented. Alternatively, if the LS word of the accumulator is between 0x00000000 and 32’h7FFFFFFF (long word sized data op) or 48’h000000000000 and 48’h7FFFFFFFFFFF (word sized data op), the MS portion of the accumulator is left unchanged. A consequence of this algorithm is that over a succession of random rounding operations, the value will tend to be biased slightly positive.

Convergent (or unbiased) rounding operates in the same manner as conventional rounding, except when the LS word equals 32’h80000000 (for long word sized data op) or 48’h800000000000 (for word sized data op). If this is the case, the LS-bit of the MS portion of the accumulator (that is, bit 32 or bit 48) is examined. If it is 1, the MS-portion of the accumulator is incremented. If it is 0, the MS portion of the accumulator is not modified.

Assuming that the bit examined is effectively random in nature, this scheme removes any rounding bias that may accumulate.

The two rounding modes are defined in the following tables for each operand (and accumulator write) size. The rounding block will round based on the contents of AccX[31:0] (Long word round) or AccX[47:0] (Word round) depending upon the data size selected for the instruction.
Table 3-12.  Rounding Operation (Long Word Operands and AWB Write)

ACCx[31:0] Value

Increment ACCx[71:32]?
ConvergentBiased
ACCx[32] = 0ACCx[32] = 1ACCx[32] = 0 ACCx[32] =1
ACCx[31] = 0NoNoNoNo
ACCx[31:0] = 32’h80000000 No YesYesYes
ACCx[31] = 1 YesYesYesYes
Table 3-13.  Rounding Operation (Word Operands and AWB Write)

ACCx[31:0] Value

Increment ACCx[71:48]?
ConvergentBiased
ACCx[48] = 0ACCx[48] = 1ACCx[48] = 0 ACCx[48] =1
ACCx[47] = 0NoNoNoNo
ACCx[47:0] = 48’h800000000000 No YesYesYes
ACCx[47] = 1 YesYesYesYes