Calculating the average of two integer numbers rounded towards zero in a single instruction cycle
Abstract
The average of two signed or unsigned integer numbers (A, B) rounded towards zero as prescribed in the MPEG standard is calculated in one instruction cycle by right shifting each of the operands by one bit position, summing the shifted operands, and incrementing the result as appropriate. The shifted operands are summed in an adder (302) that provides two versions of the average, one being the sum of the shifted operands and the other being the sum-plus-one of the shifted operands. A multiplexer (310) under control of a control circuit (308) selects one of the sum and sum-plus-one outputs. Incrementing (selecting the sum-plus-one output) is based on inspection of the shifted-out bits of the operands, the most significant bit of the sum, and a mode signal indicative of whether the operands are signed or unsigned values.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 11 · Forward citations: 8.
Claims (2 — 2 Independent, 0 Dependent)
- Claim 1Independent Claim
A method of operating a circuit to obtain an average of two unsigned operands such that the average is an integer rounded towards zero in a single instruction cycle, comprising: logically right-shifting each of the operands by one bit position, wherein bits in a lowest significant bit position of the operands become shifted-out bits; summing the right-shifted operands to obtain a result; and incrementing the result when both of the shifted-out bits are one's.
- Claim 2Independent Claim
A method of operating a circuit to obtain an average of two signed operands such that the average is an integer rounded towards zero in a single instruction cycle, comprising: arithmetically right-shifting each of the operands by one bit position, wherein bits in a lowest significant bit position of the operands become shifted-out bits; summing the right-shifted
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗