摘要 |
Provided are data processing apparatus and method for performing a shift function on a binary number. The apparatus comprises a count determination circuit for determining a number of contiguous bit positions in the binary number that have a predetermined bit value, and the count determination circuit outputs a count value indicative of the number of contiguous bit positions determined. In parallel with the operation of the count determination circuit, a coarse shifting circuit is used to determine, for at least one predetermined number of contiguous bit positions, whether that predetermined number of contiguous bit positions within the binary number has the predetermined bit value. An initial shift operation is then performed on the binary number based on that determination in order to produce an intermediate binary number. When the count value is available from the count determination circuit, a fine shifting circuit then performs a further shift operation on the intermediate binary number, based on the count value output by the count determination circuit, in order to produce the result binary number. Accordingly, provided an efficient mechanism for performing a shift function on a binary number, while still capturing the count value from the count determination circuit. |