首页>
外国专利>
A method and apparatus for computing the average of two integers rounded from zero within a single instruction cycle (Calculating the average of two integer numbers rounded away from a single instruction cycle)
A method and apparatus for computing the average of two integers rounded from zero within a single instruction cycle (Calculating the average of two integer numbers rounded away from a single instruction cycle)
The average of two integers with or without a sign rounded from 0 as defined in the MPEG standard is calculated by shifting each operand number to the right, summing the shifted operand numbers, and then incrementing the result, /RTI The shifted operation numbers are added by the adder, and the adder provides the sum of the shifted operation numbers and the sum of the shifted operation numbers + 1. The multiplexer controlled by the control circuit selects one of the sum output and sum + 1 output. The increment (selection of sum + 1 output) is made based on the checking of the shifted out bits of the operands and the most significant bit of the sum and the mode signal indicating whether the operands are signed or not.
展开▼