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.
|
ACCx[31:0] Value | Increment ACCx[71:32]? | |||
|---|---|---|---|---|
| Convergent | Biased | |||
| ACCx[32] = 0 | ACCx[32] = 1 | ACCx[32] = 0 | ACCx[32] =1 | |
| ACCx[31] = 0 | No | No | No | No |
| ACCx[31:0] = 32’h80000000 | No | Yes | Yes | Yes |
| ACCx[31] = 1 | Yes | Yes | Yes | Yes |
|
ACCx[31:0] Value | Increment ACCx[71:48]? | |||
|---|---|---|---|---|
| Convergent | Biased | |||
| ACCx[48] = 0 | ACCx[48] = 1 | ACCx[48] = 0 | ACCx[48] =1 | |
| ACCx[47] = 0 | No | No | No | No |
| ACCx[47:0] = 48’h800000000000 | No | Yes | Yes | Yes |
| ACCx[47] = 1 | Yes | Yes | Yes | Yes |
